Esempio n. 1
0
class NetProtocol(Values):
    """
    Values for 'protocol' field.
    """
    UNSPEC = ValueConstant(0)
    STREAM = ValueConstant(1)
    DGRAM = ValueConstant(2)
Esempio n. 2
0
class NetFamily(Values):
    """
    Values for the 'family' field.
    """
    UNSPEC = ValueConstant(0x00)
    INET = ValueConstant(0x10)
    INET6 = ValueConstant(0x20)
    UNIX = ValueConstant(0x30)
class RESULT(Values):
    OK = ValueConstant(0)
    FAIL = ValueConstant(-1)

    @classmethod
    def get(cls, rc):
        if rc == 0:
            return cls.OK
        else:
            return cls.FAIL
Esempio n. 4
0
class ValuedLetters(Values):
    """
    Some more letters, with cooresponding unicode values.
    """
    # Note u'\u0391' < u'\u03dc' > u'\u0396'.  We are ensuring here that the
    # definition is order different from the order of the values, which lets us
    # test that we're not somehow ordering by value and happen the get the same
    # results.
    alpha = ValueConstant(u'\u0391')
    digamma = ValueConstant(u'\u03dc')
    zeta = ValueConstant(u'\u0396')
Esempio n. 5
0
class GPGSAFixTypes(Values):
    """
    The possible fix types of a GPGSA sentence.

    @cvar GSA_NO_FIX: The sentence reports no fix at all.
    @cvar GSA_2D_FIX: The sentence reports a 2D fix: position but no altitude.
    @cvar GSA_3D_FIX: The sentence reports a 3D fix: position with altitude.
    """
    GSA_NO_FIX = ValueConstant("1")
    GSA_2D_FIX = ValueConstant("2")
    GSA_3D_FIX = ValueConstant("3")
Esempio n. 6
0
class GPGLLGPRMCFixQualities(Values):
    """
    The possible fix quality indications in GPGLL and GPRMC sentences.

    Unfortunately, these sentences only indicate whether data is good or void.
    They provide no other information, such as what went wrong if the data is
    void, or how good the data is if the data is not void.

    @cvar ACTIVE: The data is okay.
    @cvar VOID: The data is void, and should not be used.
    """
    ACTIVE = ValueConstant("A")
    VOID = ValueConstant("V")
Esempio n. 7
0
class ExitStatus(Values):
    """
    Standard exit status codes for system programs.

    @cvar EX_OK: Successful termination.
    @type EX_OK: L{ValueConstant}

    @cvar EX_USAGE: Command line usage error.
    @type EX_USAGE: L{ValueConstant}

    @cvar EX_DATAERR: Data format error.
    @type EX_DATAERR: L{ValueConstant}

    @cvar EX_NOINPUT: Cannot open input.
    @type EX_NOINPUT: L{ValueConstant}

    @cvar EX_NOUSER: Addressee unknown.
    @type EX_NOUSER: L{ValueConstant}

    @cvar EX_NOHOST: Host name unknown.
    @type EX_NOHOST: L{ValueConstant}

    @cvar EX_UNAVAILABLE: Service unavailable.
    @type EX_UNAVAILABLE: L{ValueConstant}

    @cvar EX_SOFTWARE: Internal software error.
    @type EX_SOFTWARE: L{ValueConstant}

    @cvar EX_OSERR: System error (e.g., can't fork).
    @type EX_OSERR: L{ValueConstant}

    @cvar EX_OSFILE: Critical OS file missing.
    @type EX_OSFILE: L{ValueConstant}

    @cvar EX_CANTCREAT: Can't create (user) output file.
    @type EX_CANTCREAT: L{ValueConstant}

    @cvar EX_IOERR: Input/output error.
    @type EX_IOERR: L{ValueConstant}

    @cvar EX_TEMPFAIL: Temporary failure; the user is invited to retry.
    @type EX_TEMPFAIL: L{ValueConstant}

    @cvar EX_PROTOCOL: Remote error in protocol.
    @type EX_PROTOCOL: L{ValueConstant}

    @cvar EX_NOPERM: Permission denied.
    @type EX_NOPERM: L{ValueConstant}

    @cvar EX_CONFIG: Configuration error.
    @type EX_CONFIG: L{ValueConstant}
    """

    EX_OK = ValueConstant(Status.EX_OK)
    EX_USAGE = ValueConstant(Status.EX_USAGE)
    EX_DATAERR = ValueConstant(Status.EX_DATAERR)
    EX_NOINPUT = ValueConstant(Status.EX_NOINPUT)
    EX_NOUSER = ValueConstant(Status.EX_NOUSER)
    EX_NOHOST = ValueConstant(Status.EX_NOHOST)
    EX_UNAVAILABLE = ValueConstant(Status.EX_UNAVAILABLE)
    EX_SOFTWARE = ValueConstant(Status.EX_SOFTWARE)
    EX_OSERR = ValueConstant(Status.EX_OSERR)
    EX_OSFILE = ValueConstant(Status.EX_OSFILE)
    EX_CANTCREAT = ValueConstant(Status.EX_CANTCREAT)
    EX_IOERR = ValueConstant(Status.EX_IOERR)
    EX_TEMPFAIL = ValueConstant(Status.EX_TEMPFAIL)
    EX_PROTOCOL = ValueConstant(Status.EX_PROTOCOL)
    EX_NOPERM = ValueConstant(Status.EX_NOPERM)
    EX_CONFIG = ValueConstant(Status.EX_CONFIG)
Esempio n. 8
0
 class TRANSPORT_MESSAGE(Values):
     """
     Message types supported by an SSH transport.
     """
     KEX_DH_GEX_REQUEST_OLD = ValueConstant(30)
     KEXDH_INIT = ValueConstant(30)
Esempio n. 9
0
 class STATUS(Values):
     OK = ValueConstant("200")
     NOT_FOUND = ValueConstant("404")
Esempio n. 10
0
class OutputPipeType(Values):
    stdout = ValueConstant(sys.__stdout__)
    stderr = ValueConstant(sys.__stderr__)