Beispiel #1
0
 def find(self, key:CfgKey):
     if FileFolderService.existFile(self.propertiesPath):
         fileLines = FileFolderService.readFile(self.propertiesPath)
         keyValuePairs = self._getPropertiesAsDict(fileLines)
         if key._name_ in keyValuePairs:
             return keyValuePairs[key._name_]
     return None
Beispiel #2
0
 def __init__(self, folderPath):
     configFilePath = os.path.join(
         folderPath, cfgValue[CfgKey.DIASHOW_CLIENT_PICTURE_CONFIG_FILE])
     self.config = {}
     if FileFolderService.existFile(configFilePath):
         fileLines = FileFolderService.readFile(configFilePath)
         self.config = {}
         for fileLine in fileLines:
             fileLineParts = fileLine.split("=", 1)
             self.config[fileLineParts[0].replace(
                 '=', '').strip()] = fileLineParts[1].strip()
Beispiel #3
0
 def updateFunnyPictures(self):
     self.disableAllButtons()
     urls = FileFolderService.readFile(
         CfgService.get(
             CfgKey.PAGE_SYSTEMPICTUREMANAGER_FUNNY_PICTURE_SOURCE))
     if (len(urls) > 0):
         self.thread = PictureDownloadThread(
             urls,
             CfgService.get(CfgKey.PAGE_CAPTUREPHOTO_LAST_IMAGE_FOLDER),
             CfgService.get(
                 CfgKey.
                 PAGE_SYSTEMPICTUREMANAGER_FUNNY_PICTURE_SOURCE_SUCCESS_DOWNLOAD
             ))
         self.thread._signal.connect(self.signal_accept)
         self.thread.start()
     else:
         self.enableAllButtons()
         self.funnyUpdateButton.setText(
             textValue[TextKey.PAGE_SYSTEMPICTUREMANAGER_SUCCESSFULL])
Beispiel #4
0
 def set(self, key:CfgKey, value):
     keyValuePairs = {}
     if FileFolderService.existFile(self.propertiesPath):
         fileLines = FileFolderService.readFile(self.propertiesPath)
         keyValuePairs = self._getPropertiesAsDict(fileLines)
     self._saveProperty(keyValuePairs, key, value)