示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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
示例#4
0
 def execute(self, instance):
     defaultPath = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     objectPlayer = instance.objectPlayer
     objectPlayer.path = open_save_selector(title=objectPlayer.title,
                                            filters=objectPlayer.filters,
                                            root=defaultPath)
示例#5
0
 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
 def execute(self, instance):
     path = convert_path(self.evaluate_index(0))
     lines = []
     for item in glob(path):
         if os.path.isfile(item):
             lines.append(os.path.split(item)[1])
     instance.objectPlayer.listObject.extend(lines)
示例#7
0
 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)
示例#8
0
 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)
示例#9
0
 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
示例#10
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         gzip.GzipFile(convert_path(filename), 'wb').write(
             str(instance.objectPlayer.array.generate()))
     except IOError:
         return
示例#11
0
 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)
示例#12
0
 def execute(self, instance):
     filename = convert_path(self.get_filename(self.get_parameter(0)))
     try:
         open(filename,
              'wb').write(instance.objectPlayer.array.generate().data())
     except IOError:
         pass
示例#13
0
 def execute(self, instance):
     filename = convert_path(self.get_filename(self.get_parameter(0)))
     try:
         reader = ByteReader(open(filename, 'rb'))
         instance.objectPlayer.array.read(reader)
     except IOError:
         pass
 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)
 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)
示例#16
0
 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)
 def execute(self, instance):
     path = convert_path(self.evaluate_index(0))
     lines = []
     for item in glob(path):
         if os.path.isdir(item):
             lines.append('[%s]' % os.path.basename(item))
     instance.objectPlayer.listObject.extend(lines)
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         gzip.GzipFile(convert_path(filename), 'wb').write(
             str(instance.objectPlayer.array.generate()))
     except IOError:
         return
 def execute(self, instance):
     filename = convert_path(self.get_filename(self.get_parameter(0)))
     instance.objectPlayer.reset()
     try:
         lines = open(filename, 'rb').read().splitlines()
     except IOError:
         return
     instance.objectPlayer.listObject.extend(lines)
示例#20
0
 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
示例#21
0
 def execute(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     lines = []
     for item in glob(path):
         if os.path.isdir(item):
             lines.append('[%s]' % os.path.basename(item))
     instance.objectPlayer.listObject.extend(lines)
示例#22
0
 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
示例#23
0
 def execute(self, instance):
     filename = convert_path(
         self.get_filename(self.get_parameter(0)))
     try:
         open(filename, 'wb').write(
             instance.objectPlayer.array.generate().data())
     except IOError:
         pass
示例#24
0
 def execute(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     lines = []
     for item in glob(path):
         if os.path.isfile(item):
             lines.append(os.path.split(item)[1])
     instance.objectPlayer.listObject.extend(lines)
示例#25
0
 def execute(self, instance):
     filename = convert_path(self.get_filename(self.get_parameter(0)))
     instance.objectPlayer.reset()
     try:
         lines = open(filename, 'rb').read().splitlines()
     except IOError:
         return
     instance.objectPlayer.listObject.extend(lines)
示例#26
0
 def execute(self, instance):
     filename = convert_path(
         self.get_filename(self.get_parameter(0)))
     try:
         reader = ByteReader(open(filename, 'rb'))
         instance.objectPlayer.array.read(reader)
     except IOError:
         pass
示例#27
0
 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
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         array = WorkspaceArray(
             ByteReader(gzip.GzipFile(convert_path(filename), 'rb').read()))
     except IOError:
         return
     instance.objectPlayer.array = array
     instance.objectPlayer.workspace = array.items[-1]
示例#29
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         array = WorkspaceArray(ByteReader(
             gzip.GzipFile(convert_path(filename), 'rb').read()))
     except IOError:
         return
     instance.objectPlayer.array = array
     instance.objectPlayer.workspace = array.items[-1]
示例#30
0
 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
示例#31
0
 def action(self, instance):
     src = convert_path(self.evaluate_index(0))
     dest = convert_path(self.evaluate_index(1))
     shutil.copyfile(src, dest)
示例#32
0
 def load(self, filename):
     path = convert_path(filename)
     self.config = FastINI(path)
示例#33
0
 def load(self, filename):
     path = convert_path(filename)
     self.config = FastINI(path)
示例#34
0
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(0))
     open(dest, 'ab').write(open(src, 'rb').read())
示例#35
0
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(1))
     shutil.copyfile(src, dest)
示例#36
0
 def get(self, instance):
     path = convert_path(self.next_argument())
     try:
         return os.path.getsize(path)
     except OSError:
         return 0
示例#37
0
 def check(self, instance):
     path = convert_path(self.evaluate_index(0))
     return os.path.isdir(path)
示例#38
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     os.rmdir(path)
示例#39
0
 def check(self, instance):
     path = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     return os.path.isdir(path)
示例#40
0
 def action(self, instance):
     path = convert_path(self.evaluate_index(0))
     open(path, 'wb').close()
示例#41
0
 def action(self, instance):
     src = convert_path(self.evaluate_index(0))
     dest = convert_path(self.evaluate_index(0))
     os.rename(src, dest)
示例#42
0
 def action(self, instance):
     value = self.evaluate_index(0)
     filename = convert_path(
         self.evaluate_index(0))
     open(filename, 'ab').write(value)
示例#43
0
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(0))
     os.rename(src, dest)
示例#44
0
 def check(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     return os.path.isdir(path)
示例#45
0
文件: media.py 项目: tkrym02/anaconda
 def play_sound_file(self, path, loops=1, channel=None):
     path = convert_path(path)
     if path not in self.loaded:
         self.loaded[path] = FileData(path)
     self.play_sound_item(self.loaded[path], loops, channel)
示例#46
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitdrive(os.path.dirname(value))[1]
 def execute(self, instance):
     path = convert_path(self.get_filename(self.get_parameter(0)))
     try:
         open(path, 'wb').write(instance.objectPlayer.get_text())
     except IOError:
         return
示例#48
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.normpath(value)
示例#49
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     open(path, 'wb').close()
示例#50
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitext(os.path.basename(value))[1]
示例#51
0
 def action(self, instance):
     path = convert_path(self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
示例#52
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitdrive(os.path.dirname(value))[1]
示例#53
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitext(os.path.basename(value))[1]
示例#54
0
 def action(self, instance):
     src = convert_path(self.evaluate_index(0))
     dest = convert_path(self.evaluate_index(0))
     open(dest, 'ab').write(open(src, 'rb').read())
示例#55
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
示例#56
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.normpath(value)
示例#57
0
 def action(self, instance):
     path = convert_path(self.evaluate_index(0))
     os.rmdir(path)
示例#58
0
 def get(self, instance):
     path = convert_path(self.next_argument())
     try:
         return os.path.getsize(path)
     except OSError:
         return 0
示例#59
0
 def action(self, instance):
     value = self.evaluate_index(0)
     filename = convert_path(self.evaluate_index(0))
     open(filename, 'ab').write(value)
示例#60
0
 def execute(self, instance):
     defaultPath = convert_path(self.evaluate_index(0))
     objectPlayer = instance.objectPlayer
     objectPlayer.path = open_file_selector(title=objectPlayer.title,
                                            filters=objectPlayer.filters,
                                            root=defaultPath)