This repo is not current. Development has moved from Hg to Git. For the latest code use the "Source Code" tab above to go to the "Thun" git repo or navigate to:
https://osdn.net/projects/joypy/scm/git/Thun
Révision | 1b4d236c34434b07c3bde841197dc59c45daa5f3 (tree) |
---|---|
l'heure | 2020-05-28 01:14:21 |
Auteur | Simon Forman <sforman@hush...> |
Commiter | Simon Forman |
Remove logging.
@@ -16,18 +16,20 @@ | ||
16 | 16 | ' right-click "sharing" for details.' |
17 | 17 | ' Right-click on these commands to see docs on UI commands: key_bindings mouse_bindings') |
18 | 18 | |
19 | -from __future__ import print_function | |
20 | -from future import standard_library | |
21 | -standard_library.install_aliases() | |
22 | 19 | import logging, os, pickle, sys |
23 | 20 | from datetime import datetime |
24 | 21 | from textwrap import dedent |
25 | 22 | from configparser import RawConfigParser |
26 | 23 | |
27 | 24 | from xerblin.gui.utils import init_home, argparser, FileFaker |
25 | +from xerblin.gui.textwidget import TextViewerWidget, tk, get_font | |
26 | +from xerblin.gui.world import StackWorld | |
27 | +from xerblin.gui.controllerlistbox import StackListbox | |
28 | +from joy.library import initialize, DefinitionWrapper | |
29 | +from joy.utils.stack import stack_to_string | |
28 | 30 | |
29 | 31 | |
30 | -DATETIME_FORMAT = "Thun • %B %d %a • %I:%M %p" | |
32 | +DATETIME_FORMAT = 'Thun • %B %d %a • %I:%M %p' | |
31 | 33 | VIEWER_DEFAULTS = dict(width=80, height=25) |
32 | 34 | |
33 | 35 |
@@ -36,24 +38,6 @@ | ||
36 | 38 | repo = init_home(JOY_HOME) |
37 | 39 | homed = lambda fn: os.path.join(JOY_HOME, fn) |
38 | 40 | |
39 | -# Set up logging before doing anything else. | |
40 | - | |
41 | -_log = logging.getLogger(__name__) | |
42 | -logging.basicConfig( | |
43 | - format='%(asctime)-15s %(levelname)s %(name)s %(message)s', | |
44 | - filename=os.path.join(JOY_HOME, 'thun.log'), | |
45 | - level=logging.INFO, | |
46 | - ) | |
47 | -_log.info('Starting with JOY_HOME=%s', JOY_HOME) | |
48 | - | |
49 | -# Now that logging is set up, continue loading the system. | |
50 | - | |
51 | -from xerblin.gui.textwidget import TextViewerWidget, tk, get_font | |
52 | -from xerblin.gui.world import StackWorld | |
53 | -from xerblin.gui.controllerlistbox import StackListbox | |
54 | -from joy.library import initialize, DefinitionWrapper | |
55 | -from joy.utils.stack import stack_to_string | |
56 | - | |
57 | 41 | |
58 | 42 | cp = RawConfigParser() |
59 | 43 | # Don't mess with uppercase. We need it for Tk event binding. |
@@ -17,12 +17,6 @@ | ||
17 | 17 | # You should have received a copy of the GNU General Public License |
18 | 18 | # along with joy.py. If not see <http://www.gnu.org/licenses/>. |
19 | 19 | # |
20 | -from __future__ import print_function | |
21 | -from builtins import object | |
22 | -from logging import getLogger | |
23 | - | |
24 | -_log = getLogger(__name__) | |
25 | - | |
26 | 20 | import os, pickle, sys |
27 | 21 | from inspect import getdoc |
28 | 22 |
@@ -37,7 +31,7 @@ | ||
37 | 31 | return # None indicating "I dunno." |
38 | 32 | |
39 | 33 | |
40 | -class World(object): | |
34 | +class World: | |
41 | 35 | |
42 | 36 | def __init__(self, stack=(), dictionary=None, text_widget=None): |
43 | 37 | self.stack = stack |
@@ -149,11 +143,10 @@ | ||
149 | 143 | f.flush() |
150 | 144 | os.fsync(f.fileno()) |
151 | 145 | self.repo.stage([self.relative_STACK_FN]) |
152 | - commit_id = self.repo.do_commit( | |
146 | + self.repo.do_commit( | |
153 | 147 | b'auto-save', |
154 | 148 | committer=b'thun-auto-save <nobody@example.com>', |
155 | 149 | ) |
156 | - _log.info('commit %s', commit_id) | |
157 | 150 | |
158 | 151 | def load_stack(self): |
159 | 152 | if os.path.exists(self.filename): |