示例#1
0
文件: view.py 项目: Fil0x/Cloudy
 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))
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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)
示例#7
0
    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)