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 = pfx = arg.encode('latin-1').replace(b('_'), b('-'))
short = (len(arg) == 1) if arg != b('-'): if short:
arg = pfx = b('-') + arg else:
arg = b('--') + arg
pfx = arg + b('=') if isinstance(val, bool): if val:
cmd.append(arg) elif isinstance(val, list): for v in val:
s = _cmdval(v) if s ornot short:
cmd.append(pfx + s) else:
cmd.extend([arg, s]) else:
s = _cmdval(val) if s ornot short:
cmd.append(pfx + s) else:
cmd.extend([arg, s])
args = [a for a in args if a isnotNone] if args:
cmd.append(b('--')) for a in args:
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 und die Messung sind noch experimentell.