X-Git-Url: https://projects.mako.cc/source/mw/blobdiff_plain/a77592fd9d9bd47d07f6e72d5a4fe7fa95ad53b5..1d1aafa5f78d4db3df784026af179409e914e3d0:/src/mw/clicommands.py diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index f39cf8d..7931ac6 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -65,8 +65,8 @@ class CommandBase(object): 'lgtoken': result['login']['token']}) if result['login']['result'] == 'Success': print 'Login successful! (yay)' - else: - print 'Login failed: %s' % result['login']['result'] + else: + print 'Login failed: %s' % result['login']['result'] else: print 'Login failed: %s' % result['login']['result'] @@ -190,7 +190,7 @@ class CommitCommand(CommandBase): self.parser.add_option('-m', '--message', dest='edit_summary', help='don\'t prompt for edit summary and ' 'use this instead') - self.parser.add_option('--bot', dest='bot', action='store_true', + self.parser.add_option('-b', '--bot', dest='bot', action='store_true', help='mark actions as a bot (won\'t affect ' 'anything if you don\'t have the bot right', default=False) @@ -232,7 +232,7 @@ class CommitCommand(CommandBase): filename = os.path.join(self.metadir.root, file) text = codecs.open(filename, 'r', 'utf-8').read() text = text.encode('utf-8') - if text[-1] == '\n': + if (len(text) != 0) and (text[-1] == '\n'): text = text[:-1] md5 = hashlib.md5() md5.update(text)