package_dir={'': 'src'},
# Run-time dependencies.
- install_requires=[],
+ install_requires=[
+ 'pyramid_beaker',
+ 'pyramid_mako',
+ ],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
--- /dev/null
+# Copyright (C) 2018 The Meme Factory, Inc. http://www.meme.com/
+
+# This file is part of PGWUI_Common.
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+#
+
+# Karl O. Pinc <kop@meme.com>
+
+'''Provide a way to configure PGWUI.
+
+To use pgwui_common configure your pyramid app by putting the
+following into your package's __init__.py:
+
+ from pyramid.config import Configurator
+
+ def main(global_config, **settings):
+ config = Configurator()
+ config.include('pgwui_common.configure.includeme')
+
+'''
+
+
+def includeme(config):
+ config.include('pyramid_mako')
+ config.include('pyramid_beaker')
+ config.add_static_view(
+ 'static', 'pgwui_common:/static', cache_max_age=3600)
+++ /dev/null
-# Copyright (C) 2018 The Meme Factory, Inc. http://www.meme.com/
-
-# This file is part of PGWUI_Common.
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/>.
-#
-
-# Karl O. Pinc <kop@meme.com>
-
-'''Empty module.
-'''
-
-
-def example_func():
- return 1
--- /dev/null
+# Copyright (C) 2018 The Meme Factory, Inc. http://www.meme.com/
+
+# This file is part of PGWUI_Common.
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+#
+
+# Karl O. Pinc <kop@meme.com>
+
+from pgwui_common import configure
+
+
+def test_configure_includecalled():
+
+ class MockConfig():
+ def __init__(self):
+ self.include_called = False
+ self.add_static_view_called = False
+
+ def include(self, *args):
+ self.include_called = True
+
+ def add_static_view(self, *args, **kwargs):
+ self.add_static_view_called = True
+
+ config = MockConfig()
+ configure.includeme(config)
+ assert config.include_called
+ assert config.add_static_view_called
+++ /dev/null
-# Copyright (C) 2018 The Meme Factory, Inc. http://www.meme.com/
-
-# This file is part of PGWUI_Common.
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/>.
-#
-
-# Karl O. Pinc <kop@meme.com>
-
-from pgwui_common import pgwui_common
-
-
-def test_example_func():
- assert pgwui_common.example_func() == 1