~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
server/admin.c: Remove spurious `ping' in usage message.
[tripe]
/
py
/
tripe.py.in
diff --git
a/py/tripe.py.in
b/py/tripe.py.in
index
be24cc8
..
a9be668
100644
(file)
--- a/
py/tripe.py.in
+++ b/
py/tripe.py.in
@@
-109,7
+109,7
@@
import os as OS
try:
if OS.getenv('TRIPE_FORCE_RMCR') is not None:
try:
if OS.getenv('TRIPE_FORCE_RMCR') is not None:
- raise ImportError
+ raise ImportError
()
from py.magic import greenlet as _Coroutine
except ImportError:
from rmcr import Coroutine as _Coroutine
from py.magic import greenlet as _Coroutine
except ImportError:
from rmcr import Coroutine as _Coroutine
@@
-508,7
+508,7
@@
class TripeCommandIterator (object):
"""
me.dcr = Coroutine.getcurrent().parent
if me.dcr is None:
"""
me.dcr = Coroutine.getcurrent().parent
if me.dcr is None:
- raise ValueError
, 'must invoke from coroutine'
+ raise ValueError
('must invoke from coroutine')
me.filter = filter or (lambda x: x)
if bg:
words = [words[0], '-background', dispatcher.bgtag()] + list(words[1:])
me.filter = filter or (lambda x: x)
if bg:
words = [words[0], '-background', dispatcher.bgtag()] + list(words[1:])
@@
-532,17
+532,17
@@
class TripeCommandIterator (object):
if code == 'INFO':
return me.filter(rest)
elif code == 'OK':
if code == 'INFO':
return me.filter(rest)
elif code == 'OK':
- raise StopIteration
+ raise StopIteration
()
elif code == 'CONNERR':
if rest is None:
elif code == 'CONNERR':
if rest is None:
- raise TripeConnectionError
, 'connection terminated by user'
+ raise TripeConnectionError
('connection terminated by user')
else:
raise rest
elif code == 'FAIL':
raise TripeError(*rest)
else:
else:
raise rest
elif code == 'FAIL':
raise TripeError(*rest)
else:
- raise TripeInternalError
\
-
('unexpected tripe response %r' %
([code] + rest))
+ raise TripeInternalError
('unexpected tripe response %r' %
+
([code] + rest))
### Simple utility functions for the TripeCommandIterator convenience
### methods.
### Simple utility functions for the TripeCommandIterator convenience
### methods.
@@
-838,7
+838,8
@@
class TripeCommandDispatcher (TripeConnection):
*['ADD'] +
_kwopts(kw, ['tunnel', 'keepalive',
'key', 'priv', 'cork',
*['ADD'] +
_kwopts(kw, ['tunnel', 'keepalive',
'key', 'priv', 'cork',
- 'mobile']) +
+ 'mobile', 'knock',
+ 'ephemeral']) +
[peer] +
list(addr)))
def addr(me, peer):
[peer] +
list(addr)))
def addr(me, peer):
@@
-878,8
+879,10
@@
class TripeCommandDispatcher (TripeConnection):
*['PING'] +
_kwopts(kw, ['timeout']) +
[peer]))
*['PING'] +
_kwopts(kw, ['timeout']) +
[peer]))
- def port(me):
- return _oneline(me.command('PORT', filter = _tokenjoin))
+ def port(me, af = None):
+ return _oneline(me.command('PORT',
+ *((af is not None) and [af] or []),
+ filter = _tokenjoin))
def quit(me):
return _simple(me.command('QUIT'))
def reload(me):
def quit(me):
return _simple(me.command('QUIT'))
def reload(me):
@@
-1172,7
+1175,7
@@
class TripeServiceCommand (object):
"""
if (me.min is not None and len(args) < me.min) or \
(me.max is not None and len(args) > me.max):
"""
if (me.min is not None and len(args) < me.min) or \
(me.max is not None and len(args) > me.max):
- raise TripeSyntaxError
+ raise TripeSyntaxError
()
me.func(*args)
class TripeServiceJob (Coroutine):
me.func(*args)
class TripeServiceJob (Coroutine):
@@
-1383,12
+1386,12
@@
class OptParse (object):
if len(me.args) == 0 or \
len(me.args[0]) < 2 or \
not me.args[0].startswith('-'):
if len(me.args) == 0 or \
len(me.args[0]) < 2 or \
not me.args[0].startswith('-'):
- raise StopIteration
+ raise StopIteration
()
opt = me.args.pop(0)
if opt == '--':
opt = me.args.pop(0)
if opt == '--':
- raise StopIteration
+ raise StopIteration
()
if opt not in me.allowed:
if opt not in me.allowed:
- raise TripeSyntaxError
+ raise TripeSyntaxError
()
return opt
def arg(me):
return opt
def arg(me):
@@
-1398,7
+1401,7
@@
class OptParse (object):
If none is available, raise `TripeSyntaxError'.
"""
if len(me.args) == 0:
If none is available, raise `TripeSyntaxError'.
"""
if len(me.args) == 0:
- raise TripeSyntaxError
+ raise TripeSyntaxError
()
return me.args.pop(0)
def rest(me, min = None, max = None):
return me.args.pop(0)
def rest(me, min = None, max = None):
@@
-1410,7
+1413,7
@@
class OptParse (object):
"""
if (min is not None and len(me.args) < min) or \
(max is not None and len(me.args) > max):
"""
if (min is not None and len(me.args) < min) or \
(max is not None and len(me.args) > max):
- raise TripeSyntaxError
+ raise TripeSyntaxError
()
return me.args
###----- That's all, folks --------------------------------------------------
return me.args
###----- That's all, folks --------------------------------------------------