commit a38c832dee281c577f2a5c72af386150a4acf576 Author: Lance Edgar Date: Thu Oct 6 11:48:32 2016 -0500 Update changelog diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b0d3df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +rattail_poser.egg-info/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..ad763db --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +# -*- mode: conf -*- + +recursive-include poser/web/static *.css +recursive-include poser/web/static *.js + +recursive-include poser/web/templates *.mako diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..1a247c1 --- /dev/null +++ b/README.rst @@ -0,0 +1,11 @@ + +Rattail 'Poser' +=============== + +This project serves as a working demo, to illustrate various concepts of the +Rattail software framework. See the `Rattail Wiki`_ for more info. + +Note that it also aims to be usable as a starting point for your own +project(s), should you need one. + +.. _`Rattail Wiki`: https://rattailproject.org/moin/ diff --git a/poser/__init__.py b/poser/__init__.py new file mode 100644 index 0000000..489a9b0 --- /dev/null +++ b/poser/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +""" +Rattail 'Poser' (demo project) +""" + +from __future__ import unicode_literals, absolute_import + +from ._version import __version__ diff --git a/poser/_version.py b/poser/_version.py new file mode 100644 index 0000000..e727f3d --- /dev/null +++ b/poser/_version.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +__version__ = u'0.1.0' diff --git a/poser/web/__init__.py b/poser/web/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/poser/web/app.py b/poser/web/app.py new file mode 100644 index 0000000..9eff28d --- /dev/null +++ b/poser/web/app.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +""" +Pyramid web application +""" + +from __future__ import unicode_literals, absolute_import + +from tailbone import app + + +def main(global_config, **settings): + """ + This function returns a Pyramid WSGI application. + """ + # set some defaults for PostgreSQL + app.provide_postgresql_settings(settings) + + # prefer Poser templates over Tailbone; use 'better' theme + settings.setdefault('mako.directories', ['poser.web:templates', + 'tailbone:templates/themes/better', + 'tailbone:templates',]) + + # make config objects + rattail_config = app.make_rattail_config(settings) + pyramid_config = app.make_pyramid_config(settings) + + # bring in the rest of Tailbone + pyramid_config.include('tailbone.static') + pyramid_config.include('tailbone.subscribers') + pyramid_config.include('tailbone.views') + + # # bring in the rest of Poser + # pyramid_config.include('poser.web.subscribers') + # pyramid_config.include('poser.web.static') + # pyramid_config.include('poser.web.views') + + # configure PostgreSQL some more + app.configure_postgresql(pyramid_config) + + return pyramid_config.make_wsgi_app() diff --git a/poser/web/templates/menu.mako b/poser/web/templates/menu.mako new file mode 100644 index 0000000..e0fa107 --- /dev/null +++ b/poser/web/templates/menu.mako @@ -0,0 +1,139 @@ +## -*- coding: utf-8 -*- + +<%def name="main_menu_items()"> + + % if request.has_any_perm('schedule.view', 'timesheet.view'): +
  • + Time Clock + +
  • + % endif + +
  • + Products + +
  • + +
  • + Vendors + +
  • + +
  • + Company + +
  • + +
  • + Reports + +
  • + + % if request.has_any_perm('batch.handheld.list', 'batch.inventory.list'): +
  • + Batches + +
  • + % endif + + % if request.has_any_perm('users.list', 'roles.list', 'labelprofiles.list', 'settings.list', 'emailprofiles.list', 'datasyncchanges.list'): +
  • + Admin + +
  • + % endif + + % if request.user: +
  • + ${request.user}${" ({})".format(inbox_count) if inbox_count else ''} + +
  • + % else: +
  • ${h.link_to("Login", url('login'))}
  • + % endif + + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..28cc8a9 --- /dev/null +++ b/setup.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +""" +Setup script for Rattail 'Poser' +""" + +from __future__ import unicode_literals, absolute_import + +import os +from setuptools import setup, find_packages + + +here = os.path.abspath(os.path.dirname(__file__)) +execfile(os.path.join(here, 'poser', '_version.py')) +README = open(os.path.join(here, 'README.rst')).read() + + +requires = [ + # + # Version numbers within comments below have specific meanings. + # Basically the 'low' value is a "soft low," and 'high' a "soft high." + # In other words: + # + # If either a 'low' or 'high' value exists, the primary point to be + # made about the value is that it represents the most current (stable) + # version available for the package (assuming typical public access + # methods) whenever this project was started and/or documented. + # Therefore: + # + # If a 'low' version is present, you should know that attempts to use + # versions of the package significantly older than the 'low' version + # may not yield happy results. (A "hard" high limit may or may not be + # indicated by a true version requirement.) + # + # Similarly, if a 'high' version is present, and especially if this + # project has laid dormant for a while, you may need to refactor a bit + # when attempting to support a more recent version of the package. (A + # "hard" low limit should be indicated by a true version requirement + # when a 'high' version is present.) + # + # In any case, developers and other users are encouraged to play + # outside the lines with regard to these soft limits. If bugs are + # encountered then they should be filed as such. + # + # package # low high + + 'psycopg2', # 2.6.2 + 'rattail', # 0.7.25 +] + + +setup( + name = "rattail-poser", + version = __version__, + author = "Lance Edgar", + author_email = "lance@edbob.org", + url = "https://rattailproject.org/", + description = "Rattail Software Demo", + long_description = README, + + classifiers = [ + 'Private :: Do No Upload', + 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.7', + 'Topic :: Office/Business', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + + install_requires = requires, + packages = find_packages(), + + entry_points = { + 'paste.app_factory': [ + 'main = poser.web.app:main', + ], + }, +)