Giter Club home page Giter Club logo

Comments (7)

glitchassassin avatar glitchassassin commented on June 28, 2024 1

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.

maxdule avatar maxdule commented on June 28, 2024

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.

glitchassassin avatar glitchassassin commented on June 28, 2024

Good catch. Adding this to the next hotfix.

from lackey.

glitchassassin avatar glitchassassin commented on June 28, 2024

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.

glitchassassin avatar glitchassassin commented on June 28, 2024

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.

maxdule avatar maxdule commented on June 28, 2024

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.

glitchassassin avatar glitchassassin commented on June 28, 2024

Resolved with latest update.

from lackey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.