本文整理汇总了Python中mmfparser.player.common.convert_path函数的典型用法代码示例。如果您正苦于以下问题:Python convert_path函数的具体用法?Python convert_path怎么用?Python convert_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_path函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
def execute(self, instance):
path = convert_path(self.get_filename(self.get_parameter(0)))
try:
data = open(path, 'rb').read()
except IOError:
return
instance.objectPlayer.set_text(data)
示例2: execute
def execute(self, instance):
filename = self.evaluate_expression(self.get_parameter(0))
try:
gzip.GzipFile(convert_path(filename), 'wb').write(
str(instance.objectPlayer.workspace.data))
except IOError:
return
示例3: get
def get(self, instance):
path = convert_path(self.next_argument())
try:
value = time.gmtime(os.path.getatime(path))
except OSError:
return ''
return time.strftime('%d/%m/%y', value)
示例4: execute
def execute(self, instance):
filename = self.evaluate_index(0)
try:
data = gzip.GzipFile(convert_path(filename), 'rb').read()
except IOError:
return
instance.objectPlayer.workspace.data = ByteReader(data)
示例5: execute
def execute(self, instance):
path = convert_path(
self.get_filename(self.get_parameter(0)))
try:
open(path, 'wb').write(str(instance.objectPlayer))
except IOError:
return
示例6: execute
def execute(self, instance):
defaultPath = convert_path(
self.evaluate_index(0))
objectPlayer = instance.objectPlayer
objectPlayer.path = open_save_selector(title = objectPlayer.title,
filters = objectPlayer.filters,
root = defaultPath)
示例7: execute
def execute(self, instance):
defaultPath = convert_path(
self.evaluate_expression(self.get_parameter(0)))
objectPlayer = instance.objectPlayer
objectPlayer.path = open_file_selector(title = objectPlayer.title,
filters = objectPlayer.filters,
root = defaultPath)
示例8: check
def check(self, instance):
path = convert_path(
self.evaluate_index(0))
try:
f = open(path, 'r+')
f.close()
return True
except (IOError, OSError):
return False
示例9: check
def check(self, instance):
path = convert_path(
self.evaluate_expression(self.get_parameter(0)))
try:
f = open(path, 'r+')
f.close()
return True
except (IOError, OSError):
return False
示例10: load
def load(self, filename):
path = convert_path(filename)
self.config = FastINI(path)
示例11: action
def action(self, instance):
path = convert_path(
self.evaluate_index(0))
open(path, 'wb').close()
示例12: action
def action(self, instance):
path = convert_path(
self.evaluate_expression(self.get_parameter(0)))
os.rmdir(path)