Esempio n. 1
0
def test_absOrConfigPath():
    relpath = 'relpath'
    abspath = os.path.abspath(relpath)
    ok_(
        pathprovider.absOrConfigPath(relpath).startswith(
            pathprovider.getConfigPath()))
    eq_(abspath, pathprovider.absOrConfigPath(abspath))
Esempio n. 2
0
def info():
    import locale
    import platform
    from audiotranscode import AudioTranscode
    audiotranscode = AudioTranscode()

    encoders = [
        '%s (%s)' % (enc.filetype, enc.command[0])
        for enc in audiotranscode.available_encoders
    ]
    decoders = [
        '%s (%s)' % (enc.filetype, enc.command[0])
        for enc in audiotranscode.available_decoders
    ]

    return """CherryMusic Server {cm_version}

CherryPy: {cp_version}
Python: {py_version}
Platform: {platform}

configuration dir:
    {confdir}
server data dir:
    {datadir}
static resources dir:
    {resourcedir}
server package dir:
    {packdir}
process working dir:
    {workdir}

locale: {locale}, default: {deflocale}
filesystem encoding: {fs_encoding}

Available Decoders:
    {decoders}
Available Encoders:
    {encoders}

(Do not parse this output.)""".format(
        cm_version=REPO_VERSION or VERSION,
        cp_version=cherrypy.__version__,
        py_version=platform.python_implementation() + ' ' +
        platform.python_version(),
        platform=platform.platform(),
        workdir=os.path.abspath(os.curdir),
        packdir=os.path.abspath(__path__[0]),
        confdir=pathprovider.getConfigPath(),
        datadir=pathprovider.getUserDataPath(),
        resourcedir=pathprovider.getResourcePath(''),
        locale=str(locale.getlocale()),
        deflocale=str(locale.getdefaultlocale()),
        fs_encoding=sys.getfilesystemencoding(),
        encoders='\n    '.join(encoders),
        decoders='\n    '.join(decoders),
    )
Esempio n. 3
0
def info():
    import locale
    import platform
    from audiotranscode import AudioTranscode
    audiotranscode = AudioTranscode()

    encoders = ['%s (%s)' % (enc.filetype, enc.command[0])
                for enc in audiotranscode.available_encoders]
    decoders = ['%s (%s)' % (enc.filetype, enc.command[0])
                for enc in audiotranscode.available_decoders]

    return """CherryMusic Server {cm_version}

CherryPy: {cp_version}
Python: {py_version}
Platform: {platform}

configuration dir:
    {confdir}
server data dir:
    {datadir}
static resources dir:
    {resourcedir}
server package dir:
    {packdir}
process working dir:
    {workdir}

locale: {locale}, default: {deflocale}
filesystem encoding: {fs_encoding}

Available Decoders:
    {decoders}
Available Encoders:
    {encoders}

(Do not parse this output.)""".format(
    cm_version=REPO_VERSION or VERSION,
    cp_version=cherrypy.__version__,
    py_version=platform.python_implementation() + ' ' + platform.python_version(),
    platform=platform.platform(),
    workdir=os.path.abspath(os.curdir),
    packdir=os.path.abspath(__path__[0]),
    confdir=pathprovider.getConfigPath(),
    datadir=pathprovider.getUserDataPath(),
    resourcedir=pathprovider.getResourcePath(''),
    locale=str(locale.getlocale()),
    deflocale=str(locale.getdefaultlocale()),
    fs_encoding=sys.getfilesystemencoding(),
    encoders='\n    '.join(encoders),
    decoders='\n    '.join(decoders),
)
Esempio n. 4
0
def info():
    import locale
    import platform
    return """CherryMusic Server {cm_version}

CherryPy: {cp_version}
Python: {py_version}
Platform: {platform}

configuration dir:
    {confdir}
server data dir:
    {datadir}
static resources dir:
    {resourcedir}
server package dir:
    {packdir}
process working dir:
    {workdir}

locale: {locale}, default: {deflocale}
filesystem encoding: {fs_encoding}

(Do not parse this output.)""".format(
        cm_version=REPO_VERSION or VERSION,
        cp_version=cherrypy.__version__,
        py_version=platform.python_implementation() + ' ' +
        platform.python_version(),
        platform=platform.platform(),
        workdir=os.path.abspath(os.curdir),
        packdir=os.path.abspath(__path__[0]),
        confdir=pathprovider.getConfigPath(),
        datadir=pathprovider.getUserDataPath(),
        resourcedir=pathprovider.getResourcePath(''),
        locale=str(locale.getlocale()),
        deflocale=str(locale.getdefaultlocale()),
        fs_encoding=sys.getfilesystemencoding(),
    )
Esempio n. 5
0
def info():
    import locale
    import platform
    return """CherryMusic Server {cm_version}

CherryPy: {cp_version}
Python: {py_version}
Platform: {platform}

configuration dir:
    {confdir}
server data dir:
    {datadir}
static resources dir:
    {resourcedir}
server package dir:
    {packdir}
process working dir:
    {workdir}

locale: {locale}, default: {deflocale}
filesystem encoding: {fs_encoding}

(Do not parse this output.)""".format(
    cm_version=REPO_VERSION or VERSION,
    cp_version=cherrypy.__version__,
    py_version=platform.python_implementation() + ' ' + platform.python_version(),
    platform=platform.platform(),
    workdir=os.path.abspath(os.curdir),
    packdir=os.path.abspath(__path__[0]),
    confdir=pathprovider.getConfigPath(),
    datadir=pathprovider.getUserDataPath(),
    resourcedir=pathprovider.getResourcePath(''),
    locale=str(locale.getlocale()),
    deflocale=str(locale.getdefaultlocale()),
    fs_encoding=sys.getfilesystemencoding(),
)
def test_absOrConfigPath():
    relpath = 'relpath'
    abspath = os.path.abspath(relpath)
    ok_(pathprovider.absOrConfigPath(relpath).startswith(pathprovider.getConfigPath()))
    eq_(abspath, pathprovider.absOrConfigPath(abspath))