Skip to content

Commit

Permalink
Prefs: Store binary preference values as boolean
Browse files Browse the repository at this point in the history
 #ignore
  • Loading branch information
sanssecours committed Sep 10, 2017
1 parent c934b38 commit 940bed5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Support/lib/Python/tmprefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def __init__(self):
CFPreferencesAppSynchronize(tm_identifier)

self.default_values = {
'latexAutoView': 1,
'latexAutoView': True,
'latexEngine': "pdflatex",
'latexEngineOptions': "",
'latexVerbose': 0,
'latexUselatexmk': 1,
'latexVerbose': False,
'latexUselatexmk': True,
'latexViewer': "TextMate",
'latexKeepLogWin': 1,
'latexDebug': 0,
'latexKeepLogWin': True,
'latexDebug': False,
}
self.prefs = self.default_values.copy()

Expand Down Expand Up @@ -91,11 +91,13 @@ def defaults(self):
latexViewer = TextMate; }
"""
plist = {preference: int(value) if isinstance(value, bool) else value
for preference, value in self.default_values.items()}
preference_items = [
'{} = {};'.format(preference,
self.default_values[preference] if
str(self.default_values[preference]) else '""')
for preference in sorted(self.default_values)]
plist[preference] if
str(plist[preference]) else '""')
for preference in sorted(plist)]
return '{{ {} }}'.format(' '.join(preference_items))


Expand Down

0 comments on commit 940bed5

Please sign in to comment.