Comments (7)
I've pushed a change to the develop
branch that sets BundlePath based on the main script's directory rather than the current working directory (which is what it had been).
I'm assuming your Jenkins workspace launches the script from some path, e.g. python C:\scripts\automator.py
. If so, this should now set the BundlePath to C:\scripts\
.
I'll continue testing with this to make sure it doesn't break anything, and if everything looks good it'll be rolled out with the next release.
from lackey.
I believe that the problem is in setting path when image is not located in current folder. Thus, modifying lines in RegionMatching.py (33-37) from:
# if not os.path.exists(path):
# raise OSError("File not found: {}".format(path))
# self.path = path
# self.similarity = 0.7
# self.offset = Location(0,0)
to check for every added image path:
no_path = True
for image_path in [Settings.BundlePath] + Settings.ImagePaths:
full_path = os.path.join(image_path, path)
if os.path.exists(full_path):
no_path = False
break
if no_path:
raise OSError("File not found: {}".format(path))
else:
self.path = full_path
self.similarity = 0.7
self.offset = Location(0,0)
makes code work.
from lackey.
Good catch. Adding this to the next hotfix.
from lackey.
The ImagePath issue is fixed in v0.4.2a1.
The App() functionality needs quite a bit of cleanup, it's very inconsistent. I'll work on this next.
from lackey.
I've made some updates to the App() class to standardize the way it interprets and attaches to processes. These are now in the develop ring and will be moved to master and released after testing.
It now tries to automatically separate the executable from the provided string, checks to see if it exists in the system path, and if so, stores the executable path and provided arguments to be called with app.open()
. If the string is prefixed with a +
(like App("+notepad.exe")
), it calls self.open()
to launch the command immediately.
If the executable does not exist in the system path, it assumes you meant to provide a window title instead.
There are a few edge cases where this could cause problems. You won't be able to select a window by title if the title is the path of an executable file (unless it has some other string in the title that you could target, like "Sublime Text"). However, it looks like this is the way Sikuli handles the operation.
from lackey.
I am still having an issue where scripts are run remotely using Jenkins - in this case images saved in the location of the script are not being located.
Settings.BundlePath stores jenkins workspace directory, rather than the location of the script itself (as I believe Sikuli does).
I've used workaround by adding image path in scripts locally (where necessary), but do you think that BundlePath setting is correct in this case?
Cheers!
from lackey.
Resolved with latest update.
from lackey.
Related Issues (20)
- Functions `findAny` and `find...List` are missing HOT 2
- Documentation not available (.io => .org) HOT 1
- Method waitVanish does not raise FindFailed exception after seconds timeout HOT 2
- Raspbian support HOT 1
- Option in type() to suppress logging of typed strings HOT 4
- Adjust the minimum of similarity HOT 2
- Is Lackey still active/supported? HOT 3
- How can I customize the size of the screen that needs to be monitored HOT 1
- Mouse method `move(xoff, yoff)` doesn't work as expected
- Typo in `Region.getCell` method
- Locks language switching while interactive mode on Windows
- lackey.type can not support chinese HOT 1
- Chinese path error
- Pillow 8.3.0 not working, use 8.2.0 instead
- How To Remove Unwanted Printing ? HOT 2
- opening app doesn't work
- Feature request: mask
- TypeError - grow()
- 0.74 not available via pip HOT 3
- Feature request: waitBest and findBest with multiple patterns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lackey.