Merge pull request #14 from yasoob/patch-1
Makes sure data file closes smoothly using with.
This commit is contained in:
commit
61451d4c3c
|
@ -72,8 +72,8 @@ class HackerNewsApp:
|
||||||
l=list(self.db)
|
l=list(self.db)
|
||||||
home = expanduser("~")
|
home = expanduser("~")
|
||||||
#truncate the file
|
#truncate the file
|
||||||
file = open(home+'/.hackertray.json', 'w+')
|
with open(home+'/.hackertray.json', 'w+') as file:
|
||||||
file.write(json.dumps(l))
|
file.write(json.dumps(l))
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in New Issue