Commits

Lynn Rees committed 1982de1

- yes

Comments (0)

Files changed (10)

+0.1.1
+
+- release
+
+0.1.2
+
+- use importlib
+
+0.1.3
+
+- python 2.6 support
+
+0.2.0
+
+- dynamic binding support
+
+0.3.0
+
+- lazy load modules from appconf
+
+0.3.1
+
+- remove zope.component dependency
+
+0.3.2
+
+- shift to absolute imports
+
+0.3.3
+
+- add utility functions
+
+0.4.0
+
+- make inclusion of branch appspaces less magical by requiring name of appconf
+module when passed to 'include' e.g. 'module.path.apps' instead of 'module.path'
+- change default name of app configuration object to 'appconf' from 'apps'
+- rename 'add_appspace' function to 'add_branch'
+
+0.4.1
+
+- refine utility functions
+- update documentation and self-documentation of methods
+
+0.5.0 
+
+- Python 3 support
+- class based configuration
+- remove lru_cache, global appspace
+- consolidated exceptions with keys
+
+0.5.1
+
+- split out registry
+- more flexible key assignment
+
+0.5.2
+
+- exhaustmap usage
+
+0.5.4
+
+- setup infrastructure

CHANGELOG.txt

-0.1.1
-
-- release
-
-0.1.2
-
-- use importlib
-
-0.1.3
-
-- python 2.6 support
-
-0.2.0
-
-- dynamic binding support
-
-0.3.0
-
-- lazy load modules from appconf
-
-0.3.1
-
-- remove zope.component dependency
-
-0.3.2
-
-- shift to absolute imports
-
-0.3.3
-
-- add utility functions
-
-0.4.0
-
-- make inclusion of branch appspaces less magical by requiring name of appconf
-module when passed to 'include' e.g. 'module.path.apps' instead of 'module.path'
-- change default name of app configuration object to 'appconf' from 'apps'
-- rename 'add_appspace' function to 'add_branch'
-
-0.4.1
-
-- refine utility functions
-- update documentation and self-documentation of methods
-
-0.5.0 
-
-- Python 3 support
-- class based configuration
-- remove lru_cache, global appspace
-- consolidated exceptions with keys
-
-0.5.1
-
-- split out registry
-- more flexible key assignment
-
-0.5.2
-
-- exhaustmap usage
-
-0.5.4
-
-- setup infrastructure

appspace/__init__.py

 '''appspace, easy application construction with easy building blocks'''
 
 from appspace.utils import key
+from appspace.support import appifies
 from appspace.registry import Registry, Manager
-from appspace.imps import appifies
 from appspace.keys import (
     NoAppError, AppLookupError, AppspaceKey, Attribute)
 from appspace.builders import (
 # -*- coding: utf-8 -*-
 '''appspace keys'''
 
-# pylint: disable-msg=f0401
 from zope.interface import Attribute
 from zope.interface.interface import InterfaceClass
 from zope.interface.interfaces import ComponentLookupError
-# pylint: enable-msg=f0401
 
 # primary key
 AppspaceKey = InterfaceClass('AppspaceKey')
     '''app key'''
 
 
-# pylint: disable-msg=e0213
 class AAppspace(AppspaceKey):
 
     '''appspace key'''
 
     '''branch key'''
 
-# pylint: disable-msg=e0211
     def build():  # @NoSelf
         '''build appspace'''
-# pylint: enable-msg=e0211
 
 
 class ALazyLoad(AApp):
         normalizes string, converts to lowercase, removes non-alpha characters,
         and converts spaces to hyphens
         '''
-# pylint: enable-msg=e0213
 
 
 class ANamespace(AppspaceKey):

appspace/registry.py

 from inspect import isclass, getmro
 from unicodedata import normalize
 
-from twoq import twoq
 from stuf.six import u, strings, keys, items
-from stuf.utils import exhaustcall, selfname
 
-from appspace.utils import lazyimport, checkname
+from appspace.utils import checkname
 from appspace.support import appifies, AppStore, StrictAppStore
 from appspace.keys import (
     ALazyLoad, InterfaceClass, AApp,  ANamespace, AManager, AppLookupError,
     AService, ConfigurationError)
+from stuf.iterable import exhaustcall
+from stuf.deep import selfname
+from stuf.utils import lazyimport
 
 
 @appifies(ALazyLoad)

appspace/support.py

 # -*- coding: utf-8 -*-
 '''appspace imports'''
 
-# pylint: disable-msg=f0401
 from zope.interface import implementer, implementedBy
 from zope.interface.adapter import AdapterRegistry, VerifyingAdapterRegistry
-# pylint: enable-msg=f0401
 
 keys = implementedBy
 AppStore = AdapterRegistry

appspace/utils.py

 from functools import partial
 from itertools import starmap
 from keyword import iskeyword
-from importlib import import_module
 
-from twoq import twoq
-from stuf import stuf
+#from knife import __
+#from stuf import stuf
 from stuf.six import strings
-from stuf.utils import getcls, selfname, exhaust, exhaustmap, twoway
 
 from appspace.support import appifies
 from appspace.keys import ABranch, ANamespace, AApp
 from appspace.registry import Manager, StrictManager
+from stuf.iterable import exhaustmap, exhaust
+from stuf.desc import twoway
+from stuf.utils import lazyimport
+from stuf.deep import selfname
 
 
 class key(appifies):
         exhaustmap(vars(cls), t, cls._filter)
 
 
-def localize(self, thing, *args, **kw):
-    '''
-    local settings from thing and its base classes plus any custom settings
+#def localize(self, thing, *args, **kw):
+#    '''
+#    local settings from thing and its base classes plus any custom settings
+#
+#    @param thing: some thing with local settings
+#    '''
+#    return (twoq([type.mro(getcls(thing)), [thing]]).smash().pick('Meta')
+#    .tap(lambda x: not x[0].startswith('__')).members()
+#    .reup().wrap(stuf).map().invoke('update', *args, **kw).value())
 
-    @param thing: some thing with local settings
-    '''
-    return (twoq([type.mro(getcls(thing)), [thing]]).smash().pick('Meta')
-    .tap(lambda x: not x[0].startswith('__')).members()
-    .reup().wrap(stuf).map().invoke('update', *args, **kw).value())
 
 
-def lazyimport(path, attribute=None):
-    '''
-    deferred module loader
-
-    @param path: something to load
-    @param attribute: attribute on loaded module to return
-    '''
-    if isinstance(path, strings):
-        try:
-            dot = path.rindex('.')
-            # import module
-            path = getattr(import_module(path[:dot]), path[dot + 1:])
-        # If nothing but module name, import the module
-        except (AttributeError, ValueError):
-            path = import_module(path)
-        if attribute:
-            path = getattr(path, attribute)
-    return path
-
-
-class CheckName(object):
-
-    '''ensures string is legal Python name'''
-
-    # Illegal characters for Python names
-    ic = '()[]{}@,:`=;+*/%&|^><\'"#\\$?!~'
-
-    def __call__(self, name):
-        '''
-        ensures string is legal python name
-
-        @param name: name to check
-        '''
-        # Remove characters that are illegal in a Python name
-        name = name.strip().lower().replace('-', '_').replace(
-            '.', '_'
-        ).replace(' ', '_')
-        name = ''.join(i for i in name if i not in self.ic)
-        # Add _ if value is a Python keyword
-        return name + '_' if iskeyword(name) else name
-
-
-checkname = CheckName()

appspace/version.py

+# -*- coding: utf-8 -*-
+
+__version__ = (0, 6, 0)

reqs/requirements.txt

+zope.interface>=3.8.0
+knife>=0.5.3

requirements.txt

-zope.interface>=3.8.0
-twoq>=0.4.12