def create(sc, fp, format='md'): """ Create documentation for a SousChef from it's configurations. """ try: sc['filepath'] = fp sc['default_options'] = sous_chef_schema.SOUS_CHEF_DEFAULT_OPTIONS.keys() opts = SC_OPTS_TMPL.render(**sc).strip().replace('\n\n', '\n') metrics = SC_METRICS_TMPL.render(**sc).strip().replace('\n\n', '\n') content = "\n{}\n\n{}\n".format(opts, metrics) return doc.convert(content, 'md', format) except: msg = """ Documentation for Sous Chef {slug} located at {0} failed to generate for the following reason: {1} """.format(fp, format_exc(), **sc) raise SousChefDocError(msg)
# hack for working with pandocs on windows import codecs try: codecs.lookup('mbcs') except LookupError: utf8 = codecs.lookup('utf-8') func = lambda name, enc=utf8: {True: enc}.get(name == 'mbcs') codecs.register(func) # install readme README = os.path.join(os.path.dirname(__file__), 'README.md') try: from newslynx.lib import doc long_description = doc.convert(open(README).read(), 'md', 'rst') except: long_description = "" REQUIREMENTS = os.path.join(os.path.dirname(__file__), 'requirements.txt') REQUIREMENTS = open(REQUIREMENTS, 'r').read().splitlines() VERSION = os.path.join(os.path.dirname(__file__), 'VERSION') VERSION = open(VERSION, 'r').read().strip() # setup setup(name='newslynx-sc-facebook', version=VERSION, description='', long_description=long_description, classifiers=[
# hack for working with pandocs on windows import codecs try: codecs.lookup('mbcs') except LookupError: utf8 = codecs.lookup('utf-8') func = lambda name, enc=utf8: {True: enc}.get(name == 'mbcs') codecs.register(func) # install readme README = os.path.join(os.path.dirname(__file__), 'README.md') try: from newslynx.lib import doc long_description = doc.convert(open(README).read(), 'md', 'rst') except: long_description = "" REQUIREMENTS = os.path.join(os.path.dirname(__file__), 'requirements.txt') REQUIREMENTS = open(REQUIREMENTS, 'r').read().splitlines() VERSION = os.path.join(os.path.dirname(__file__), 'VERSION') VERSION = open(VERSION, 'r').read().strip() # setup setup( name='{{ slug }}', version=VERSION, description='{{ description }}', long_description=long_description,
import codecs try: codecs.lookup("mbcs") except LookupError: utf8 = codecs.lookup("utf-8") func = lambda name, enc=utf8: {True: enc}.get(name == "mbcs") codecs.register(func) # install readme README = os.path.join(os.path.dirname(__file__), "README.md") try: from newslynx.lib import doc long_description = doc.convert(open(README).read(), "md", "rst") except: long_description = "" REQUIREMENTS = os.path.join(os.path.dirname(__file__), "requirements.txt") REQUIREMENTS = open(REQUIREMENTS, "r").read().splitlines() VERSION = os.path.join(os.path.dirname(__file__), "VERSION") VERSION = open(VERSION, "r").read().strip() # setup setup( name="newslynx-sc-google-analytics", version=VERSION, description="", long_description=long_description,