コード例 #1
0
ファイル: kcfile.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: kcedit.py プロジェクト: carriercomm/anaconda
 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
ファイル: __init__.py プロジェクト: tkrym02/anaconda
 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
ファイル: kcfile.py プロジェクト: tkrym02/anaconda
 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
ファイル: kclist.py プロジェクト: carriercomm/anaconda
 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
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)
コード例 #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
ファイル: __init__.py プロジェクト: carriercomm/anaconda
 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
ファイル: __init__.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: __init__.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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
ファイル: __init__.py プロジェクト: tkrym02/anaconda
 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
ファイル: __init__.py プロジェクト: tkrym02/anaconda
 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
コード例 #14
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)
コード例 #15
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)
コード例 #16
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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)
コード例 #17
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)
コード例 #18
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
コード例 #19
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)
コード例 #20
0
ファイル: kcfile.py プロジェクト: tkrym02/anaconda
 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
ファイル: kclist.py プロジェクト: carriercomm/anaconda
 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
ファイル: __init__.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: kclist.py プロジェクト: carriercomm/anaconda
 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
ファイル: kclist.py プロジェクト: carriercomm/anaconda
 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
ファイル: __init__.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: kcfile.py プロジェクト: Matt-Esch/anaconda
 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
コード例 #28
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]
コード例 #29
0
ファイル: __init__.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcini.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     os.rmdir(path)
コード例 #39
0
ファイル: kcfile.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def action(self, instance):
     value = self.evaluate_index(0)
     filename = convert_path(
         self.evaluate_index(0))
     open(filename, 'ab').write(value)
コード例 #43
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def action(self, instance):
     src = convert_path(
         self.evaluate_index(0))
     dest = convert_path(
         self.evaluate_index(0))
     os.rename(src, dest)
コード例 #44
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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]
コード例 #47
0
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.normpath(value)
コード例 #49
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def action(self, instance):
     path = convert_path(
         self.evaluate_index(0))
     open(path, 'wb').close()
コード例 #50
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 def get(self, instance):
     value = convert_path(self.next_argument())
     return os.path.splitext(os.path.basename(value))[1]
コード例 #51
0
ファイル: kcfile.py プロジェクト: tkrym02/anaconda
 def action(self, instance):
     path = convert_path(self.evaluate_expression(self.get_parameter(0)))
     os.rmdir(path)
コード例 #52
0
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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
ファイル: kcfile.py プロジェクト: Matt-Esch/anaconda
 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
ファイル: kcfile.py プロジェクト: carriercomm/anaconda
 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)