← Back to team overview

sikuli-driver team mailing list archive

[Question #252004]: How to use function of one class in another class

 

New question #252004 on Sikuli:
https://answers.launchpad.net/sikuli/+question/252004

Here is my code snipet.Please help me out

*************************** 1 *********************************
import numberediting

class phonevalidation:
    def blank_number(self):
        wait(1)
        click("1405933572316.png")
        while not exists("1405933601065.png",0):
            wait(1)
        click("1405933623586.png")    


    def invalid_number(self,inv_no):         
        wait(2)
        type(inv_no)
        wait(2)
        phonevalidation.blank_number()                    #Calling blank_number function to skip repetative code 
        wait(1)
        while not exists("1405943769016.png",0):
           type(Key.BACKSPACE) 
        numberediting.edit_number()
        numberediting.popup_edit()
        
    def verify_number(self):
        wait(2)
        self.edit_number()                     #Calling edit_number function to skip repetative code
        click("1405935049991.png")
        numberediting.pencil_edit()
       
        















*********************** 2 *******************************
import phone validation

class numberediting:  
    def edit_number(self):
       # while not exists("1405931822646.png",0):
 #           type(Key.BACKSPACE)
        wait(2)
        type("9970086714")
        wait(4)
        click("1405934424937.png")
        while not exists("1405934506011.png",0):
            wait(1)
        
    
    def popup_edit(self):
        click("1405934637347.png")
       # while not exists("1405934838920.png",0):
            #type(Key.BACKSPACE)
        wait(4)
        type(Key.BACKSPACE*10)   
        wait(4)


    def pencil_edit(self):        
        while not exists("1405935313512.png",0):
            wait(1)        
        click("1405935321020.png")    
        phonevalidation.verify_number()               #Calling verify_number function to skip repetative code
        while not exists("1405951702970.png",0):   
            wait(1)        

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.