#
# This sample python file may be used to check jpydbg 
# installation and configuration correctness
#

import sys,token,symbol
from os import *
import os.path
import mysubsample

#
# A sample List returning function
#
def buildList():
    "test documentation comment"
    print "this will return a sample constant list back"
    list=["dave" , "mark" , "ann" , "phil"]
    return list
    
#
# A sample multiplication function
#
#
def multiply( a , b  ):
    print "this shall add " , a , "times " , b
    cc = 0
    for i in range ( 0, long(a) ):
        cc = cc + long(b)
    return cc
#
# Unit testing startup
#
if __name__ == '__main__':
#   checking for provided parameters
    import sys
    args = sys.argv
    if len( args ) > 1 :
      ii = 0 
      for current in args:
        print "arg [" , ii , "]=" , str(args[ii])
        ii = ii + 1
    else:
      print "no argument provided"
# test KeyError correct capture on Dict
    myDict = { 'spam':2 , 'zozo':1 }
    try :
      print myDict['riri']
    except KeyError:
      print "we got it "
    print "testing multiply = " , multiply ("5","6")
    for ii in xrange(100):
      print "ii value is = " , ii 
    print "testing multiply = " , multiply (5,6)
#    print "testing multiply = " , multiply (5,6,7)
#   test uncaptured exception on next line
    print "testing buildlist = " , buildList() 
#    1+''
    print "strange : we should not be here"
    print mysubsample.testImporter("zozo")
    print " after mysubsample call"
