Is there such a demand:
Open the local SVN warehouse where the path, right-click swordsmen SVN interface, select the commit, then check ALL button, click OK to complete the submission
The code is as follows:
The import OS
The import time
The import pyautogui
# automatically check the SVN commit interface ALL options
Svnpath='D: \ \ SVN'
Def autocheckall (svnpath) :
Result=OS. System (' explorer. Exe/n + svnpath) # # # using explorer to open the SVN directory
Time. Sleep (1)
ScreenWidth, screenHeight=pyautogui. The size () # # # for current resolution
Pyautogui. MoveTo (screenWidth/2, screenHeight/2) # # # move the mouse to the screen middle
Pyautogui. RightClick () # # # the right mouse button click
Delay time. Sleep (1) # # # 1 s
CurDirPath=OS. The path. The dirname (__file__) + '\ \'
PosSVNcommit=pyautogui. LocateCenterOnScreen (curDirPath + 'PIC \ \ SVNcommitIcon PNG', grayscale=True)
# # # get commit icon
If posSVNcommit is None:
Print (" SVNCommit icon was not found ")
Return False
Pyautogui. MoveTo (posSVNcommit [0], posSVNcommit [1])
Pyautogui. LeftClick ()
Time. Sleep (1)
Autocheckall (svnpath)
Now the question is, can type SVN folder, can also click on the right, but just can't identify the Commit this button picture,
PosSVNcommit=pyautogui. LocateCenterOnScreen (curDirPath + 'PIC \ \ SVNcommitIcon PNG', grayscale=True)
This command has been return None
To ask what reason be?
Code if you have any questions?
Or what other implementation code?
Sincerely ask, only learning python and a half months
CodePudding user response:
Zha don't bosses see