本文整理汇总了Python中Tools.ASCIItranslit.legacyEncode方法的典型用法代码示例。如果您正苦于以下问题:Python ASCIItranslit.legacyEncode方法的具体用法?Python ASCIItranslit.legacyEncode怎么用?Python ASCIItranslit.legacyEncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools.ASCIItranslit
的用法示例。
在下文中一共展示了ASCIItranslit.legacyEncode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: calculateFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def calculateFilename(self):
service_name = self.service_ref.getServiceName()
begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
begin_shortdate = strftime("%Y%m%d", localtime(self.begin))
print "begin_date: ", begin_date
print "service_name: ", service_name
print "name:", self.name
print "description: ", self.description
filename = begin_date + " - " + service_name
if self.name:
if config.usage.setup_level.index >= 2: # expert+
if config.recording.filename_composition.value == "short":
filename = begin_shortdate + " - " + self.name
elif config.recording.filename_composition.value == "long":
filename += " - " + self.name + " - " + self.description
else:
filename += " - " + self.name # standard
else:
filename += " - " + self.name
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
if self.dirname:
self.dirnameHadToFallback = True
dirname = defaultMoviePath()
else:
dirname = self.dirname
self.Filename = Directories.getRecordingFilename(filename, dirname)
self.log(0, "Filename calculated as: '%s'" % self.Filename)
示例2: calculateFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def calculateFilename(self):
service_name = self.service_ref.getServiceName()
begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
# print "begin_date: ", begin_date
# print "service_name: ", service_name
# print "name:", self.name
# print "description: ", self.description
#
filename = begin_date + " - " + service_name
if self.name:
if config.recording.filename_composition.getValue() == "short":
filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + self.name
elif config.recording.filename_composition.getValue() == "long":
filename += " - " + self.name + " - " + self.description
else:
filename += " - " + self.name # standard
if config.recording.ascii_filenames.getValue():
filename = ASCIItranslit.legacyEncode(filename)
if not self.dirname:
dirname = findSafeRecordPath(defaultMoviePath())
else:
dirname = findSafeRecordPath(self.dirname)
if dirname is None:
dirname = findSafeRecordPath(defaultMoviePath())
self.dirnameHadToFallback = True
if not dirname:
return None
self.Filename = Directories.getRecordingFilename(filename, dirname)
self.log(0, "Filename calculated as: '%s'" % self.Filename)
return self.Filename
示例3: calculateFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def calculateFilename(self, name=None):
service_name = self.service_ref.getServiceName()
begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
name = name or self.name
filename = begin_date + " - " + service_name
if name:
if config.recording.filename_composition.value == "event":
filename = name + ' - ' + begin_date + "_" + service_name
elif config.recording.filename_composition.value == "short":
filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + name
elif config.recording.filename_composition.value == "long":
filename += " - " + name + " - " + self.description
else:
filename += " - " + name # standard
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
if not self.dirname:
dirname = (defaultMoviePath())
else:
dirname = (self.dirname)
if dirname is None:
dirname = (defaultMoviePath())
self.dirnameHadToFallback = True
if not dirname:
return None
self.Filename = Directories.getRecordingFilename(filename, dirname)
self.log(0, "Filename calculated as: '%s'" % self.Filename)
return self.Filename
示例4: calculateFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def calculateFilename(self):
service_name = self.service_ref.getServiceName()
begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
# print "begin_date: ", begin_date
# print "service_name: ", service_name
# print "name:", self.name
# print "description: ", self.description
#
filename = begin_date + " - " + service_name
if self.name:
if config.recording.filename_composition.value == "veryveryshort":
filename = self.name
elif config.recording.filename_composition.value == "veryshort":
filename = self.name + " - " + begin_date
elif config.recording.filename_composition.value == "short":
filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + self.name
elif config.recording.filename_composition.value == "long":
filename += " - " + self.name + " - " + self.description
else:
filename += " - " + self.name # standard
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
self.Filename = Directories.getRecordingFilename(filename, self.MountPath)
if debug:
self.log(0, "Filename calculated as: '%s'" % self.Filename)
return self.Filename
示例5: __init__
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def __init__(self, session, movieinfo, movietitle):
self.skin = PlayRtmpMovie.skin
Screen.__init__(self, session)
self.url = movieinfo[0]
self.filename = movieinfo[1]
self.movietitle = movietitle
self.movieinfo = movieinfo
self.destination = config.mediaportal.storagepath.value
self.moviepath = self.destination + ASCIItranslit.legacyEncode(self.filename)
self.streamactive = False
self.isVisible = True
self.container=eConsoleAppContainer()
self.container.appClosed.append(self.copyfinished)
self.container.stdoutAvail.append(self.progressUpdate)
self.container.stderrAvail.append(self.progressUpdate)
self.container.setCWD(self.destination)
self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
self.BgFileEraser = eBackgroundFileEraser.getInstance()
filesize = 0
self.filesize = float(filesize) # in bytes
self.dummyfilesize = False
self.lastcmddata = None
self.lastlocalsize = 0
self.localsize = 0
self.isplaying = False
self.autoplaythreshold = config.mediaportal.autoplayThreshold.value
self["key_green"] = Button(_("Play"))
self["key_red"] = Button(_("Cancel"))
self["key_blue"] = Button(_("Show/Hide"))
self["label_filename"] = StaticText("File: %s" % (self.filename))
self["label_progress"] = StaticText("Progress: N/A")
self["label_speed"] = StaticText("Speed: N/A")
self["label_timeleft"] = StaticText("Time left: N/A")
self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
{
"cancel": self.exit,
"ok": self.okbuttonClick,
"red": self.exit,
"green": self.playfile,
"blue": self.visibility
}, -1)
self.StatusTimer = eTimer()
self.StatusTimer.callback.append(self.UpdateStatus)
self.activityslider = Slider(0, 100)
self["activityslider"] = self.activityslider
self.onFirstExecBegin.append(self.firstExecBegin)
示例6: getRecordFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def getRecordFilename(title,description,begin,channel):
begin_date = strftime("%Y%m%d %H%M", localtime(begin))
begin_shortdate = strftime("%Y%m%d", localtime(begin))
filename = begin_date + " - " + channel
if title:
if config.usage.setup_level.index >= 2: # expert+
if config.recording.filename_composition.value == "short":
filename = begin_shortdate + " - " + title
elif config.recording.filename_composition.value == "long":
filename += " - " + title + " - " + description
else:
filename += " - " + title # standard
else:
filename += " - " + title
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
return filename
示例7: calculateFilename
# 需要导入模块: from Tools import ASCIItranslit [as 别名]
# 或者: from Tools.ASCIItranslit import legacyEncode [as 别名]
def calculateFilename(self):
service_name = self.service_ref.getServiceName()
begin_date = time.strftime("%Y%m%d %H%M", time.localtime(self.begin))
print "begin_date: ", begin_date
print "service_name: ", service_name
print "name:", self.name
print "description: ", self.description
filename = begin_date + " - " + service_name
if self.name:
filename += " - " + self.name
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
if self.dirname and not Directories.fileExists(self.dirname, "w"):
self.dirnameHadToFallback = True
self.Filename = Directories.getRecordingFilename(filename, None)
else:
self.Filename = Directories.getRecordingFilename(filename, self.dirname)
self.log(0, "Filename calculated as: '%s'" % self.Filename)