6262
6363try :
6464 HOSTNAME = os .environ ['ANDROID_ADB_SERVER_HOST' ]
65- except :
65+ except KeyError :
6666 HOSTNAME = 'localhost'
6767
6868try :
@@ -861,15 +861,15 @@ def longTouch(self, x, y, duration=2000, orientation=-1):
861861 self .drag ((x , y ), (x , y ), duration , orientation )
862862
863863 def drag (self , (x0 , y0 ), (x1 , y1 ), duration , steps = 1 , orientation = - 1 ):
864- '''
864+ """
865865 Sends drag event in PX (actually it's using C{input swipe} command).
866866
867867 @param (x0, y0): starting point in PX
868868 @param (x1, y1): ending point in PX
869869 @param duration: duration of the event in ms
870- @param steps: number of steps (currently ignored by @ {input swipe})
870+ @param steps: number of steps (currently ignored by C {input swipe})
871871 @param orientation: the orientation (-1: undefined)
872- '''
872+ """
873873
874874 self .__checkTransport ()
875875 if orientation == - 1 :
@@ -886,14 +886,14 @@ def drag(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1):
886886 self .shell ('input touchscreen swipe %d %d %d %d %d' % (x0 , y0 , x1 , y1 , duration ))
887887
888888 def dragDip (self , (x0 , y0 ), (x1 , y1 ), duration , steps = 1 , orientation = - 1 ):
889- '''
889+ """
890890 Sends drag event in DIP (actually it's using C{input swipe} command.
891891
892892 @param (x0, y0): starting point in DIP
893893 @param (x1, y1): ending point in DIP
894894 @param duration: duration of the event in ms
895- @param steps: number of steps (currently ignored by @ {input swipe}
896- '''
895+ @param steps: number of steps (currently ignored by C {input swipe})
896+ """
897897
898898 self .__checkTransport ()
899899 if orientation == - 1 :
@@ -913,7 +913,7 @@ def type(self, text):
913913 else :
914914 encoded = str (text );
915915 #FIXME find out which characters can be dangerous,
916- # for exmaple not worst idea to escape "
916+ # for example not worst idea to escape "
917917 self .shell (u'input text "%s"' % encoded )
918918
919919 def wake (self ):
@@ -1000,15 +1000,15 @@ def sameAs(image1, image2, percent=1.0):
10001000
10011001 @staticmethod
10021002 def imageInScreen (screen , image ):
1003- '''
1003+ """
10041004 Checks if image is on the screen
10051005
1006- : param screen: the screen image
1007- : param image: the partial image to look for
1008- : return: True or False
1006+ @ param screen: the screen image
1007+ @ param image: the partial image to look for
1008+ @ return: True or False
10091009
10101010 @author: Perry Tsai <[email protected] > 1011- '''
1011+ """
10121012
10131013 # To make sure image smaller than screen.
10141014 size_x1 , size_y1 = screen .size
0 commit comments