comparison hglib/util.py @ 134:1b47146a4a2c 1.4

style: fix long lines
author Matt Mackall <mpm@selenic.com>
date Tue, 30 Sep 2014 12:48:04 -0500
parents f98d6e234cd9
children ea80bd2775f6
comparison
equal deleted inserted replaced
133:b6f601ba7f3c 134:1b47146a4a2c
101 cmd.append(a) 101 cmd.append(a)
102 102
103 return cmd 103 return cmd
104 104
105 class reterrorhandler(object): 105 class reterrorhandler(object):
106 """ 106 """This class is meant to be used with rawcommand() error handler
107 This class is meant to be used with rawcommand() error handler argument. 107 argument. It remembers the return value the command returned if
108 It remembers the return value the command returned if it's one of allowed 108 it's one of allowed values, which is only 1 if none are given.
109 values, which is only 1 if none are given. Otherwise it raises a CommandError. 109 Otherwise it raises a CommandError.
110 110
111 >>> e = reterrorhandler('') 111 >>> e = reterrorhandler('')
112 >>> bool(e) 112 >>> bool(e)
113 True 113 True
114 >>> e(1, 'a', '') 114 >>> e(1, 'a', '')
115 'a' 115 'a'
116 >>> bool(e) 116 >>> bool(e)
117 False 117 False
118
118 """ 119 """
119 def __init__(self, args, allowed=None): 120 def __init__(self, args, allowed=None):
120 self.args = args 121 self.args = args
121 self.ret = 0 122 self.ret = 0
122 if allowed is None: 123 if allowed is None: