-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS implementation #10
Comments
@asweigart Could you please look at this PR? |
any update to add implementations in _pygetwindows_macos.py? |
Hi! If you need multi-platform support, maybe you can give a try to this: https://github.com/Kalmat/PyWinCtl. It's a fork from PyGetWindow module, to which I added macOS and Linux support. I tried to PR the result with no success, so I decided to create a separate module. Any comment, suggestion or contribution is welcome. |
Thank you for the information.
The project I'm working on requires the pyautogui, any tips to refactor
pyautogui with pywinctl?
…On Sun, May 15, 2022 at 12:50 PM alef ***@***.***> wrote:
Hi! If you need multi-platform support, maybe you can give a try to this:
https://github.com/Kalmat/PyWinCtl. It's a fork from PyGetWindow module,
to which I added macOS and Linux support. I tried to PR the result with no
success, so I decided to create a separate module. Any comment, suggestion
or contribution is welcome.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADBMVIDINTIVP6R6APAPTM3VKFIQBANCNFSM4HXIFJ6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean pyautogui requires pygetwindow module, right? If so, it should be very easy to port it, since pywinctl uses same methods and behaviors than pygetwindow (it adds new methods, but the common ones are exactly the same). This refactor should be done by its author, anyway. Can you make a "private" port? Yes. Clone pyautogui, replace all pygetwindow references in it by pywinctl, uninstall pygetwindow, and place the refactored src/pygetwindow folder in your src folder, so it will import your version instead of the "official" one, and will include that folder in your distributions. I can help you if you need to. |
Hi again! Taking a quick look to pyautogui code, I think (not sure) that it's not really using pygetwindow methods. I was able to find it only in init.py file. Besides, I did some quick tests on macOS and seem to run OK. Which error do you get? |
Thanks again. I was working another ‘urgent’ task all day. Will pork the
pyautogui and refactor it as you recommend.
…On Tue, May 17, 2022 at 12:58 PM Hong Shen ***@***.***> wrote:
Thank you so much for the advice. And I will let you know if I need your
help.
On Tue, May 17, 2022 at 12:02 AM alef ***@***.***> wrote:
> Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean pyautogui
> requires pygetwindow module, right? If so, it should be very easy to port
> it, since pywinctl uses same methods and behaviors than pygetwindow (it
> adds new methods, but the common ones are exactly the same). This refactor
> should be done by its author, anyway.
>
> Can you make a "private" port? Yes. Clone pyautogui, replace all
> pygetwindow references in it by pywinctl, uninstall pygetwindow, and place
> the refactored src/pygetwindow folder in your src folder, so it will import
> your version instead of the "official" one, and will include that folder in
> your distributions. I can help you if you need to.
>
> —
> Reply to this email directly, view it on GitHub
> <#10 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADBMVIG2ANTT7MAWLTYJN3TVKNAAJANCNFSM4HXIFJ6A>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
working the code refactor based on your recommendation. found another
module used in pyautogui, which is
https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py.
I appreciate if you take a look at it. Thanks.
…On Tue, May 17, 2022 at 7:07 PM Hong Shen ***@***.***> wrote:
Thanks again. I was working another ‘urgent’ task all day. Will pork the
pyautogui and refactor it as you recommend.
On Tue, May 17, 2022 at 12:58 PM Hong Shen ***@***.***> wrote:
> Thank you so much for the advice. And I will let you know if I need your
> help.
>
> On Tue, May 17, 2022 at 12:02 AM alef ***@***.***> wrote:
>
>> Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean pyautogui
>> requires pygetwindow module, right? If so, it should be very easy to port
>> it, since pywinctl uses same methods and behaviors than pygetwindow (it
>> adds new methods, but the common ones are exactly the same). This refactor
>> should be done by its author, anyway.
>>
>> Can you make a "private" port? Yes. Clone pyautogui, replace all
>> pygetwindow references in it by pywinctl, uninstall pygetwindow, and place
>> the refactored src/pygetwindow folder in your src folder, so it will import
>> your version instead of the "official" one, and will include that folder in
>> your distributions. I can help you if you need to.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#10 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ADBMVIG2ANTT7MAWLTYJN3TVKNAAJANCNFSM4HXIFJ6A>
>> .
>> You are receiving this because you commented.Message ID:
>> ***@***.***>
>>
>
|
guess, I need to upgrade the pillow to the latest version.
https://pillow.readthedocs.io/en/stable/installation.html#platform-support.
…On Fri, May 20, 2022 at 11:28 AM Hong Shen ***@***.***> wrote:
working the code refactor based on your recommendation. found another
module used in pyautogui, which is
https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py.
I appreciate if you take a look at it. Thanks.
On Tue, May 17, 2022 at 7:07 PM Hong Shen ***@***.***> wrote:
> Thanks again. I was working another ‘urgent’ task all day. Will pork the
> pyautogui and refactor it as you recommend.
>
>
> On Tue, May 17, 2022 at 12:58 PM Hong Shen ***@***.***> wrote:
>
>> Thank you so much for the advice. And I will let you know if I need your
>> help.
>>
>> On Tue, May 17, 2022 at 12:02 AM alef ***@***.***> wrote:
>>
>>> Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean
>>> pyautogui requires pygetwindow module, right? If so, it should be very easy
>>> to port it, since pywinctl uses same methods and behaviors than pygetwindow
>>> (it adds new methods, but the common ones are exactly the same). This
>>> refactor should be done by its author, anyway.
>>>
>>> Can you make a "private" port? Yes. Clone pyautogui, replace all
>>> pygetwindow references in it by pywinctl, uninstall pygetwindow, and place
>>> the refactored src/pygetwindow folder in your src folder, so it will import
>>> your version instead of the "official" one, and will include that folder in
>>> your distributions. I can help you if you need to.
>>>
>>> —
>>> Reply to this email directly, view it on GitHub
>>> <#10 (comment)>,
>>> or unsubscribe
>>> <https://github.com/notifications/unsubscribe-auth/ADBMVIG2ANTT7MAWLTYJN3TVKNAAJANCNFSM4HXIFJ6A>
>>> .
>>> You are receiving this because you commented.Message ID:
>>> ***@***.***>
>>>
>>
|
Hi! Which error do you get? Besides, these are the dependencies for pyscreeze module:
So, maybe your guess is right! Perhaps you can try to install pyautogui adding |
Hi there,
Thank you. I made the app running on my macbook pro with the your pywinctl.
no error so far. the project of pyscreeze has a single reference to
pygetwindow, but it is not a not used import. Since I have porked the
project, I upgraded it to the latest version of Pillow. Now I can actually
do some work to validate the project on macos.
Again, thanks for the help.
…-Hong
On Fri, May 20, 2022 at 2:44 PM alef ***@***.***> wrote:
Hi! Which error do you get?
Besides, these are the dependencies for pyscreeze module:
install_requires=['Pillow >= 8.3.2; python_version == "3.8"',
'Pillow >= 8.3.2; python_version == "3.7"',
'Pillow >= 8.3.2; python_version == "3.6"',
'Pillow <= 7.2.0, >= 3.2.0; python_version == "3.5"',
'Pillow <= 5.4.1, >= 2.5.0; python_version == "3.4"',
'Pillow <= 4.3.0, >= 2.0.0; python_version == "3.3"',
'Pillow <= 3.4.2, >= 2.0.0; python_version == "3.2"',
'Pillow >= 2.0.0; python_version == "2.7"',
],
So, maybe your guess is right!
Perhaps you can try to install pyautogui adding --force-reinstall option
to pip command. Unless you need to stick to a specific version, this option
will assure you are installing all required dependencies and versions.
Otherwise (I mean, if you need to stick to a given version), then you can
use a virtual environment (venv) for this specific setup.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADBMVIFJMWYUJCI4DKWL5FTVLABUDANCNFSM4HXIFJ6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
So good to hear that! Remember to help and share with others. Keep pushing, mate! |
Thank you so much for the advice. And I will let you know if I need your
help.
…On Tue, May 17, 2022 at 12:02 AM alef ***@***.***> wrote:
Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean pyautogui
requires pygetwindow module, right? If so, it should be very easy to port
it, since pywinctl uses same methods and behaviors than pygetwindow (it
adds new methods, but the common ones are exactly the same). This refactor
should be done by its author, anyway.
Can you make a "private" port? Yes. Clone pyautogui, replace all
pygetwindow references in it by pywinctl, uninstall pygetwindow, and place
the refactored src/pygetwindow folder in your src folder, so it will import
your version instead of the "official" one, and will include that folder in
your distributions. I can help you if you need to.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADBMVIG2ANTT7MAWLTYJN3TVKNAAJANCNFSM4HXIFJ6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I am struggling with PYAutoGUI's window features that do not work on macOS. iMac (Retina 5K, 27-inch, Late 2014), Screen Size: 2560 x 1440, resolution is set to standard for monitor What do I have to do to make it work? I have installed pygetwindow module separately, but gw.getAllWindows() does not work, for example (AttributeError: module 'pygetwindow' has no attribute 'getAllWindows'. |
Hi there, could you explain what's outstanding to implement for MacOS? Looking at the code quickly in _pygetwindow_macos.py it looks like some functions have been partially implemented.
Have done some work myself already using
pyobjc-framework-Quartz
so happy to try and port across if helpful?The text was updated successfully, but these errors were encountered: