本文整理汇总了Python中platform.lower方法的典型用法代码示例。如果您正苦于以下问题:Python platform.lower方法的具体用法?Python platform.lower怎么用?Python platform.lower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类platform
的用法示例。
在下文中一共展示了platform.lower方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def __init__(self, interpreter, abi, platform):
self._interpreter = interpreter.lower()
self._abi = abi.lower()
self._platform = platform.lower()
示例2: _interpreter_name
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def _interpreter_name():
name = platform.python_implementation().lower()
return INTERPRETER_SHORT_NAMES.get(name) or name
示例3: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def __init__(self, interpreter, abi, platform):
# type: (str, str, str) -> None
self._interpreter = interpreter.lower()
self._abi = abi.lower()
self._platform = platform.lower()
示例4: interpreter_name
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def interpreter_name():
# type: () -> str
"""
Returns the name of the running interpreter.
"""
try:
name = sys.implementation.name # type: ignore
except AttributeError: # pragma: no cover
# Python 2.7 compatibility.
name = platform.python_implementation().lower()
return INTERPRETER_SHORT_NAMES.get(name) or name
示例5: is_unix_like
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def is_unix_like(platform=None):
"""Returns whether the given platform is a Unix-like platform with the usual
Unix filesystem. When the parameter is omitted, it defaults to ``sys.platform``
"""
platform = platform or sys.platform
platform = platform.lower()
return (
platform.startswith("linux")
or platform.startswith("darwin")
or platform.startswith("cygwin")
)
示例6: CleanFiles
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def CleanFiles(currentPath, platform):
import os, glob
if platform.lower() == "windows":
if len(filter(os.path.isfile, glob.glob('./*.pyc'))) > 0:
os.system('del /q "' + currentPath + '*.pyc"')
if len(filter(os.path.isfile, glob.glob('./*.pyo'))) > 0:
os.system('del /q "' + currentPath + '*.pyo"')
else:
os.system("rm -rf " + currentPath + "*.pyc")
os.system("rm -rf " + currentPath + "*.pyo")
示例7: Main
# 需要导入模块: import platform [as 别名]
# 或者: from platform import lower [as 别名]
def Main(customClines, cccamPath, cccamBin):
import sys, os, optparse, ReloadCam_Arguments, platform, traceback, sys
try:
clines = []
parser = optparse.OptionParser(description="Refrescador automatico de clines. Creado por Dagger")
possibleArguments = '%s' % ','.join(map(str, ReloadCam_Arguments.Arguments))
parser.add_option('-s', '--server', dest='web', action='append', choices=ReloadCam_Arguments.Arguments,
help="Especifica la web de la que quieres descargar las clines. Puedes repetir este parametro varias \
veces o usar ALL para llamar a todos o ALLTF para todos menos testious y feecline. Valores posibles: " + possibleArguments)
parser.add_option('-o', '--oscam', dest='oscam', help='Traduce el cccam.cfg a formato OSCAM y lo guarda en la ruta que le indiques')
parser.add_option('-r', '--norestart', dest='norestart', default=False, action='store_true',
help='NO reinicia la cccam despues del refresco de clines')
parser.add_option('-n', '--nodownload', dest='nodownload', default=False, action='store_true',
help='NO descarga nuevas lineas. Solo reordena por ping y elimina las lineas que no funcionan')
(opts, args) = parser.parse_args()
if opts.nodownload is True and opts.web is not None:
print "Cannot call with -s and -n at the same time"
return;
if opts.nodownload is False:
clines = GetClinesByArgument(opts.web, customClines)
if len(clines) <= 0:
print "CAUTION! No new lines retrieved"
WriteCccamFile(clines, cccamPath)
if opts.oscam is not None:
TransformToOscamFile(opts.oscam, cccamPath)
if opts.norestart is False and platform.system().lower() != "windows":
print "Restarting cam!"
RestartCccam(cccamBin)
print "Finished!!!"
except Exception,e:
print "Unexpected error thrown in ReloadCam_Main: " + str(e)
traceback.print_exc(file=sys.stdout)