mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 09:42:15 +03:00
Merge pull request #12 from Pardus-LiderAhenk/feature-chrome-settings
chrome preference json value edited
This commit is contained in:
commit
7f5ad30f8a
1 changed files with 3 additions and 8 deletions
|
@ -63,21 +63,19 @@ class BrowserChrome(AbstractPlugin):
|
||||||
file = self.user_js_file.format(username)
|
file = self.user_js_file.format(username)
|
||||||
file_full_path = path + file
|
file_full_path = path + file
|
||||||
self.silent_remove(file_full_path)
|
self.silent_remove(file_full_path)
|
||||||
# user_js = open(path + file, "w")
|
|
||||||
self.create_file(file_full_path)
|
self.create_file(file_full_path)
|
||||||
preferences = json.loads(self.data)
|
preferences = json.loads(self.data)
|
||||||
#self.logger.debug(preferences)
|
|
||||||
self.logger.debug('Writing preferences chrome to file ...')
|
self.logger.debug('Writing preferences chrome to file ...')
|
||||||
content = "{\n"
|
content = "{\n"
|
||||||
for pref in preferences["preferencesChrome"]:
|
for pref in preferences["preferencesChrome"]:
|
||||||
self.logger.debug(pref)
|
self.logger.debug(pref)
|
||||||
line = ""
|
line = ""
|
||||||
if pref["value"] == "false" or pref["value"] == "true":
|
if pref["value"] == "false" or pref["value"] == "true":
|
||||||
line = " "+pref["preferenceName"]+': '+ str(pref["value"])+',\n'
|
line = '"'+pref["preferenceName"]+'":' + str(pref["value"])+',\n'
|
||||||
elif type(pref["value"]).__name__ == "int":
|
elif type(pref["value"]).__name__ == "int":
|
||||||
line = " "+pref["preferenceName"]+': '+ str(pref["value"])+',\n'
|
line = '"'+pref["preferenceName"]+'":' + str(pref["value"])+',\n'
|
||||||
else:
|
else:
|
||||||
line = " "+pref["preferenceName"]+': "'+ str(pref["value"])+'",\n'
|
line = '"'+pref["preferenceName"]+'":' + str(pref["value"])+'",\n'
|
||||||
content += line
|
content += line
|
||||||
|
|
||||||
content += "\n}"
|
content += "\n}"
|
||||||
|
@ -97,9 +95,6 @@ class BrowserChrome(AbstractPlugin):
|
||||||
content = " "
|
content = " "
|
||||||
if len(proxy_preferences) > 0:
|
if len(proxy_preferences) > 0:
|
||||||
for proxy in proxy_preferences["proxyListChrome"]:
|
for proxy in proxy_preferences["proxyListChrome"]:
|
||||||
self.logger.debug(type(proxy))
|
|
||||||
self.logger.debug(str(proxy))
|
|
||||||
|
|
||||||
line = ""
|
line = ""
|
||||||
line += str(proxy["preferenceName"])
|
line += str(proxy["preferenceName"])
|
||||||
content += line
|
content += line
|
||||||
|
|
Loading…
Reference in a new issue