Changeset 17 for trunk/amazonbot


Ignore:
Timestamp:
08/10/06 18:10:40 (18 years ago)
Author:
atzm
Message:

debug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/amazonbot/amazonbot.py

    r16 r17  
    116116 
    117117                if __debug__: 
    118                         print >> sys.stderr, 'DEBUG> pubmsg incoming "%s", should be reply to %s' % (ununicoding(msg, 'euc-jp'), to) 
     118                        try: 
     119                                print >> sys.stderr, 'DEBUG> pubmsg incoming "%s", should be reply to %s' % (ununicoding(msg, 'euc-jp'), to) 
     120                        except: 
     121                                print >> sys.stderr, 'DEBUG> pubmsg incoming, but could not en/decode message. should be reply to %s' % to 
    119122 
    120123                if msg[0] == '!': 
    121                         words = shlex.split(ununicoding(msg, 'utf-8')[1:]) 
     124                        try: 
     125                                words = shlex.split(ununicoding(msg, 'utf-8')[1:]) 
     126                        except: 
     127                                return False 
    122128                        if not words: 
    123129                                return False 
Note: See TracChangeset for help on using the changeset viewer.