Skip to content

Commit

Permalink
don't quote values that don't needed, means we can have stronger typi…
Browse files Browse the repository at this point in the history
…ng without effort when loading it back

git-svn-id: https://xpra.org/svn/Xpra/trunk@7914 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 8, 2014
1 parent 4105460 commit 92bf4bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/add_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ def save_properties(props, filename):
with open(filename, mode='w') as f:
for name,value in props.items():
s = str(value).replace("'", "\\'")
f.write("%s='%s'\n" % (name, s))
f.write(name)
f.write("=")
quote_it = type(value) not in (bool, tuple, int)
if quote_it:
f.write("'")
f.write(s)
if quote_it:
f.write("'")
f.write("\n")
print("updated %s with:" % filename)
for k in sorted(props.keys()):
print("* %s = %s" % (str(k).ljust(20), props[k]))
Expand Down

0 comments on commit 92bf4bd

Please sign in to comment.