Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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]
Beispiel #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]
Beispiel #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
Beispiel #31
0
 def action(self, instance):
     src = convert_path(self.evaluate_index(0))
     dest = convert_path(self.evaluate_index(1))
     shutil.copyfile(src, dest)
Beispiel #32
0
 def load(self, filename):
     path = convert_path(filename)
     self.config = FastINI(path)
Beispiel #33
0
 def load(self, filename):
     path = convert_path(filename)
     self.config = FastINI(path)
Beispiel #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())
Beispiel #35
0
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(1))
     shutil.copyfile(src, dest)
Beispiel #36
0
 def get(self, instance):
     path = convert_path(self.next_argument())
     try:
         return os.path.getsize(path)
     except OSError:
         return 0
Beispiel #37
0
 def check(self, instance):
     path = convert_path(self.evaluate_index(0))
     return os.path.isdir(path)
Beispiel #38
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     os.rmdir(path)
Beispiel #39
0
 def check(self, instance):
     path = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     return os.path.isdir(path)
Beispiel #40
0
 def action(self, instance):
     path = convert_path(self.evaluate_index(0))
     open(path, 'wb').close()
Beispiel #41
0
 def action(self, instance):
     src = convert_path(self.evaluate_index(0))
     dest = convert_path(self.evaluate_index(0))
     os.rename(src, dest)
Beispiel #42
0
 def action(self, instance):
     value = self.evaluate_index(0)
     filename = convert_path(
         self.evaluate_index(0))
     open(filename, 'ab').write(value)
Beispiel #43
0
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(0))
     os.rename(src, dest)
Beispiel #44
0
 def check(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     return os.path.isdir(path)
Beispiel #45
0
 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)
Beispiel #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
Beispiel #48
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.normpath(value)
Beispiel #49
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     open(path, 'wb').close()
Beispiel #50
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitext(os.path.basename(value))[1]
Beispiel #51
0
 def action(self, instance):
     path = convert_path(self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
Beispiel #52
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitdrive(os.path.dirname(value))[1]
Beispiel #53
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitext(os.path.basename(value))[1]
Beispiel #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())
Beispiel #55
0
 def action(self, instance):
     path = convert_path(
         self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
Beispiel #56
0
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.normpath(value)
Beispiel #57
0
 def action(self, instance):
     path = convert_path(self.evaluate_index(0))
     os.rmdir(path)
Beispiel #58
0
 def get(self, instance):
     path = convert_path(self.next_argument())
     try:
         return os.path.getsize(path)
     except OSError:
         return 0
Beispiel #59
0
 def action(self, instance):
     value = self.evaluate_index(0)
     filename = convert_path(self.evaluate_index(0))
     open(filename, 'ab').write(value)
Beispiel #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)