import os, subprocess, sys from hglib import error try: from io import BytesIO except ImportError: from cStringIO import StringIO as BytesIO
if sys.version_info[0] > 2:
izip = zip
integertypes = (int,)
def b(s): """Encode the string as bytes.""" return s.encode('latin-1') else: from itertools import izip
integertypes = (long, int)
bytes = str # Defined in Python 2.6/2.7, but to the same value.
def b(s): """Encode the string as bytes.""" return s
def strtobytes(s): """Return the bytes of the string representation of an object.""" return str(s).encode('latin-1')
arg = arg.encode('latin-1').replace(b('_'), b('-')) if arg != b('-'): if len(arg) == 1:
arg = b('-') + arg else:
arg = b('--') + arg if isinstance(val, bool): if val:
cmd.append(arg) elif isinstance(val, list): for v in val:
cmd.append(arg)
cmd.append(_cmdval(v)) else:
cmd.append(arg)
cmd.append(_cmdval(val))
for a in args: if a isnotNone:
cmd.append(a)
return cmd
class reterrorhandler(object): """This class is meant to be used with rawcommand() error handler
argument. It remembers the return value the command returned if
it's one of allowed values, which is only 1 if none are given.
Otherwise it raises a CommandError.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.