Changeset 38:128b9ced9779 in xplra for misc/client.py


Ignore:
Timestamp:
02/14/13 16:02:05 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

Added basic support for showing a message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/client.py

    r10 r38  
    415415            print >> sys.stderr, "Invalid dataref at #%d" % (index,)
    416416        elif result!=0:
     417            print >> sys.stderr, "Error code:", result
     418
     419    def do_show_message(self, args):
     420        words = self._splitArgs(args)
     421        if len(words)<2:
     422            print >> sys.stderr, "Missing parameters"
     423            return False
     424
     425        message = words[0]
     426        duration = float(words[1])
     427
     428        self._writeU8(0x41)
     429        self._writeString(message)
     430        self._writeFloat(duration)
     431        self._flush()
     432
     433        result = self._readU8()
     434        if result!=0:
    417435            print >> sys.stderr, "Error code:", result
    418436
Note: See TracChangeset for help on using the changeset viewer.