Skip to content

Instantly share code, notes, and snippets.

@quite
Created August 30, 2012 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quite/3524031 to your computer and use it in GitHub Desktop.
Save quite/3524031 to your computer and use it in GitHub Desktop.
logging added
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index eadc76c..67398d5 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -256,6 +256,8 @@ class EditCommand(Command):
template = string_decode(f.read(), enc)
f.close()
+ logging.debug('openenvfromtmp')
+
# call post-edit translate hook
translate = settings.get_hook('post_edit_translate')
if translate:
@@ -264,9 +266,11 @@ class EditCommand(Command):
only_body=self.edit_only_body)
if self.openNew:
ui.buffer_open(buffers.EnvelopeBuffer(ui, self.envelope))
+ logging.debug('openenvfromtmp: opennew')
else:
ebuffer.envelope = self.envelope
ebuffer.rebuild()
+ logging.debug('openenvfromtmp: not opennew')
# decode header
headertext = u''
@@ -313,7 +317,9 @@ class EditCommand(Command):
cmd = globals.EditCommand(self.envelope.tmpfile.name,
on_success=openEnvelopeFromTmpfile, spawn=self.force_spawn,
thread=self.force_spawn, refocus=self.refocus)
+ logging.debug('editcmd: before ui.apply')
ui.apply_command(cmd)
+ logging.debug('editcmd: after ui.apply')
@registerCommand(MODE, 'set', arguments=[
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 9f2f022..8e1b415 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -745,4 +745,6 @@ class ComposeCommand(Command):
cmd = commands.envelope.EditCommand(envelope=self.envelope,
spawn=self.force_spawn, refocus=False)
+ logging.debug('composecmd.apply: before ui.apply')
ui.apply_command(cmd)
+ logging.debug('composecmd.apply: after ui.apply')
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index d8cf9fa..64c9c9d 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -265,3 +265,5 @@ class Envelope(object):
value += line
if key and value: # save last one if present
self.add(key, value)
+
+ logging.debug('parse_template done')
diff --git a/alot/ui.py b/alot/ui.py
index e84db7a..8c63f77 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -521,5 +521,8 @@ class UI(object):
# call cmd.apply
logging.info('apply command: %s' % cmd)
d = defer.maybeDeferred(cmd.apply, self)
+ logging.info('apply command and 2' % cmd)
d.addErrback(errorHandler)
+ logging.info('apply command and 3' % cmd)
d.addCallback(call_posthook)
+ logging.info('apply command and 4' % cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment