Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
import six
except ImportError:
class FakeSix(object):
@property
def string_types(self):
return tuple()
six = FakeSix()
export(wrap_value, name='wrap_value')
export(none_function, name='none_function')
export(tuplize, name='tuplize')
export(uniquify, name='uniquify')
export(listify, name='listify')
export(SimpleNamespace)
export(Namespace)
export(stringify, name='stringify')
export(string_types)
export(byte_types)
export(suffix_searcher)
export(u8encode)
export(u8bytes)
export(u8str)
# Assign the modules’ `__all__` and `__dir__` using the exporter:
__all__, __dir__ = exporter.all_and_dir()
def static_namespace(name):
""" Configure and return a clu.typespace.namespace.Namespace instance,
festooning it with shortcuts allowing for accesing static files
within subdirectories of the Instakit project package tree.
"""
from clu.typespace.namespace import SimpleNamespace as Namespace
ns = Namespace()
ns.name = str(name)
ns.root = os.path.join(projectdir, ns.name)
ns.data = os.path.join(ns.root, 'data')
ns.relative = lambda p: os.path.relpath(p, start=ns.root)
ns.listfiles = lambda *p: os.listdir(os.path.join(ns.data, *p))
ns.path = lambda *p: os.path.abspath(os.path.join(ns.data, *p))
namespaces.add(ns)
return ns