From e07ec3b9d714b22306c8b4abfb27e31284e5bbbd Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 20 Dec 2007 19:24:08 +0000 Subject: [PATCH] committing initial generic pylons framwork, with acq basics git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8252 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/oilsweb/MANIFEST.in | 2 + .../web/oilsweb/data/templates/oils/base.html.py | 118 ++++++++++++++++ .../data/templates/oils/default/acq/index.html.py | 58 ++++++++ .../templates/oils/default/acq/pl_builder.html.py | 87 ++++++++++++ .../data/templates/oils/default/acq/search.html.py | 109 +++++++++++++++ .../data/templates/oils/default/base.html.py | 121 ++++++++++++++++ .../data/templates/oils/default/footer.html.py | 27 ++++ .../data/templates/oils/default/navigate.html.py | 34 +++++ Open-ILS/web/oilsweb/development.ini | 76 ++++++++++ Open-ILS/web/oilsweb/docs/index.txt | 12 ++ Open-ILS/web/oilsweb/oilsweb.egg-info/PKG-INFO | 10 ++ Open-ILS/web/oilsweb/oilsweb.egg-info/SOURCES.txt | 29 ++++ .../oilsweb/oilsweb.egg-info/dependency_links.txt | 1 + .../web/oilsweb/oilsweb.egg-info/entry_points.txt | 7 + .../oilsweb.egg-info/paste_deploy_config.ini_tmpl | 58 ++++++++ .../oilsweb/oilsweb.egg-info/paster_plugins.txt | 3 + Open-ILS/web/oilsweb/oilsweb.egg-info/requires.txt | 1 + .../web/oilsweb/oilsweb.egg-info/top_level.txt | 1 + Open-ILS/web/oilsweb/oilsweb/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/config/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/config/environment.py | 33 +++++ Open-ILS/web/oilsweb/oilsweb/config/middleware.py | 57 ++++++++ Open-ILS/web/oilsweb/oilsweb/config/routing.py | 25 ++++ .../web/oilsweb/oilsweb/controllers/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/controllers/acq.py | 76 ++++++++++ Open-ILS/web/oilsweb/oilsweb/controllers/error.py | 39 ++++++ .../web/oilsweb/oilsweb/controllers/template.py | 27 ++++ Open-ILS/web/oilsweb/oilsweb/lib/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/lib/acq/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py | 44 ++++++ Open-ILS/web/oilsweb/oilsweb/lib/app_globals.py | 14 ++ Open-ILS/web/oilsweb/oilsweb/lib/base.py | 27 ++++ Open-ILS/web/oilsweb/oilsweb/lib/context.py | 99 +++++++++++++ Open-ILS/web/oilsweb/oilsweb/lib/helpers.py | 6 + Open-ILS/web/oilsweb/oilsweb/lib/util.py | 43 ++++++ Open-ILS/web/oilsweb/oilsweb/model/__init__.py | 0 Open-ILS/web/oilsweb/oilsweb/public/index.html | 108 +++++++++++++++ .../public/oils/media/css/skin/acq_default.css | 13 ++ .../oilsweb/public/oils/media/css/skin/default.css | 23 +++ .../public/oils/media/css/theme/acq_default.css | 10 ++ .../public/oils/media/css/theme/default.css | 15 ++ .../oilsweb/public/oils/media/images/eg_logo.jpg | Bin 0 -> 8571 bytes .../public/oils/media/images/eg_tiny_logo.jpg | Bin 0 -> 1722 bytes .../public/oils/media/xsl/acq-bibdata-marc.xslt | 154 +++++++++++++++++++++ .../web/oilsweb/oilsweb/templates/oils/base.html | 29 ++++ .../oilsweb/templates/oils/default/acq/index.html | 9 ++ .../templates/oils/default/acq/pl_builder.html | 21 +++ .../oilsweb/templates/oils/default/acq/search.html | 36 +++++ .../oilsweb/templates/oils/default/base.html | 33 +++++ .../oilsweb/templates/oils/default/footer.html | 2 + .../oilsweb/templates/oils/default/navigate.html | 7 + Open-ILS/web/oilsweb/oilsweb/tests/__init__.py | 40 ++++++ .../oilsweb/oilsweb/tests/functional/__init__.py | 0 .../oilsweb/oilsweb/tests/functional/test_acq.py | 7 + Open-ILS/web/oilsweb/oilsweb/tests/test_models.py | 0 Open-ILS/web/oilsweb/oilsweb/websetup.py | 14 ++ Open-ILS/web/oilsweb/setup.cfg | 59 ++++++++ Open-ILS/web/oilsweb/setup.py | 31 +++++ 58 files changed, 1855 insertions(+) create mode 100644 Open-ILS/web/oilsweb/MANIFEST.in create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/base.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/acq/index.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/acq/pl_builder.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/acq/search.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/base.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/footer.html.py create mode 100644 Open-ILS/web/oilsweb/data/templates/oils/default/navigate.html.py create mode 100644 Open-ILS/web/oilsweb/development.ini create mode 100644 Open-ILS/web/oilsweb/docs/index.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/PKG-INFO create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/SOURCES.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/dependency_links.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/entry_points.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/paste_deploy_config.ini_tmpl create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/paster_plugins.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/requires.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb.egg-info/top_level.txt create mode 100644 Open-ILS/web/oilsweb/oilsweb/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/config/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/config/environment.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/config/middleware.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/config/routing.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/controllers/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/controllers/acq.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/controllers/error.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/controllers/template.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/acq/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/app_globals.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/base.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/context.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/helpers.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/lib/util.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/model/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/index.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_logo.jpg create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_tiny_logo.jpg create mode 100644 Open-ILS/web/oilsweb/oilsweb/public/oils/media/xsl/acq-bibdata-marc.xslt create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/footer.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html create mode 100644 Open-ILS/web/oilsweb/oilsweb/tests/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/tests/functional/__init__.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/tests/functional/test_acq.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/tests/test_models.py create mode 100644 Open-ILS/web/oilsweb/oilsweb/websetup.py create mode 100644 Open-ILS/web/oilsweb/setup.cfg create mode 100644 Open-ILS/web/oilsweb/setup.py diff --git a/Open-ILS/web/oilsweb/MANIFEST.in b/Open-ILS/web/oilsweb/MANIFEST.in new file mode 100644 index 0000000000..98a73b81f5 --- /dev/null +++ b/Open-ILS/web/oilsweb/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include oilsweb/public * +recursive-include oilsweb/templates * diff --git a/Open-ILS/web/oilsweb/data/templates/oils/base.html.py b/Open-ILS/web/oilsweb/data/templates/oils/base.html.py new file mode 100644 index 0000000000..989606c31a --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/base.html.py @@ -0,0 +1,118 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198103797.7045071 +_template_filename=u'/home/erickson/code/sandbox/python/pylons/oilsweb/oilsweb/templates/oils/base.html' +_template_uri=u'oils/default/acq/../../base.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = ['block_body', 'block_css', 'block_body_content', 'block_head'] + + +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + self = context.get('self', UNDEFINED) + # SOURCE LINE 1 + context.write(u'\n\n\n\n') + # SOURCE LINE 5 + locale = 'en-US' + + __M_locals.update(dict([(__M_key, locals()[__M_key]) for __M_key in ['locale'] if __M_key in locals()])) + context.write(u" \n\n ") + # SOURCE LINE 7 + context.write(unicode(self.block_head())) + context.write(u'\n ') + # SOURCE LINE 8 + context.write(unicode(self.block_body())) + context.write(u'\n\n\n') + # SOURCE LINE 18 + context.write(u'\n\n') + # SOURCE LINE 22 + context.write(u'\n') + # SOURCE LINE 23 + context.write(u'\n\n') + # SOURCE LINE 28 + context.write(u'\n\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_body(context): + context.caller_stack.push_frame() + try: + self = context.get('self', UNDEFINED) + # SOURCE LINE 20 + context.write(u'\n') + # SOURCE LINE 21 + context.write(unicode(self.block_body_content())) + context.write(u'\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_css(context): + context.caller_stack.push_frame() + try: + c = context.get('c', UNDEFINED) + # SOURCE LINE 25 + context.write(u"\n \n \n") + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_body_content(context): + context.caller_stack.push_frame() + try: + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_head(context): + context.caller_stack.push_frame() + try: + self = context.get('self', UNDEFINED) + def block_title(): + context.caller_stack.push_frame() + try: + _ = context.get('_', UNDEFINED) + # SOURCE LINE 14 + context.write(unicode(_('Evergreen Acquisitions'))) + return '' + finally: + context.caller_stack.pop_frame() + # SOURCE LINE 11 + context.write(u' \n \n \n ') + # SOURCE LINE 14 + context.write(u'\n ') + # SOURCE LINE 15 + context.write(unicode(self.block_title())) + context.write(u'\n ') + # SOURCE LINE 16 + context.write(unicode(self.block_css())) + context.write(u'\n \n') + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/acq/index.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/index.html.py new file mode 100644 index 0000000000..45f49d3f1e --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/index.html.py @@ -0,0 +1,58 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198108481.9620631 +_template_filename='/home/erickson/code/sandbox/python/pylons/oilsweb/oilsweb/templates/oils/default/acq/index.html' +_template_uri='oils/default/acq/index.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = ['block_content', 'block_title'] + + +def _mako_get_namespace(context, name): + try: + return context.namespaces[(__name__, name)] + except KeyError: + _mako_generate_namespaces(context) + return context.namespaces[(__name__, name)] +def _mako_generate_namespaces(context): + pass +def _mako_inherit(template, context): + _mako_generate_namespaces(context) + return runtime._inherit_from(context, u'../base.html', _template_uri) +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + # SOURCE LINE 1 + context.write(u'\n\n') + # SOURCE LINE 3 + context.write(u'\n') + # SOURCE LINE 8 + context.write(u'\n\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_content(context): + context.caller_stack.push_frame() + try: + # SOURCE LINE 4 + context.write(u"\n
\n ACQ HOME\n
\n") + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_title(context): + context.caller_stack.push_frame() + try: + _ = context.get('_', UNDEFINED) + # SOURCE LINE 3 + context.write(unicode(_('Evergreen Acquisitions Home'))) + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/acq/pl_builder.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/pl_builder.html.py new file mode 100644 index 0000000000..7918c3fd6a --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/pl_builder.html.py @@ -0,0 +1,87 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198177152.534961 +_template_filename='/home/erickson/code/ILS/branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html' +_template_uri='oils/default/acq/pl_builder.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = ['block_content', 'block_title'] + + +def _mako_get_namespace(context, name): + try: + return context.namespaces[(__name__, name)] + except KeyError: + _mako_generate_namespaces(context) + return context.namespaces[(__name__, name)] +def _mako_generate_namespaces(context): + pass +def _mako_inherit(template, context): + _mako_generate_namespaces(context) + return runtime._inherit_from(context, u'../base.html', _template_uri) +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + # SOURCE LINE 1 + context.write(u'\n') + # SOURCE LINE 2 + context.write(u'\n') + # SOURCE LINE 21 + context.write(u'\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_content(context): + context.caller_stack.push_frame() + try: + c = context.get('c', UNDEFINED) + _ = context.get('_', UNDEFINED) + # SOURCE LINE 3 + context.write(u"\n \n \n \n \n \n') + # SOURCE LINE 9 + for res in c.oils_acq_records: + # SOURCE LINE 10 + for rec in res['records']: + # SOURCE LINE 11 + context.write(u" \n \n \n \n \n \n') + # SOURCE LINE 19 + context.write(u' \n
") + # SOURCE LINE 6 + context.write(unicode(_('Title'))) + context.write(u'') + context.write(unicode(_('Author'))) + context.write(u'') + context.write(unicode(_('Source'))) + context.write(u'
") + # SOURCE LINE 13 + context.write(unicode(rec['extracts']["bibdata.title"])) + context.write(u'') + # SOURCE LINE 14 + context.write(unicode(rec['extracts']["bibdata.author"])) + context.write(u'') + # SOURCE LINE 15 + context.write(unicode(res['service'])) + context.write(u'
\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_title(context): + context.caller_stack.push_frame() + try: + _ = context.get('_', UNDEFINED) + # SOURCE LINE 2 + context.write(unicode(_('Evergreen Acquisitions Results'))) + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/acq/search.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/search.html.py new file mode 100644 index 0000000000..1a04c857c6 --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/acq/search.html.py @@ -0,0 +1,109 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198184806.6389661 +_template_filename='/home/erickson/code/ILS/branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html' +_template_uri='oils/default/acq/search.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = ['block_content', 'block_title'] + + +def _mako_get_namespace(context, name): + try: + return context.namespaces[(__name__, name)] + except KeyError: + _mako_generate_namespaces(context) + return context.namespaces[(__name__, name)] +def _mako_generate_namespaces(context): + pass +def _mako_inherit(template, context): + _mako_generate_namespaces(context) + return runtime._inherit_from(context, u'../base.html', _template_uri) +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + # SOURCE LINE 1 + context.write(u'\n') + # SOURCE LINE 2 + context.write(u'\n\n') + # SOURCE LINE 35 + context.write(u'\n\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_content(context): + context.caller_stack.push_frame() + try: + c = context.get('c', UNDEFINED) + _ = context.get('_', UNDEFINED) + # SOURCE LINE 4 + context.write(u"\n
\n \n
\n
\n
") + # SOURCE LINE 9 + context.write(unicode(_('Search Sources'))) + context.write(u"
\n \n
\n
\n \n") + # SOURCE LINE 21 + for cls, lbl in c.oils_search_classes.iteritems(): + # SOURCE LINE 22 + context.write(u" \n \n \n \n") + # SOURCE LINE 30 + context.write(u"
") + # SOURCE LINE 23 + context.write(unicode(lbl)) + context.write(u"\n \n \n
\n \n
\n
\n
\n") + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_title(context): + context.caller_stack.push_frame() + try: + _ = context.get('_', UNDEFINED) + # SOURCE LINE 2 + context.write(unicode(_('Evergreen Acquisitions Search'))) + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/base.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/base.html.py new file mode 100644 index 0000000000..a6862a14ce --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/base.html.py @@ -0,0 +1,121 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198183376.8275831 +_template_filename=u'/home/erickson/code/ILS/branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html' +_template_uri=u'oils/default/acq/../base.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = ['block_footer', 'block_navigate', 'block_content', 'block_header', 'block_body_content', 'block_sidebar'] + + +def _mako_get_namespace(context, name): + try: + return context.namespaces[(__name__, name)] + except KeyError: + _mako_generate_namespaces(context) + return context.namespaces[(__name__, name)] +def _mako_generate_namespaces(context): + pass +def _mako_inherit(template, context): + _mako_generate_namespaces(context) + return runtime._inherit_from(context, u'../base.html', _template_uri) +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + # SOURCE LINE 1 + context.write(u'\n\n') + # SOURCE LINE 23 + context.write(u'\n\n') + # SOURCE LINE 25 + context.write(u'\n') + # SOURCE LINE 26 + context.write(u'\n') + # SOURCE LINE 27 + context.write(u'\n') + # SOURCE LINE 30 + context.write(u'\n') + # SOURCE LINE 33 + context.write(u'\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_footer(context): + context.caller_stack.push_frame() + try: + # SOURCE LINE 31 + context.write(u'\n ') + # SOURCE LINE 32 + runtime._include_file(context, u'footer.html', _template_uri) + context.write(u'\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_navigate(context): + context.caller_stack.push_frame() + try: + # SOURCE LINE 28 + context.write(u'\n ') + # SOURCE LINE 29 + runtime._include_file(context, u'navigate.html', _template_uri) + context.write(u'\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_content(context): + context.caller_stack.push_frame() + try: + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_header(context): + context.caller_stack.push_frame() + try: + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_body_content(context): + context.caller_stack.push_frame() + try: + self = context.get('self', UNDEFINED) + # SOURCE LINE 3 + context.write(u"\n
\n
\n ") + # SOURCE LINE 6 + context.write(unicode(self.block_header())) + context.write(u"\n
\n
\n
\n ") + # SOURCE LINE 10 + context.write(unicode(self.block_navigate())) + context.write(u"\n
\n
\n ") + # SOURCE LINE 13 + context.write(unicode(self.block_content())) + context.write(u"\n
\n
\n ") + # SOURCE LINE 16 + context.write(unicode(self.block_sidebar())) + context.write(u"\n
\n
\n \n
\n') + return '' + finally: + context.caller_stack.pop_frame() + + +def render_block_sidebar(context): + context.caller_stack.push_frame() + try: + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/footer.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/footer.html.py new file mode 100644 index 0000000000..f4760c734d --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/footer.html.py @@ -0,0 +1,27 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198182658.882432 +_template_filename=u'/home/erickson/code/ILS/branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/footer.html' +_template_uri=u'oils/default/acq/../footer.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = [] + + +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + c = context.get('c', UNDEFINED) + _ = context.get('_', UNDEFINED) + # SOURCE LINE 1 + context.write(unicode(_('Powered By'))) + context.write(u" \n\n") + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/data/templates/oils/default/navigate.html.py b/Open-ILS/web/oilsweb/data/templates/oils/default/navigate.html.py new file mode 100644 index 0000000000..2717b676f8 --- /dev/null +++ b/Open-ILS/web/oilsweb/data/templates/oils/default/navigate.html.py @@ -0,0 +1,34 @@ +from mako import runtime, filters, cache +UNDEFINED = runtime.UNDEFINED +_magic_number = 2 +_modified_time = 1198108479.9635 +_template_filename=u'/home/erickson/code/sandbox/python/pylons/oilsweb/oilsweb/templates/oils/default/navigate.html' +_template_uri=u'oils/default/acq/../navigate.html' +_template_cache=cache.Cache(__name__, _modified_time) +_source_encoding=None +_exports = [] + + +def render_body(context,**pageargs): + context.caller_stack.push_frame() + try: + __M_locals = dict(pageargs=pageargs) + c = context.get('c', UNDEFINED) + _ = context.get('_', UNDEFINED) + # SOURCE LINE 1 + context.write(u"\n \n \n \n \n
") + context.write(unicode(_('Home'))) + context.write(u"
") + context.write(unicode(_('Search'))) + context.write(u'
\n\n') + return '' + finally: + context.caller_stack.pop_frame() + + diff --git a/Open-ILS/web/oilsweb/development.ini b/Open-ILS/web/oilsweb/development.ini new file mode 100644 index 0000000000..b200829d86 --- /dev/null +++ b/Open-ILS/web/oilsweb/development.ini @@ -0,0 +1,76 @@ +# +# oilsweb - Pylons development environment configuration +# +# The %(here)s variable will be replaced with the parent directory of this file +# +[DEFAULT] +debug = true +# Uncomment and replace with the address which should receive any error reports +#email_to = you@yourdomain.com +smtp_server = localhost +error_email_from = paste@localhost + +[server:main] +use = egg:Paste#http +#host = 0.0.0.0 +host = 216.154.195.227 +port = 5000 + +[app:main] +use = egg:oilsweb +full_stack = true +cache_dir = %(here)s/data +beaker.session.key = oilsweb +beaker.session.secret = somesecret + +osrf_config = /openils/conf/opensrf_core.xml +osrf_config_ctxt = config.opensrf +oils_prefix = /oils +oils_media_prefix = /oils/media +oils_added_content_prefix = http://dev.gapines.org/opac/extras/ac +oils_username = admin +oils_password = open-ils +oils_xsl_prefix = oilsweb/public/oils/media/xsl +oils_xsl_acq_bib = acq-bibdata-marc.xslt + + +# If you'd like to fine-tune the individual locations of the cache data dirs +# for the Cache data, or the Session saves, un-comment the desired settings +# here: +#beaker.cache.data_dir = %(here)s/data/cache +#beaker.session.data_dir = %(here)s/data/sessions + +# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* +# Debug mode will enable the interactive debugging tool, allowing ANYONE to +# execute malicious code after an exception is raised. +#set debug = false + + +# Logging configuration +[loggers] +keys = root, oilsweb + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[logger_oilsweb] +level = DEBUG +handlers = +qualname = oilsweb + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %H:%M:%S diff --git a/Open-ILS/web/oilsweb/docs/index.txt b/Open-ILS/web/oilsweb/docs/index.txt new file mode 100644 index 0000000000..00a69cc5d8 --- /dev/null +++ b/Open-ILS/web/oilsweb/docs/index.txt @@ -0,0 +1,12 @@ +oilsweb ++++++++ + +This is the main index page of your documentation. It should be written in +`reStructuredText format `_. + +You can generate your documentation in HTML format by running this command:: + + setup.py pudge + +For this to work you will need to download and install ``buildutils`` and +``pudge``. diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/PKG-INFO b/Open-ILS/web/oilsweb/oilsweb.egg-info/PKG-INFO new file mode 100644 index 0000000000..25517848bb --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: oilsweb +Version: 0.0.0dev +Summary: UNKNOWN +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/SOURCES.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/SOURCES.txt new file mode 100644 index 0000000000..6d9b748ca6 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/SOURCES.txt @@ -0,0 +1,29 @@ +MANIFEST.in +README.txt +setup.cfg +setup.py +oilsweb/__init__.py +oilsweb/websetup.py +oilsweb.egg-info/PKG-INFO +oilsweb.egg-info/SOURCES.txt +oilsweb.egg-info/dependency_links.txt +oilsweb.egg-info/entry_points.txt +oilsweb.egg-info/paste_deploy_config.ini_tmpl +oilsweb.egg-info/requires.txt +oilsweb.egg-info/top_level.txt +oilsweb/config/__init__.py +oilsweb/config/environment.py +oilsweb/config/middleware.py +oilsweb/config/routing.py +oilsweb/controllers/__init__.py +oilsweb/controllers/error.py +oilsweb/controllers/template.py +oilsweb/lib/__init__.py +oilsweb/lib/app_globals.py +oilsweb/lib/base.py +oilsweb/lib/helpers.py +oilsweb/model/__init__.py +oilsweb/public/index.html +oilsweb/tests/__init__.py +oilsweb/tests/test_models.py +oilsweb/tests/functional/__init__.py diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/dependency_links.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/dependency_links.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/entry_points.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/entry_points.txt new file mode 100644 index 0000000000..dd90926b48 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/entry_points.txt @@ -0,0 +1,7 @@ + + [paste.app_factory] + main = oilsweb.config.middleware:make_app + + [paste.app_install] + main = pylons.util:PylonsInstaller + \ No newline at end of file diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/paste_deploy_config.ini_tmpl b/Open-ILS/web/oilsweb/oilsweb.egg-info/paste_deploy_config.ini_tmpl new file mode 100644 index 0000000000..8db796cd3f --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/paste_deploy_config.ini_tmpl @@ -0,0 +1,58 @@ +# +# oilsweb - Pylons configuration +# +# The %(here)s variable will be replaced with the parent directory of this file +# +[DEFAULT] +debug = true +email_to = you@yourdomain.com +smtp_server = localhost +error_email_from = paste@localhost + +[server:main] +use = egg:Paste#http +host = 0.0.0.0 +port = 5000 + +[app:main] +use = egg:oilsweb +full_stack = true +cache_dir = %(here)s/data +beaker.session.key = oilsweb +beaker.session.secret = ${app_instance_secret} +app_instance_uuid = ${app_instance_uuid} + +# If you'd like to fine-tune the individual locations of the cache data dirs +# for the Cache data, or the Session saves, un-comment the desired settings +# here: +#beaker.cache.data_dir = %(here)s/data/cache +#beaker.session.data_dir = %(here)s/data/sessions + +# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* +# Debug mode will enable the interactive debugging tool, allowing ANYONE to +# execute malicious code after an exception is raised. +set debug = false + + +# Logging configuration +[loggers] +keys = root + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/paster_plugins.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/paster_plugins.txt new file mode 100644 index 0000000000..b3ee8d7458 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/paster_plugins.txt @@ -0,0 +1,3 @@ +Pylons +WebHelpers +PasteScript diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/requires.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/requires.txt new file mode 100644 index 0000000000..a7c9299b90 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/requires.txt @@ -0,0 +1 @@ +Pylons>=0.9.6.1 \ No newline at end of file diff --git a/Open-ILS/web/oilsweb/oilsweb.egg-info/top_level.txt b/Open-ILS/web/oilsweb/oilsweb.egg-info/top_level.txt new file mode 100644 index 0000000000..94a1c0c50a --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb.egg-info/top_level.txt @@ -0,0 +1 @@ +oilsweb diff --git a/Open-ILS/web/oilsweb/oilsweb/__init__.py b/Open-ILS/web/oilsweb/oilsweb/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/config/__init__.py b/Open-ILS/web/oilsweb/oilsweb/config/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/config/environment.py b/Open-ILS/web/oilsweb/oilsweb/config/environment.py new file mode 100644 index 0000000000..848c55e004 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/config/environment.py @@ -0,0 +1,33 @@ +"""Pylons environment configuration""" +import os + +from pylons import config + +import oilsweb.lib.app_globals as app_globals +import oilsweb.lib.helpers +from oilsweb.config.routing import make_map + +def load_environment(global_conf, app_conf): + """Configure the Pylons environment via the ``pylons.config`` + object + """ + # Pylons paths + root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + paths = dict(root=root, + controllers=os.path.join(root, 'controllers'), + static_files=os.path.join(root, 'public'), + templates=[os.path.join(root, 'templates')]) + + # Initialize config with the basic options + config.init_app(global_conf, app_conf, package='oilsweb', + template_engine='mako', paths=paths) + + config['routes.map'] = make_map() + config['pylons.g'] = app_globals.Globals() + config['pylons.h'] = oilsweb.lib.helpers + + # Customize templating options via this variable + tmpl_options = config['buffet.template_options'] + + # CONFIGURATION OPTIONS HERE (note: all config options will override + # any Pylons config options) diff --git a/Open-ILS/web/oilsweb/oilsweb/config/middleware.py b/Open-ILS/web/oilsweb/oilsweb/config/middleware.py new file mode 100644 index 0000000000..fa98dec9f4 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/config/middleware.py @@ -0,0 +1,57 @@ +"""Pylons middleware initialization""" +from paste.cascade import Cascade +from paste.registry import RegistryManager +from paste.urlparser import StaticURLParser +from paste.deploy.converters import asbool + +from pylons import config +from pylons.error import error_template +from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \ + StaticJavascripts +from pylons.wsgiapp import PylonsApp + +from oilsweb.config.environment import load_environment + +def make_app(global_conf, full_stack=True, **app_conf): + """Create a Pylons WSGI application and return it + + ``global_conf`` + The inherited configuration for this application. Normally from + the [DEFAULT] section of the Paste ini file. + + ``full_stack`` + Whether or not this application provides a full WSGI stack (by + default, meaning it handles its own exceptions and errors). + Disable full_stack when this application is "managed" by + another WSGI middleware. + + ``app_conf`` + The application's local configuration. Normally specified in the + [app:] section of the Paste ini file (where + defaults to main). + """ + # Configure the Pylons environment + load_environment(global_conf, app_conf) + + # The Pylons WSGI app + app = PylonsApp() + + # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) + + if asbool(full_stack): + # Handle Python exceptions + app = ErrorHandler(app, global_conf, error_template=error_template, + **config['pylons.errorware']) + + # Display error documents for 401, 403, 404 status codes (and + # 500 when debug is disabled) + app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf) + + # Establish the Registry for this application + app = RegistryManager(app) + + # Static files + javascripts_app = StaticJavascripts() + static_app = StaticURLParser(config['pylons.paths']['static_files']) + app = Cascade([static_app, javascripts_app, app]) + return app diff --git a/Open-ILS/web/oilsweb/oilsweb/config/routing.py b/Open-ILS/web/oilsweb/oilsweb/config/routing.py new file mode 100644 index 0000000000..bc78800486 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/config/routing.py @@ -0,0 +1,25 @@ +"""Routes configuration + +The more specific and detailed routes should be defined first so they +may take precedent over the more generic routes. For more information +refer to the routes manual at http://routes.groovie.org/docs/ +""" +from pylons import config +from routes import Mapper + +def make_map(): + """Create, configure and return the routes Mapper""" + map = Mapper(directory=config['pylons.paths']['controllers'], + always_scan=config['debug']) + + # The ErrorController route (handles 404/500 error pages); it should + # likely stay at the top, ensuring it can always be resolved + map.connect('error/:action/:id', controller='error') + + # CUSTOM ROUTES HERE + + map.connect('oils/:controller/:action') + #map.connect(':controller/:action/:id') + map.connect('*url', controller='template', action='view') + + return map diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/__init__.py b/Open-ILS/web/oilsweb/oilsweb/controllers/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py new file mode 100644 index 0000000000..8affc7a0d0 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py @@ -0,0 +1,76 @@ +import logging + +from oilsweb.lib.base import * +import pylons, os +import oilsweb.lib.context +import oilsweb.lib.util +import oilsweb.lib.acq.search +from oilsweb.lib.context import Context, SubContext, ContextItem + +log = logging.getLogger(__name__) + +class AcqContext(SubContext): + ''' Define the CGI params for this application ''' + def __init__(self): + self.query = ContextItem(cgi_name='acq.q') + self.search_class = ContextItem(cgi_name='acq.sc', multi=True) + self.search_source = ContextItem(cgi_name='acq.ss', multi=True) + self.picked_records = ContextItem(cgi_name='acq.sr', multi=True) + +Context.applySubContext('acq', AcqContext) + + +class AcqController(BaseController): + + def index(self): + c.oils = oilsweb.lib.context.Context.init(request) + return render('oils/%s/acq/index.html' % c.oils.core.skin) + + def search(self): + c.oils = Context.init(request) + c.oils_z39_sources = oilsweb.lib.acq.search.fetch_z39_sources(c.oils) + + sc = {} + for data in c.oils_z39_sources.values(): + for key, val in data['attrs'].iteritems(): + sc[key] = val.get('label') or key + c.oils_search_classes = sc + + return render('oils/%s/acq/search.html' % c.oils.core.skin) + + + def pl_builder(self): + c.oils = oilsweb.lib.context.Context.init(request) + # add logic to see where we are fetching bib data from + + if c.oils.acq.search_source: + c.oils_acq_records = self._build_z39_search(c.oils) + + return render('oils/%s/acq/pl_builder.html' % c.oils.core.skin) + + + + def _build_z39_search(self, ctx): + + search = { + 'service' : [], + 'username' : [], + 'password' : [], + 'search' : {} + } + + # collect the sources and credentials + for src in c.oils.acq.search_source: + search['service'].append(src) + search['username'].append("") # XXX + search['password'].append("") # XXX + + # collect the search classes + for cls in c.oils.acq.search_class: + if request.params[cls]: + search['search'][cls] = request.params[cls] + + return oilsweb.lib.acq.search.multi_search(ctx, search) + + + diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/error.py b/Open-ILS/web/oilsweb/oilsweb/controllers/error.py new file mode 100644 index 0000000000..766c0447ba --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/error.py @@ -0,0 +1,39 @@ +import os.path + +import paste.fileapp +from pylons.middleware import error_document_template, media_path + +from oilsweb.lib.base import * + +class ErrorController(BaseController): + """Generates error documents as and when they are required. + + The ErrorDocuments middleware forwards to ErrorController when error + related status codes are returned from the application. + + This behaviour can be altered by changing the parameters to the + ErrorDocuments middleware in your config/middleware.py file. + """ + + def document(self): + """Render the error document""" + page = error_document_template % \ + dict(prefix=request.environ.get('SCRIPT_NAME', ''), + code=request.params.get('code', ''), + message=request.params.get('message', '')) + return page + + def img(self, id): + """Serve Pylons' stock images""" + return self._serve_file(os.path.join(media_path, 'img', id)) + + def style(self, id): + """Serve Pylons' stock stylesheets""" + return self._serve_file(os.path.join(media_path, 'style', id)) + + def _serve_file(self, path): + """Call Paste's FileApp (a WSGI application) to serve the file + at the specified path + """ + fapp = paste.fileapp.FileApp(path) + return fapp(request.environ, self.start_response) diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/template.py b/Open-ILS/web/oilsweb/oilsweb/controllers/template.py new file mode 100644 index 0000000000..fbcbb3f66f --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/template.py @@ -0,0 +1,27 @@ +from oilsweb.lib.base import * + +class TemplateController(BaseController): + + def view(self, url): + """By default, the final controller tried to fulfill the request + when no other routes match. It may be used to display a template + when all else fails, e.g.:: + + def view(self, url): + return render('/%s' % url) + + Or if you're using Mako and want to explicitly send a 404 (Not + Found) response code when the requested template doesn't exist:: + + import mako.exceptions + + def view(self, url): + try: + return render('/%s' % url) + except mako.exceptions.TopLevelLookupException: + abort(404) + + By default this controller aborts the request with a 404 (Not + Found) + """ + abort(404) diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py b/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/__init__.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py new file mode 100644 index 0000000000..a21225b1e4 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py @@ -0,0 +1,44 @@ +import os +import oilsweb.lib.context +import osrf.ses +import osrf.xml_obj +import oils.const +import osrf.log + +EG_Z39_SEARCH = 'open-ils.search.z3950.search_class' +_z_sources = None + +def fetch_z39_sources(ctx): + global _z_sources + if _z_sources: + return _z_sources + _z_sources = osrf.ses.AtomicRequest( + 'open-ils.search', + 'open-ils.search.z3950.retrieve_services', ctx.core.authtoken) + return _z_sources + +def flatten_record(marcxml): + import pylons + xslFile = os.path.join(os.getcwd(), pylons.config['oils_xsl_prefix'], pylons.config['oils_xsl_acq_bib']) + xformed = oilsweb.lib.util.apply_xsl(marcxml, xslFile) + return osrf.xml_obj.XMLFlattener(xformed).parse() + +def multi_search(ctx, search): + ses = osrf.ses.ClientSession(oils.const.OILS_APP_SEARCH) + req = ses.request(EG_Z39_SEARCH, ctx.core.authtoken, search) + osrf.log.log_debug("sending " + unicode(search)) + + results = [] + while not req.complete: + resp = req.recv(60) + if not resp: + break + res = resp.content() + for rec in res['records']: + rec['extracts'] = flatten_record(rec['marcxml']) + results.append(res) + + osrf.log.log_debug("got " + unicode(results)) + return results + + diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/app_globals.py b/Open-ILS/web/oilsweb/oilsweb/lib/app_globals.py new file mode 100644 index 0000000000..77ad4eddd9 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/app_globals.py @@ -0,0 +1,14 @@ +"""The application's Globals object""" +from pylons import config +import oilsweb.lib.util + +class Globals(object): + """Globals acts as a container for objects available throughout the + life of the application + """ + + def __init__(self): + #oilsweb.lib.util.childInit() + self.oils_authtoken = None + + diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/base.py b/Open-ILS/web/oilsweb/oilsweb/lib/base.py new file mode 100644 index 0000000000..4381f60bda --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/base.py @@ -0,0 +1,27 @@ +"""The base Controller API + +Provides the BaseController class for subclassing, and other objects +utilized by Controllers. +""" +from pylons import c, cache, config, g, request, response, session +from pylons.controllers import WSGIController +from pylons.controllers.util import abort, etag_cache, redirect_to +from pylons.decorators import jsonify, validate +from pylons.i18n import _, ungettext, N_ +from pylons.templating import render + +import oilsweb.lib.helpers as h +import oilsweb.model as model + +class BaseController(WSGIController): + + def __call__(self, environ, start_response): + """Invoke the Controller""" + # WSGIController.__call__ dispatches to the Controller method + # the request is routed to. This routing information is + # available in environ['pylons.routes_dict'] + return WSGIController.__call__(self, environ, start_response) + +# Include the '_' function in the public names +__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \ + or __name == '_'] diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/context.py b/Open-ILS/web/oilsweb/oilsweb/lib/context.py new file mode 100644 index 0000000000..30c33fc63e --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/context.py @@ -0,0 +1,99 @@ +from oilsweb.lib.util import childInit +import pylons.config +import cgi + +_context = None +_subContexts = {} + +class ContextItem(object): + def __init__(self, **kwargs): + self.app = None + self.name = kwargs.get('name') + self.cgi_name = kwargs.get('cgi_name') + self.default_value = kwargs.get('default_value') + self.qname = None + self.multi = kwargs.get('multi') + +class Context(object): + def __init__(self): + self._fields = [] + + def wrap(self): + return {'oils': self} + + def applySubContext(self, app, subContext): + setattr(self, app, subContext) + + def make_query_string(self): + q = '' + for f in self._fields: + if f.cgi_name: + val = getattr(getattr(self, f.app), f.name) + if val != f.default_value: + if isinstance(val, list): + for v in val: + q += f.cgi_name+'='+cgi.escape(v)+'&' + else: + q += f.cgi_name+'='+cgi.escape(val)+'&' + if len(q) > 0: q = q[:-1] # strip the trailing & + return q + + @staticmethod + def applySubContext(app, ctx): + global _subContexts + _subContexts[app] = ctx + + @staticmethod + def getContext(): + global _context + return _context + + @staticmethod + def init(req): + global _context, _subContexts + c = _context = Context() + childInit() + + for app, ctx in _subContexts.iteritems(): + ctx = ctx() + setattr(c, app, ctx) + for name in ctx._fields(): + item = getattr(ctx, name) + item.app = app + item.name = name + c._fields.append(item) + if item.cgi_name and item.cgi_name in req.params: + if item.multi: + setattr(getattr(c, app), name, req.params.getall(item.cgi_name)) + else: + setattr(getattr(c, app), name, req.params[item.cgi_name]) + else: + setattr(getattr(c, app), name, item.default_value) + + # store the metatdata at _ + setattr(getattr(c, app), "%s_" % name, item) + + c.core.prefix = pylons.config['oils_prefix'] + c.core.media_prefix = pylons.config['oils_media_prefix'] + c.core.ac_prefix = pylons.config['oils_added_content_prefix'] + + c.core.skin = 'default' # XXX + c.core.theme = 'default' # XXX + + return c + + +class SubContext(object): + def _fields(self): + return [ f for f in dir(self) if f[0:1] != '_' ] + +class CoreContext(SubContext): + def __init__(self): + self.prefix = ContextItem() + self.media_prefix = ContextItem() + self.ac_prefix = ContextItem() + self.skin = ContextItem() + self.theme = ContextItem() + self.authtoken = ContextItem(cgi_name='ses') +Context.applySubContext('core', CoreContext) + diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/helpers.py b/Open-ILS/web/oilsweb/oilsweb/lib/helpers.py new file mode 100644 index 0000000000..0eb7c8fcca --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/helpers.py @@ -0,0 +1,6 @@ +"""Helper functions + +Consists of functions to typically be used within templates, but also +available to Controllers. This module is available to both as 'h'. +""" +from webhelpers import * diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/util.py b/Open-ILS/web/oilsweb/oilsweb/lib/util.py new file mode 100644 index 0000000000..a9aa4d5bcf --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/lib/util.py @@ -0,0 +1,43 @@ +import pylons.config +import libxml2, libxslt +import oils.utils.utils + +WEB_ROOT='oils' + + +def makeTemplatePath(ctx, tail): + return '%s/%s/%s' % (WEB_ROOT, ctx.core.skin, tail) + +def childInit(): + ''' Global child-init handler. + + 1. Connects to the OpenSRF network. Note that the OpenSRF + layer ensures that there is only one connection per thread. + 2. Parses the IDL file ''' + import osrf.system, osrf.set, oils.utils.idl, oils.utils.csedit, osrf.cache + osrf.system.connect(pylons.config['osrf_config'], pylons.config['osrf_config_ctxt']) + oils.utils.idl.oilsParseIDL() + oils.utils.csedit.oilsLoadCSEditor() + + # live in opensrf somewhere + servers = osrf.set.get('cache.global.servers.server') + if not isinstance(servers, list): + servers = [servers] + osrf.cache.CacheClient.connect(servers) + + + +_parsedSheets = {} +def apply_xsl(xmlStr, xslFile, xslParams={}): + doc = libxml2.parseDoc(xmlStr) + stylesheet = _parsedSheets.get(xslFile) + + if not stylesheet: + styledoc = _parsedSheets.get(xslFile) or libxml2.parseFile(xslFile) + stylesheet = libxslt.parseStylesheetDoc(styledoc) + _parsedSheets[xslFile] = stylesheet + + result = stylesheet.applyStylesheet(doc, xslParams) + return stylesheet.saveResultToString(result) + + diff --git a/Open-ILS/web/oilsweb/oilsweb/model/__init__.py b/Open-ILS/web/oilsweb/oilsweb/model/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/public/index.html b/Open-ILS/web/oilsweb/oilsweb/public/index.html new file mode 100644 index 0000000000..defce375d3 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/index.html @@ -0,0 +1,108 @@ + + + + Pylons Default Page + + + + +

Welcome to your Pylons Web Application

+ +

Weren't expecting to see this page?

+ +

The oilsweb/public/ directory is searched for static files + before your controllers are run. Remove this file (oilsweb/public/index.html) + and edit the routes in oilsweb/config/routing.py to point the + root path to a 'hello' controller we'll create below: +

 map.connect('', controller='hello', action='index')
+

+ +

Getting Started

+

You're now ready to start creating your own web application. To create a 'hello' controller, + run the following command in your project's root directory: +

+oilsweb$ paster controller hello
+
+ + This generates the following the following code in oilsweb/controllers/hello.py: +
+import logging
+
+from oilsweb.lib.base import *
+
+log = logging.getLogger(__name__)
+
+class HelloController(BaseController):
+
+    def index(self):
+        # Return a rendered template
+        #   return render('/some/template.mako)
+        # or, Return a response
+        return 'Hello World'
+
+

+

This controller simply prints out 'Hello World' to the browser. Pylons' default routes + automatically set up this controller to respond at the /hello URL. + With the additional route described above, this controller will also respond at the + root path. +

+ +

Using a template

+

To call a template and do something a little more complex, this following example + shows how to print out some request information from a + Mako template. +

+

Create a serverinfo.mako file in your project's oilsweb/templates/ + directory with the following contents: +

+
+<h2>
+Server info for ${request.host}
+</h2>
+
+<p>
+The URL you called: ${h.url_for()}
+</p>
+
+<p>
+The name you set: ${c.name}
+</p>
+
+<p>The WSGI environ:<br />
+<pre>${c.pretty_environ}</pre>
+</p>
+
+ +Then add the following to your 'hello' controller class: +
+    def serverinfo(self):
+        import cgi
+        import pprint
+        c.pretty_environ = cgi.escape(pprint.pformat(request.environ))
+        c.name = 'The Black Knight'
+        return render('/serverinfo.mako')
+
+ +You can now view the page at: /hello/serverinfo +

+ + diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css new file mode 100644 index 0000000000..579e9a40af --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css @@ -0,0 +1,13 @@ + +#oils-acq-index-block { font-weight:bold; } +#oils-acq-search-container { width:100%; } +#oils-acq-search-sources-block { width:29%; vertical-align: top; float: left; } +#oils-acq-search-form-block { width:70%; vertical-align: top; float:right; } +#oils-acq-search-sources-selector { padding: 2px; } +#oils-acq-search-sources-selector option { margin-bottom: 2px; } +.oils-acq-search-form-row { width: 100%; } +.oils-acq-search-form-label {} +.oils-acq-search-form-input {} + +#oils-acq-pl_builder-table td { padding: 3px; } + diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css new file mode 100644 index 0000000000..a27bf42b5a --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css @@ -0,0 +1,23 @@ +/* import the default css for the install applications */ +@import "acq_default.css"; + +/* base default style */ + +/** Generic style ------------------------------ **/ +/* use this for divs whose contents should be entirely contained within the div */ +.container:after {content: ""; display: block; height: 0; clear: both; } +table { border-collapse: collapse; } + +#oils-base-body-block { width: 100%; } +#oils-base-main-block { width: 100%; } +#oils-base-navigate-block { width: 15%; vertical-align: top; float:left;} +#oils-base-content-block { width: 84%; vertical-align: top; float:right;} +#oils-base-sidebar-block { width: 15%; vertical-align: top; float:left;} + +#oils-base-header-block { width: 100%; text-align: center; vertical-align: bottom;} +#oils-base-footer-block { width: 100%; text-align: center; vertical-align: bottom;} + + + + + diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css new file mode 100644 index 0000000000..02a2dc1587 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css @@ -0,0 +1,10 @@ + +#oils-acq-index-div { font-weight:bold; } +#oils-acq-search-container { width:100%; } +#oils-acq-search-sources-div { width:20%; float:left; } +#oils-acq-search-form-div { width:80%; float:right; } +#oils-acq-search-z39-sources-table thead td { font-weight: bold; } +#oils-acq-search-z39-sources-table tbody td { width: 33%; } +#oils-acq-search-sources-label { font-weight: bold; } +#oils-acq-pl_builder-table thead td { font-weight: bold; } +#oils-acq-pl_builder-table td { border-bottom: 1px solid green;} diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css new file mode 100644 index 0000000000..60eee7406e --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css @@ -0,0 +1,15 @@ +/* import the default css for the install applications */ +@import "acq_default.css"; + +body { font-size: 85%; } + +/* base default style */ +#oils-base-body-block {} +#oils-base-navigate-block {border: 1px solid green;} +#oils-base-content-block {} +#oils-base-sidebar-block {border: 1px solid red;} +#oils-base-footer-block {padding: 3px; margin-top: 20px; border: 1px solid green;} + + + + diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_logo.jpg b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..633b7a75f907159c7f6b19b714aa54e8599ab66b GIT binary patch literal 8571 zcmbVx2UHZxy7i2N0m+iHBngt4AqSBRl0h;^QidT9IZ8&NfPj)gGDBvF5>*ByXUQ1^ z0m(^$H=c9PdH4Qn-S@xys#kS=-BtZn?XKFpx~gx#-Yx@(RTWhf0YD%SkcvJ4w<}oQ z3f|D?0D!tWfC~Ts-~d3tdjJfy1w=N4^9zgfi;4>h+((}wg5nSe0DzGT{IlNMTL2*U&R_m9!g4YGvH@Xe{{R3s5aS;$ z#QtX#K)U}%0c8DW6nB7sc>r?X`P(z5{2$%`0A+OgyXAkRxBvVmf8R&v+|B{y065s# zAZ#og5D0{ei*pyBi~t`G51;xTDG?bx4I=|R4ISNmR$lh|%-k$=bQ~g_-24JyFqn~D zOiENxl2-^U_}d8(7Z(>F51)#FfJ%^wj!E!84!4~E5*z?NKnDZJ47fuA#2^9QegZI} z+lhtl_upOrj{v-bfr*6;!oj_Zhc1952HXK+VBEpPz{0{rcN{PPoe#hy!MevJAd5|^ zZ3$v_B@+xz%)?=MT+>CaGkU-(WaSoudzXTeikgP)0XqjL7Z@TeA}S^>C$FHWq^zQ< ztEd0ez|hFp+Q#|%iG5{G%P$KGU`=yQu3RW)U>zn((~UJ6c!bil$O=j z)gv1ko0?m?KYse$gX-=3GB!RjIW_%tW_D$DZGB^N>)ZCu;nDHQ>Dl?k<<)Oo=n?TJ ztiO@{Ke$NHxb9$LVqk)P;{x9CLPrb|Oe`h=?0d4>AWK(LX2D<_vd4*eHC?zYLOKWJ zR&JwrDOkZPY=^(0{ekR%2Q1|OgzRr%|BY)FfR6!0cOC`_Kn8Gb2*HD;c)lv&dYRPo z0FYp%BonTjrqw&jrA+lDLLPOFO3PM1=hUk13v1z1+*KkHCvh_E`1v3#;4No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y0OBm}F;&)~Yo{u)Pnz=kHEq*EZ t2xWtjycqFxpzLCOaJ~gv6=-2C9u?*MZ~q7V>(2LovP=FiWkI(y{{^)7Un~Fs literal 0 HcmV?d00001 diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_tiny_logo.jpg b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/images/eg_tiny_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a570a371707ef486c7f7a4f66f24e6dfd9c12674 GIT binary patch literal 1722 zcmbW0c~DbF9LIO_j=YdWcsU@(kdOm{6qFo*Fgg|xNT^VW2eno$s8kfepcGrREg+>x ztxCBpQwJ3kbu2|eg#nc+a*TDvQbe3u0d3W45o7Uar|BjfqJL@k&A#97y|??@{p|Pq ztlicdz$r4^7!DwWpa@;S+KZhI+mM(5KvWd)0sv5e33&iR8AKO=VnEn)0OH}Kv3wQu z92vtvV>AHWfh+2%P;1WxDBqEj2=I})2fh znkaVnP^lqJUABBh!Uro8SFKy0_F?*lk3P=Y zlKpwk7r9&Wzb+^&DlXae&E9?G75fiV9z1mPSWWHm6DRBHe>i)t`Fu-jTl?joI)CoE z(tWk3x3B-^t>1pXedq4rL(8MTh8{n8`pm|K95IYFM)ndHjkp*%j^Ruj7i6TPj?p+F z*O0v67-pQAuh3>tf{>kis+(9!o#}xvKDEQaS*7oFAGD#_$zBaC^M8?zfj#Hy0UQh> z@h}?91Valwid&anpZUw&$J+uEirIf(xqJHDX3xD@I_p)t?FbAlp;8O-h4sWS$ayoX;H>MeAiU0-85ncG+sGOzK3F*fvB z+^p1^(tXM0o!)26-1Ei4XzrawE8Z_SoU*^U+vV3MQuB9Y`ozwLx~ckhQ&m{^qkL2T z+pA;njO&LbizD(IOK}g+lJZku`AqN64H5RQHC29cDNoo{y3rV{^Cu1OGZ(f&XRSU<8>!CQeD%cE;SblBMbhyJ~aXwdK?1Td)2HIIIDb literal 0 HcmV?d00001 diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/xsl/acq-bibdata-marc.xslt b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/xsl/acq-bibdata-marc.xslt new file mode 100644 index 0000000000..3d34a426b6 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/xsl/acq-bibdata-marc.xslt @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcmnopr</xsl:with-param> + </xsl:call-template> + + + + + +
+
+
+
+ + + + +
+ + + + + + ad + + + + + + + + + b + + + + + + + + + c + + + + + + + + + a + + + + + + + + + a + + + + + + + + + c + + + + + + + + + + + a + + + + + + + + + + + + + a + + + + + + + + + + + c + + + + +
+
+ + + + + + + + + + + + + + +
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html new file mode 100644 index 0000000000..544c8e8086 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html @@ -0,0 +1,29 @@ + + + + +<% locale = 'en-US' %> + + ${self.block_head()} + ${self.block_body()} + + +<%def name='block_head()'> + + + <%def name="block_title()">${_('Evergreen Acquisitions')} + ${self.block_title()} + ${self.block_css()} + + + +<%def name='block_body()'> +${self.block_body_content()} + +<%def name='block_body_content()'/> + +<%def name='block_css()'> + + + + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html new file mode 100644 index 0000000000..9a9a383f3f --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html @@ -0,0 +1,9 @@ +<%inherit file='../base.html'/> + +<%def name="block_title()">${_('Evergreen Acquisitions Home')} +<%def name="block_content()"> +
+ ACQ HOME +
+ + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html new file mode 100644 index 0000000000..2d0eaaf9db --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html @@ -0,0 +1,21 @@ +<%inherit file='../base.html'/> +<%def name="block_title()">${_('Evergreen Acquisitions Results')} +<%def name="block_content()"> + + + + + + % for res in c.oils_acq_records: + % for rec in res['records']: + + + + + + + % endfor + % endfor + +
${_('Title')}${_('Author')}${_('Source')}
${rec['extracts'].get("bibdata.title")}${rec['extracts'].get("bibdata.author")}${res['service']}
+ diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html new file mode 100644 index 0000000000..67a6270763 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html @@ -0,0 +1,36 @@ +<%inherit file='../base.html'/> +<%def name="block_title()">${_('Evergreen Acquisitions Search')} + +<%def name="block_content()"> +
+ +
+
+
${_('Search Sources')}
+ +
+
+ + % for cls, lbl in c.oils_search_classes.iteritems(): + + + + + % endfor +
${lbl} + + +
+ +
+
+
+ + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html new file mode 100644 index 0000000000..f0368de64c --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html @@ -0,0 +1,33 @@ +<%inherit file='../base.html'/> + +<%def name='block_body_content()'> +
+
+ ${self.block_header()} +
+
+
+ ${self.block_navigate()} +
+
+ ${self.block_content()} +
+
+ ${self.block_sidebar()} +
+
+ +
+ + +<%def name='block_header()'/> +<%def name='block_sidebar()'/> +<%def name='block_content()'/> +<%def name='block_navigate()'> + <%include file='navigate.html'/> + +<%def name='block_footer()'> + <%include file='footer.html'/> + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/footer.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/footer.html new file mode 100644 index 0000000000..e5527afadd --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/footer.html @@ -0,0 +1,2 @@ +${_('Powered By')} + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html new file mode 100644 index 0000000000..44f5463cee --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html @@ -0,0 +1,7 @@ + + + + + +
${_('Home')}
${_('Search')}
+ diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/__init__.py b/Open-ILS/web/oilsweb/oilsweb/tests/__init__.py new file mode 100644 index 0000000000..91ff2e7099 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/tests/__init__.py @@ -0,0 +1,40 @@ +"""Pylons application test package + +When the test runner finds and executes tests within this directory, +this file will be loaded to setup the test environment. + +It registers the root directory of the project in sys.path and +pkg_resources, in case the project hasn't been installed with +setuptools. It also initializes the application via websetup (paster +setup-app) with the project's test.ini configuration file. +""" +import os +import sys +from unittest import TestCase + +import pkg_resources +import paste.fixture +import paste.script.appinstall +from paste.deploy import loadapp +from routes import url_for + +__all__ = ['url_for', 'TestController'] + +here_dir = os.path.dirname(os.path.abspath(__file__)) +conf_dir = os.path.dirname(os.path.dirname(here_dir)) + +sys.path.insert(0, conf_dir) +pkg_resources.working_set.add_entry(conf_dir) +pkg_resources.require('Paste') +pkg_resources.require('PasteScript') + +test_file = os.path.join(conf_dir, 'test.ini') +cmd = paste.script.appinstall.SetupCommand('setup-app') +cmd.run([test_file]) + +class TestController(TestCase): + + def __init__(self, *args, **kwargs): + wsgiapp = loadapp('config:test.ini', relative_to=conf_dir) + self.app = paste.fixture.TestApp(wsgiapp) + TestCase.__init__(self, *args, **kwargs) diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/functional/__init__.py b/Open-ILS/web/oilsweb/oilsweb/tests/functional/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_acq.py b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_acq.py new file mode 100644 index 0000000000..845f3c67b6 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_acq.py @@ -0,0 +1,7 @@ +from oilsweb.tests import * + +class TestAcqController(TestController): + + def test_index(self): + response = self.app.get(url_for(controller='acq')) + # Test response... diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/test_models.py b/Open-ILS/web/oilsweb/oilsweb/tests/test_models.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/web/oilsweb/oilsweb/websetup.py b/Open-ILS/web/oilsweb/oilsweb/websetup.py new file mode 100644 index 0000000000..2eb8bbda38 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/websetup.py @@ -0,0 +1,14 @@ +"""Setup the oilsweb application""" +import logging + +from paste.deploy import appconfig +from pylons import config + +from oilsweb.config.environment import load_environment + +log = logging.getLogger(__name__) + +def setup_config(command, filename, section, vars): + """Place any commands to setup oilsweb here""" + conf = appconfig('config:' + filename) + load_environment(conf.global_conf, conf.local_conf) diff --git a/Open-ILS/web/oilsweb/setup.cfg b/Open-ILS/web/oilsweb/setup.cfg new file mode 100644 index 0000000000..3862d15dfa --- /dev/null +++ b/Open-ILS/web/oilsweb/setup.cfg @@ -0,0 +1,59 @@ +[egg_info] +tag_build = dev +tag_svn_revision = true + +[easy_install] +find_links = http://www.pylonshq.com/download/ + +[pudge] +theme = pythonpaste.org + +# Add extra doc files here with spaces between them +docs = docs/index.txt + +# Doc Settings +doc_base = docs/ +dest = docs/html + +# Add extra modules here separated with commas +modules = oilsweb +title = Oilsweb +organization = Pylons + +# Highlight code-block sections with Pygments +highlighter = pygments + +# Optionally add extra links +#organization_url = http://pylonshq.com/ +#trac_url = http://pylonshq.com/project +settings = no_about=true + +# Optionally add extra settings +# link1=/community/ Community +# link2=/download/ Download + +[publish] +doc-dir=docs/html +make-dirs=1 + +# Babel configuration +[compile_catalog] +domain = oilsweb +directory = oilsweb/i18n +statistics = true + +[extract_messages] +add_comments = TRANSLATORS: +output_file = oilsweb/i18n/oilsweb.pot +width = 80 + +[init_catalog] +domain = oilsweb +input_file = oilsweb/i18n/oilsweb.pot +output_dir = oilsweb/i18n + +[update_catalog] +domain = oilsweb +input_file = oilsweb/i18n/oilsweb.pot +output_dir = oilsweb/i18n +previous = true diff --git a/Open-ILS/web/oilsweb/setup.py b/Open-ILS/web/oilsweb/setup.py new file mode 100644 index 0000000000..8b55beea3d --- /dev/null +++ b/Open-ILS/web/oilsweb/setup.py @@ -0,0 +1,31 @@ +try: + from setuptools import setup, find_packages +except ImportError: + from ez_setup import use_setuptools + use_setuptools() + from setuptools import setup, find_packages + +setup( + name='oilsweb', + version="", + #description='', + #author='', + #author_email='', + #url='', + install_requires=["Pylons>=0.9.6.1"], + packages=find_packages(exclude=['ez_setup']), + include_package_data=True, + test_suite='nose.collector', + package_data={'oilsweb': ['i18n/*/LC_MESSAGES/*.mo']}, + #message_extractors = {'oilsweb': [ + # ('**.py', 'python', None), + # ('templates/**.mako', 'mako', None), + # ('public/**', 'ignore', None)]}, + entry_points=""" + [paste.app_factory] + main = oilsweb.config.middleware:make_app + + [paste.app_install] + main = pylons.util:PylonsInstaller + """, +) -- 2.11.0