Skip to content

Commit

Permalink
Merge branch '0.3.5-fix-initialcommand-698'
Browse files Browse the repository at this point in the history
  • Loading branch information
pazz committed Apr 2, 2014
2 parents 04f7c24 + a8e9501 commit b054d0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions alot/init.py
Expand Up @@ -10,7 +10,6 @@
from alot.settings.errors import ConfigError
from alot.db.manager import DBManager
from alot.ui import UI
import alot.commands as commands
from alot.commands import *
from alot.commands import CommandParseError

Expand Down Expand Up @@ -174,17 +173,14 @@ def main():
query = ' '.join(args.subOptions.args)
cmdstring = 'search %s %s' % (args.subOptions.as_argparse_opts(),
query)
cmd = commands.commandfactory(cmdstring, 'global')
elif args.subCommand == 'compose':
cmdstring = 'compose %s' % args.subOptions.as_argparse_opts()
if args.subOptions.rest is not None:
cmdstring += ' ' + args.subOptions.rest
cmd = commands.commandfactory(cmdstring, 'global')
else:
default_commandline = settings.get('initial_command')
cmd = commands.commandfactory(default_commandline, 'global')
cmdstring = settings.get('initial_command')
except CommandParseError, e:
sys.exit(e)

# set up and start interface
UI(dbman, cmd)
UI(dbman, cmdstring)
8 changes: 4 additions & 4 deletions alot/ui.py
Expand Up @@ -24,11 +24,11 @@ class UI(object):
responsible for opening, closing and focussing buffers.
"""

def __init__(self, dbman, initialcmd):
def __init__(self, dbman, initialcmdline):
"""
:param dbman: :class:`~alot.db.DBManager`
:param initialcmd: commandline applied after setting up interface
:type initialcmd: str
:param initialcmdline: commandline applied after setting up interface
:type initialcmdline: str
:param colourmode: determines which theme to chose
:type colourmode: int in [1,16,256]
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ def __init__(self, dbman, initialcmd):
self.mainloop.screen.set_terminal_properties(colors=colourmode)

logging.debug('fire first command')
self.apply_command(initialcmd)
self.apply_commandline(initialcmdline)

# start urwids mainloop
self.mainloop.run()
Expand Down

0 comments on commit b054d0d

Please sign in to comment.