本文整理匯總了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)