예제 #1
0
class Data(juice.Command):
    """
    Sends some data for a transfer.
    """

    arguments = [('name', juice.String()), ('chunk', juice.Integer()),
                 (juice.BODY, juice.String())]
예제 #2
0
class AddUser(juice.Command):
    """
    Add a user to a domain.
    """
    commandName = "add_user"

    arguments = [("name", juice.String()), ("password", juice.String())]

    response = []

    errors = {NotAllowed: "NotAllowed"}
예제 #3
0
class Verify(juice.Command):
    """
    Verify that the checksum of the given chunk is correct.

    Errors:

      - chunk checksum incorrect
      - host hasn't computed checksum for that chunk yet.
    """

    arguments = [('name', juice.String()), ('peer', q2q.Q2QAddressArgument()),
                 ('chunk', juice.Integer()), ('sha1sum', juice.String())]
예제 #4
0
class TestSwitchProto(juice.ProtocolSwitchCommand):
    commandName = 'Switch-Proto'

    arguments = [
        ('name', juice.String()),
    ]
    errors = {UnknownProtocol: 'UNKNOWN'}
예제 #5
0
class CallItemMethod(juice.Command):
    """
    Invoke a particular method of a particular item.
    """
    commandName = 'Call-Item-Method'
    arguments = [('storepath', juice.Path()), ('storeid', juice.Integer()),
                 ('method', juice.String())]
예제 #6
0
class Get(juice.Command):
    """
    Tells the remote it should start sending me chunks of a file.
    """

    arguments = [("name", juice.String()),
                 ('mask', BitArrayArgument(optional=True))]

    response = [("size", juice.Integer())]  # number of octets!!
예제 #7
0
class Introduce(juice.Command):
    """
    Tells the remote end about another node which should have information about
    this transfer.

    Peer: the address of the peer
    Name: the name of the file given.
    """

    arguments = [('peer', q2q.Q2QAddressArgument()), ('name', juice.String())]
예제 #8
0
class PlayFile(juice.Command):
    commandName = "Play-File"
    arguments = [('cookie', juice.String()), ("filename", juice.String()),
                 ("format", juice.String(optional=True))]
    response = [("done", juice.Boolean())]
예제 #9
0
class Hello(juice.Command):
    commandName = 'hello'
    arguments = [('hello', juice.String())]
    response = [('hello', juice.String())]

    errors = {UnfriendlyGreeting: 'UNFRIENDLY'}
예제 #10
0
class DTMF(juice.Command):
    commandName = "DTMF"
    arguments = [('cookie', juice.String()), ("key", juice.Integer())]
예제 #11
0
class RTPStart(juice.Command):
    commandName = "Start"
    arguments = [('cookie', juice.String()), ("targethost", juice.String()),
                 ("targetport", juice.Integer())]
예제 #12
0
class RTPStop(juice.Command):
    commandName = "Stop"
    arguments = [('cookie', juice.String())]
예제 #13
0
class GetSDP(juice.Command):
    commandName = "Get-SDP"
    arguments = [('cookie', juice.String()), ("othersdp", juice.String())]
    response = [('sdp', juice.String())]
예제 #14
0
class CreateRTPSocket(juice.Command):
    commandName = "Create-RTPSocket"
    arguments = [("host", juice.String())]
    response = [('cookie', juice.String())]
예제 #15
0
class StopPlaying(juice.Command):
    commandName = "Stop-Playing"
    arguments = [('cookie', juice.String())]
예제 #16
0
class Put(juice.Command):
    """
    Tells the remote end it should request a file from me.
    """

    arguments = [("name", juice.String())]
예제 #17
0
class StopRecording(juice.Command):
    commandName = "Stop-Recording"
    arguments = [('cookie', juice.String())]
    response = []
예제 #18
0
class StartRecording(juice.Command):
    commandName = 'Start-Recording'
    arguments = [('cookie', juice.String()), ('filename', juice.String()),
                 ("format", juice.String())]