def onDrop(self, data): m = data[1] if m.hasUrls() and len(m.urls()) < 4: for url in m.urls(): p = raw(url.toLocalFile()) if os.path.isfile(p): self.proxy.add_file(data[0], str(p))
def __init__(self, historyName='history.ini', uploadName='upload.ini'): super(LocalUploadManager, self).__init__() self.logger = logger.logger_factory(self.__class__.__name__) self.historyPath = os.path.join(self.basepath, raw(historyName)) self.uploadPath = os.path.join(self.basepath, raw(uploadName)) for path, attr in [(self.historyPath, 'history'), (self.uploadPath, 'upload')]: try: with open(path, 'r'): pass except IOError: self._create_file(path, attr) self.history = ConfigObj(self.historyPath) self.upload = ConfigObj(self.uploadPath)
def __init__(self, config_name='config.ini'): super(LocalDataManager, self).__init__() self.configPath = os.path.join(self.basepath,raw(config_name)) try: with open(self.configPath,'r'): pass except IOError as e: self._create_config_file() self.config = ConfigObj(self.configPath)
def __init__(self, config_path='app.ini'): super(ApplicationManager, self).__init__() self.config_path = os.path.join(self.basepath, raw(config_path)) try: with open(self.config_path, 'r'): pass except IOError: self._create_config_file() self.config = ConfigObj(self.config_path)
def __init__(self, config_name='config.ini'): super(LocalDataManager, self).__init__() self.configPath = os.path.join(self.basepath, raw(config_name)) try: with open(self.configPath, 'r'): pass except IOError as e: self._create_config_file() self.config = ConfigObj(self.configPath)