How to use the clu.typology.string_types function in clu

To help you get started, we’ve selected a few clu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fish2000 / instakit / instakit / utils / pipeline.py View on Github external
def mode(self, value):
        if value is None:
            return
        if type(value) in string_types:
            value = Mode.for_string(value)
        if Mode.is_mode(value):
            # if value is not self.mode_t:
            self.set_mode_t(value)
        else:
            raise TypeError("invalid mode type: %s (%s)" % (type(value), value))
github fish2000 / instakit / instakit / utils / mode.py View on Github external
def set(self, value):
        if value is None:
            self.value = value
            return
        if type(value) in string_types:
            value = Mode.for_string(value)
        if Mode.is_mode(value):
            if value is not self.default:
                self.value = value
                return
        else:
            raise TypeError("can’t set invalid mode: %s (%s)" % (type(value), value))
github fish2000 / instakit / instakit / utils / misc.py View on Github external
        @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()