def plugin_manifest(): # XXX: in python3.5 resource_string returns a 'bytes' object, but # json.loads requires a string, not bytes (only in 3.5 -- 2.7 and 3.6 # seem to both be working). Luckily .decode() seems to work in both # python3 and python2, so this *should* work for both versions. return manifest.manifest_from_string( pkg_resources.resource_string( __name__, 'unusually_named_plugin_manifest.json').decode('utf-8'))
def plugin_manifest(): # XXX: in python3.5 resource_string returns a 'bytes' object, but # json.loads requires a string, not bytes (only in 3.5 -- 2.7 and 3.6 # seem to both be working). Luckily .decode() seems to work in both # python3 and python2, so this *should* work for both versions. return manifest.manifest_from_string( pkg_resources.resource_string( __name__, 'unusually_named_plugin_manifest.json' ).decode('utf-8') )
def plugin_manifest(): """ If, for some reason, the Manifest needs to be generated at runtime, it can be done here. This function takes precedence over ``plugin_manifest.json`` automatic discovery. Note the example implemenation's behavior is identical to the default when this function isn't defined. In most cases ``plugin_manifest.json`` should be sufficient and the ``__init__.py`` file can be left empty. """ return manifest.manifest_from_string( pkg_resources.resource_string(__name__, 'plugin_manifest.json'))
def plugin_manifest(): """ If, for some reason, the Manifest needs to be generated at runtime, it can be done here. This function takes precedence over ``plugin_manifest.json`` automatic discovery. Note the example implemenation's behavior is identical to the default when this function isn't defined. In most cases ``plugin_manifest.json`` should be sufficient and the ``__init__.py`` file can be left empty. """ # XXX: note, this doesn't get called. For an example of this working, # see the mockplugin unit test. return manifest.manifest_from_string( pkg_resources.resource_string(__name__, 'plugin_manifest.json') )
def plugin_manifest(): return manifest.manifest_from_string( pkg_resources.resource_string(__name__, 'plugin_manifest.json'))