示例#1
0
 def _load_from_properties(self):
     """
     Creates a new configuration object and attempts to read in values from an existing GiftCloudUploader properties file
     :return:
     """
     base = BrowserConfiguration.get_user_directory()
     properties_file = os.path.join(base, "GiftCloudUploader.properties")
     config = ConfigParser()
     config.add_section(self.root_section_name)
     if os.path.exists(properties_file):
         properties = PropertyParser(properties_file)
         self._set_if_exists(config, 'url', properties.properties, 'giftcloud_serverurl')
         self._set_if_exists(config, 'user_name', properties.properties, 'giftcloud_lastusername')
     return config