Commit 9bcf25eda8cc3d8a86e6b1cce6109ab595b5a692
- Diff rendering mode:
- inline
- side by side
TODO
(4 / 1)
|   | |||
| 1 | 1 | NFO Viewer 3000 | |
| 2 | 2 | =============== | |
| 3 | 3 | ||
| 4 | * Bump GTK+ dependency to 2.16 | ||
| 4 | * Bump PyGTK dependency to 2.16 | ||
| 5 | 5 | - Use attributes instead of markup in preferences-dialog.ui | |
| 6 | * Bump PyGobject dependency to 2.14 | ||
| 7 | - gobject.set_application_name(_("NFO Viewer")) | ||
| 8 | - gobject.set_prgname("nfoview") | ||
| 6 | 9 | * Get link and visited link colors from GTK+ theme | |
| 7 | 10 | * Make hyperlinks activatable by keyboard |
nfoview/config.py
(3 / 3)
|   | |||
| 75 | 75 | self.restore_defaults() | |
| 76 | 76 | ||
| 77 | 77 | def read_from_file(self): | |
| 78 | """Read values of configuration fields from file.""" | ||
| 78 | """Read values of configuration options from file.""" | ||
| 79 | 79 | if not os.path.isfile(self.path): return | |
| 80 | 80 | entries = open(self.path, "r").readlines() | |
| 81 | 81 | entries = map(lambda x: x.strip(), entries) | |
| … | … | ||
| 87 | 87 | self.version = nfoview.__version__ | |
| 88 | 88 | ||
| 89 | 89 | def restore_defaults(self): | |
| 90 | """Set all configuration fields to their default values.""" | ||
| 90 | """Set all configuration options to their default values.""" | ||
| 91 | 91 | for name in self._fields: | |
| 92 | 92 | setattr(self, name, self._fields[name][self.DEFAULT]) | |
| 93 | 93 | self.version = nfoview.__version__ | |
| 94 | 94 | ||
| 95 | 95 | def write_to_file(self): | |
| 96 | """Write values of configuration fields to file.""" | ||
| 96 | """Write values of configuration options to file.""" | ||
| 97 | 97 | directory = os.path.dirname(self.path) | |
| 98 | 98 | if not os.path.isdir(directory): | |
| 99 | 99 | try: os.makedirs(directory) |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

