Commits

Lynn Rees committed c2d9f3a

- try again

  • Participants
  • Parent commits 92a507f
  • Branches default

Comments (0)

Files changed (6)

 Configuration over convention.
 ==============================
 
-**************************
-Class based configuration:
-**************************
+Classy configuration:
 
     >>> from stage import Conf
     >>> class defaults:
     '%a, %d %b %Y %H:%M:%S'
     >>> config.STREAM.ENABLED
     True
-    
-**********************************
-Process environment configuration:
-**********************************
+
+Telepathic environment configuration:
 
     >>> from stage import TwoDeep, Env, env
     >>> required = TwoDeep()
         1
         ROTATE.INTERVAL
         'h'
+
+Meanwhile, in some other module...    
+
+    >>> from stage import env
     >>> config = env()
     >>> with config.LOG as LOG:
         LOG.LEVEL
         ROTATE.BACKUPS
         1
         ROTATE.INTERVAL
-        'h'    
+        'h'
+        
+*******
+Spooky.
 
 
 def getversion(fname):
-    '''Get __version__ without importing.'''
+    '''Get `__version__` without importing.'''
     for line in open(fname):
         if line.startswith('__version__'):
             return '%s.%s.%s' % eval(line[13:].rstrip())
     zip_safe=False,
     install_requires=install_requires,
     classifiers=[
-        'Development Status :: 4 - Beta',
+        'Development Status :: 3 - Alpha',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: BSD License',
         'Natural Language :: English',

File stage/__init__.py

 '''Pythonic configuration.'''
 
 __version__ = (0, 2, 1)
+
+from .conf import Context, Conf, Env, env, context, With
+
+__all__ = 'Context Conf Env env context With'.split()

File stage/conf.py

         return self._wrapper(end)
 
 
-class TwoDeep(ConfFactory):
+class With(ConfFactory):
 
     '''Factory for two-level deep configuration.'''
 

File tests/test_stage.py

 class TestTwoDeep(Base, unittest.TestCase):
 
     def setUp(self):
-        from stage.conf import TwoDeep
-        defaults = TwoDeep()
+        from stage.conf import With
+        defaults = With()
         with defaults.LOG:
             defaults.NAME('root')
             # log level
             defaults.ENCODING(None)
             defaults.MODE('a')
             defaults.SIZE(0)
-        required = TwoDeep()
+        required = With()
         with required.SMTP:
             required.ENABLED(False)
             # to email address

File tests/twodeep.py

 # -*- coding: utf-8 -*-
 
-from stage.conf import TwoDeep
+from stage.conf import With
 
-defaults = TwoDeep()
+defaults = With()
 with defaults.LOG:
     defaults.NAME('root')
     # log level
     defaults.ENCODING(None)
     defaults.MODE('a')
     defaults.SIZE(0)
-required = TwoDeep()
+required = With()
 
 with required.SMTP:
     required.ENABLED(False)