Did I find the right examples for you? yes no

All Samples(48)  |  Call(27)  |  Derive(0)  |  Import(21)

        def get_long_description(package_root, filename="README.creole", raise_errors=None):
    """ read README file and convert it on-the-fly to ReStructuredText. """
    if raise_errors is None:
        raise_errors = should_raise_errors()

    if raise_errors:
        # raise a error if a unknown node found
        unknown_emit = raise_unknown_node
    else:
        # ignore unknown nodes
        unknown_emit = transparent_unknown_nodes

    filepath = os.path.join(package_root, filename)
    long_description_origin = ""
    try:
        # Read creole README
        f = codecs.open(filepath, "r", encoding="utf-8")
        long_description_origin = f.read().strip()
        f.close()

        # convert creole into html
        long_description_html = creole2html(long_description_origin)

        # convert html to ReSt
        long_description_rest_unicode = html2rest(
            long_description_html,
            emitter_kwargs={"unknown_emit":unknown_emit}
        )
        if PY3:
            long_description_rest = long_description_rest_unicode
        else:
            long_description_rest = long_description_rest_unicode.encode("utf-8")
    except Exception:
        if raise_errors:
            raise
        # Don't raise the error e.g. in ./setup install process
        evalue = sys.exc_info()[1]
        long_description_rest = "[Error: %s]\n%s" % (
            evalue, long_description_origin
        )
    else:
        if raise_errors:
            # Test created ReSt code
            from creole.rest2html.clean_writer import rest2html
            try:
                rest2html(long_description_rest_unicode, traceback=True, enable_exit_status=1, exit_status_level=2)
            except SystemExit as e:
                print("Error creole2rest self test failed: rest2html() exist with status code: %s" % e.args[0])
                raise

    return long_description_rest
        


src/p/y/python-ping-2011.10.17.376a019/setup.py   python-ping(Download)
# https://code.google.com/p/python-creole/wiki/UseInSetup
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/p/y/PyLucid-1.5.0.0524/setup.py   PyLucid(Download)
# https://code.google.com/p/python-creole/wiki/UseInSetup
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-sync-server-0.4.2/setup.py   django-sync-server(Download)
# https://code.google.com/p/python-creole/wiki/UseInSetup
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-phpBB3-0.3.0/setup.py   django-phpBB3(Download)
 
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-processinfo-0.7.0/setup.py   django-processinfo(Download)
# https://code.google.com/p/python-creole/wiki/UseInSetup
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-reversion-compare-0.3.5/setup.py   django-reversion-compare(Download)
 
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-kippo-0.1.0.0707/setup.py   django-kippo(Download)
 
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-dbpreferences-0.4.5.0803/setup.py   django-dbpreferences(Download)
# https://code.google.com/p/python-creole/wiki/UseInSetup
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-tools-0.25.1/setup.py   django-tools(Download)
 
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

src/d/j/django-reversion-compare-HEAD/setup.py   django-reversion-compare(Download)
 
try:
    from creole.setup_utils import get_long_description
except ImportError:
    if "register" in sys.argv or "sdist" in sys.argv or "--long-description" in sys.argv:
    long_description = None
else:
    long_description = get_long_description(PACKAGE_ROOT)
 
 

  1 | 2 | 3  Next