ui: add fetch/push/pull buttons and a spacer
[ugit.git] / ugit / ugitrc.py
blob932a96552ccef1df1cb1415d97260b5669569ca3
1 #!/usr/bin/env python
2 HAS_SIMPLEJSON = False
3 try:
4 import simplejson
5 HAS_SIMPLEJSON = True
6 except ImportError:
7 pass
9 import os
10 import user
11 from ugit.model import Model
13 class SettingsModel(Model):
15 def init(self):
16 self.create( bookmarks = [] )
17 if not HAS_SIMPLEJSON:
18 return
19 ugitrc = self.path()
20 if os.path.exists(ugitrc):
21 self.load(ugitrc)
23 def path(self):
24 return os.path.join(user.home, '.ugitrc')
26 def save_all_settings(self):
27 if not HAS_SIMPLEJSON:
28 return
29 self.save(self.path())