当前位置: 首页>>代码示例>>Python>>正文


Python common.convert_path函数代码示例

本文整理汇总了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)
开发者ID:carriercomm,项目名称:anaconda,代码行数:7,代码来源:kcedit.py

示例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
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:7,代码来源:__init__.py

示例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)
开发者ID:carriercomm,项目名称:anaconda,代码行数:7,代码来源:kcfile.py

示例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)
开发者ID:carriercomm,项目名称:anaconda,代码行数:7,代码来源:__init__.py

示例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
开发者ID:carriercomm,项目名称:anaconda,代码行数:7,代码来源:kclist.py

示例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)
开发者ID:carriercomm,项目名称:anaconda,代码行数:7,代码来源:kcfile.py

示例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)
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:7,代码来源:kcfile.py

示例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
开发者ID:carriercomm,项目名称:anaconda,代码行数:9,代码来源:kcfile.py

示例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
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:9,代码来源:kcfile.py

示例10: load

 def load(self, filename):
     path = convert_path(filename)
     self.config = FastINI(path)
开发者ID:carriercomm,项目名称:anaconda,代码行数:3,代码来源:kcini.py

示例11: action

 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     open(path, 'wb').close()
开发者ID:carriercomm,项目名称:anaconda,代码行数:4,代码来源:kcfile.py

示例12: action

 def action(self, instance):
     path = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:4,代码来源:kcfile.py


注:本文中的mmfparser.player.common.convert_path函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。