Show
Ignore:
Timestamp:
10/06/08 00:29:29 (16 years ago)
Author:
jerome
Message:

Removed trailing spaces.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykoticon/trunk/tests/test.py

    r176 r3439  
    11#! /usr/bin/env python 
    2 # -*- coding: ISO-8859-15 -*- 
     2# -*- coding: iso-8859-15 -*- 
    33 
    44# PyKotIcon - Client side helper for PyKota and other applications 
     
    1414# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515# GNU General Public License for more details. 
    16 #  
     16# 
    1717# You should have received a copy of the GNU General Public License 
    1818# along with this program; if not, write to the Free Software 
     
    4343    # Opens the connection to the PyKotIcon server : 
    4444    server = xmlrpclib.ServerProxy("http://%s:%s" % (arguments[0], arguments[1])) 
    45      
     45 
    4646    # Now display something on the PyKotIcon host : 
    4747    message1 = "You are about to test PyKotIcon\n\nPyKotIcon is really great software !" 
    4848    server.showDialog(xmlrpclib.Binary(message1.encode("UTF-8")), False) 
    49      
    50     # Now ask the end user if he really wants to do this :  
     49 
     50    # Now ask the end user if he really wants to do this : 
    5151    message2 = "Are you sure you want to do this ?" 
    5252    result = server.showDialog(xmlrpclib.Binary(message2.encode("UTF-8")), True) 
    5353    print "The remote user said : %s" % result 
    54      
     54 
    5555    # Displays the answer back : 
    5656    answer = "You have clicked on the %s button" % result 
    5757    server.showDialog(xmlrpclib.Binary(answer.encode("UTF-8")), False) 
    58      
    59     # Now we will ask some datas :  
     58 
     59    # Now we will ask some datas : 
    6060    result = server.askDatas([xmlrpclib.Binary(v) for v in ["Username", "Password", "Country"]], \ 
    6161                             ["username", "password", "country"], \ 
     
    6868        answer = "You answered :\n%s" % "\n".join(["%s => '%s'" % (k, v.data) for (k, v) in result.items() if k != "isValid"]) 
    6969        server.showDialog(xmlrpclib.Binary(answer.encode("UTF-8")), False) 
    70     else :     
     70    else : 
    7171        print "The answers are not valid." 
    72          
    73     # Now do nothing :     
     72 
     73    # Now do nothing : 
    7474    server.nop() 
    75          
     75 
    7676    # Finally we will cause PyKotIcon to die 
    7777    message3 = "As soon as you'll click on the button below, PyKotIcon will die." 
    7878    server.showDialog(xmlrpclib.Binary(message3.encode("UTF-8")), False) 
    7979    server.quitApplication() 
    80      
     80 
    8181    # That's all folks ! 
    8282    print 
    8383    print "This demo is finished. Did you like it ?" 
    84          
     84 
    8585if __name__ == "__main__" : 
    8686    if len(sys.argv) < 3 : 
    8787        sys.stderr.write("usage : %s pykoticon_hostname_or_ip_address pykoticon_TCPPort\n" % sys.argv[0]) 
    88     else :     
     88    else : 
    8989        try : 
    9090            main(sys.argv[1:]) 
    91         except socket.error, msg :     
     91        except socket.error, msg : 
    9292            sys.stderr.write("ERROR : Network error : %s\n" % msg) 
    9393            sys.stderr.write("Are you sure that PyKotIcon is running and accepts incoming connections ?\n") 
    94              
     94