ham-radio-software / D-Rats

D-Rats program for D-Star Ham Radios
https://iz2lxi.jimdofree.com/
Other
41 stars 12 forks source link

Fix the send image resize dialog #270

Closed wb8tyw closed 9 months ago

wb8tyw commented 9 months ago

The GTK project removed support for older code.

changes/265.bugfix: Description of this fix.

d_rats/image.py: Use currently documented GTK api.

flyingfrawg commented 9 months ago

Did not have a partner and tried to upload jpg image to WX4QZ. Could not find the log itself, but the error panel had the following erro information:

Traceback (most recent call last):

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/ui/main_files.py", line 400, in _upload file_name = image.send_image(file_name)

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 175, in send_image dialog = build_image_dialog(filename, img, dialog_parent)

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 122, in build_image_dialog quality = Gtk.HScale(Gtk.Adjustment.new(50, 1, 100, 10, 10, 0))

TypeError: GObject.init() takes exactly 0 arguments (1 given)

Sorry not more help.

Jack KD4IZ - (flyingfrawg)

maurizioandreotti commented 9 months ago

Welcome back! which system are you using?

maybe this can be of help: https://github.com/ham-radio-software/D-Rats/wiki/010.010-Installation-of-D-Rats-on-Microsoft-Windows

as a matter of speed and simplicity If i am not on a PC where i want to be logged into github (e.g. a PC where i just want to use d-Rats but not "developing" , I usually clone locally the code from the github master branch and then execute it in this way:

git clone https://github.com/ham-radio-software/D-Rats.git D-Rats-4

cd D-Rats-4 ./build_pot.sh (this builds the .pot files for the interface translations) ./d-rats.py

If I am logged Iand i need to test a PR I prefer to have the PR number into the name of the folder so, I do the same but in this other way

git clone https://github.com/ham-radio-software/D-Rats.git D-Rats-4-PR-270

cd D-Rats-4-PR270

gh pr checkout 270

./build_pot.sh

./d-rats.py

then, every time that there is an update of the same PR I can execute

gh pr checkout 270

to have the code updated. then when the PR is done, I just delete the folder with

rm -Rf D-Rats-4-PR270

Hope this helps., maurizio

Il giorno gio 26 ott 2023 alle ore 20:26 flyingfrawg < @.***> ha scritto:

John, Maurizio,

Back in saddle after an absence. I did attempt a git pull and have run into a snag… probably took bad notes on my part and am doing an update wrong:

git pull

Updating 97ebb43..4406b3d

error: The following untracked working tree files would be overwritten by merge:

locale/base.pot

Please move or remove them before you merge.

Aborting

Looks like I should rename or move locale/base.pot and try again, but do not want to trash and start over with a new install if not required. Am I on target or is there a quick fix?

-Jack – KD4IZ (flyingfrawg)

From: John E. Malmberg @.> Sent: Thursday, October 26, 2023 09:29 To: ham-radio-software/D-Rats @.> Cc: Subscribed @.***> Subject: [ham-radio-software/D-Rats] Fix the send image resize dialog (PR

270)

The GTK project removed support for older code.

changes/265.bugfix: Description of this fix.

d_rats/image.py: Use currently documented GTK api.


You can view, comment on, or merge this pull request online at:

https://github.com/ham-radio-software/D-Rats/pull/270

Commit Summary

File Changes

(2 https://github.com/ham-radio-software/D-Rats/pull/270/files files)

Patch Links:

— Reply to this email directly, view it on GitHub < https://github.com/ham-radio-software/D-Rats/pull/270> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIOGDGNT3OBAOQXIDRMJVFLYBJQTHAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DGNJYGA3TCMI> . You are receiving this because you are subscribed to this thread. < https://github.com/notifications/beacon/AIOGDGLQ6CTG4LVZRILSVITYBJQTHA5CNFSM6AAAAAA6RG7T22WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHKCO5E4.gif> Message ID: @. @.> >

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1781630976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2W7OUJQZJHWAUC2BJ7GOTYBKTNPAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGYZTAOJXGY . You are receiving this because your review was requested.Message ID: @.***>

wb8tyw commented 9 months ago

With the working directory set to the git checkout directory:

python -m d_rats.image images/d-rats2.png

The unit test can be used to test the change with out actually having to send the file.

flyingfrawg commented 9 months ago

If I did the update properly I “should” be using the latest 0.4+ code. Hope that I did not mis-understand your instructions. Here is the outcome:

@.*** MINGW64 ~/D-Rats

$ python -m d_rats.image images/d-rats2.png

Traceback (most recent call last):

File "C:/msys64/mingw64/lib/python3.10/runpy.py", line 196, in _run_module_as_main

return _run_code(code, main_globals, None,

File "C:/msys64/mingw64/lib/python3.10/runpy.py", line 86, in _run_code

exec(code, run_globals)

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 214, in

main()

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 205, in main

temp_file = send_image(sys.argv[1])

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 175, in send_image

dialog = build_image_dialog(filename, img, dialog_parent)

File "C:/msys64\home\jspitznagel\D-Rats/d_rats/image.py", line 122, in build_image_dialog

quality = Gtk.HScale(Gtk.Adjustment.new(50, 1, 100, 10, 10, 0))

TypeError: GObject.init() takes exactly 0 arguments (1 given)

Hope it makes sense.

Thanks,

Jack Spitznagel – KD4IZ

Science River LLC

Biomedical Consulting Services

From: John E. Malmberg @.> Sent: Thursday, October 26, 2023 18:57 To: ham-radio-software/D-Rats @.> Cc: flyingfrawg @.>; Review requested @.> Subject: Re: [ham-radio-software/D-Rats] Fix the send image resize dialog (PR #270)

With the working directory set to the git checkout directory:

python -m d_rats.image images/d-rats2.png

The unit test can be used to test the change with out actually having to send the file.

— Reply to this email directly, https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1782013006 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AIOGDGNBNJLP7HJAJ2EYBGDYBLTDLAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGAYTGMBQGY unsubscribe. You are receiving this because your review was requested. https://github.com/notifications/beacon/AIOGDGMDH3CPCHELFJOSM5TYBLTDLA5CNFSM6AAAAAA6RG7T22WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTKG5OE4.gif Message ID: < @.> @.>

flyingfrawg commented 9 months ago

Hi Maurizio,

Thanks. I am not quite sure howyour examples makesa difference from the git pull command I was using to update. Your approach is more complex and appears to be aimed at coders who are actively submitting change requests.

i am not submitting altered code and I my sole function here is to download changes and test them by trying to use the revised features of versions 0.4 + PR’s in “the real world”. I am sorry to have to plead “luser” status with the system here, but that is just the way I am struggling with it. PEBCAK?

Jack Spitznagel – KD4IZ

Science River LLC

Biomedical Consulting Services

From: MAURIZIO ANDREOTTI @.> Sent: Thursday, October 26, 2023 16:58 To: ham-radio-software/D-Rats @.> Cc: flyingfrawg @.>; Review requested @.> Subject: Re: [ham-radio-software/D-Rats] Fix the send image resize dialog (PR #270)

Welcome back! which system are you using?

maybe this can be of help: https://github.com/ham-radio-software/D-Rats/wiki/010.010-Installation-of-D-Rats-on-Microsoft-Windows

as a matter of speed and simplicity If i am not on a PC where i want to be logged into github (e.g. a PC where i just want to use d-Rats but not "developing" , I usually clone locally the code from the github master branch and then execute it in this way:

git clone https://github.com/ham-radio-software/D-Rats.git D-Rats-4

cd D-Rats-4 ./build_pot.sh (this builds the .pot files for the interface translations) ./d-rats.py

If I am logged Iand i need to test a PR I prefer to have the PR number into the name of the folder so, I do the same but in this other way

git clone https://github.com/ham-radio-software/D-Rats.git D-Rats-4-PR-270

cd D-Rats-4-PR270

gh pr checkout 270

./build_pot.sh

./d-rats.py

then, every time that there is an update of the same PR I can execute

gh pr checkout 270

to have the code updated. then when the PR is done, I just delete the folder with

rm -Rf D-Rats-4-PR270

Hope this helps., maurizio

Il giorno gio 26 ott 2023 alle ore 20:26 flyingfrawg < @. <mailto:@.> > ha scritto:

John, Maurizio,

Back in saddle after an absence. I did attempt a git pull and have run into a snag… probably took bad notes on my part and am doing an update wrong:

git pull

Updating 97ebb43..4406b3d

error: The following untracked working tree files would be overwritten by merge:

locale/base.pot

Please move or remove them before you merge.

Aborting

Looks like I should rename or move locale/base.pot and try again, but do not want to trash and start over with a new install if not required. Am I on target or is there a quick fix?

-Jack – KD4IZ (flyingfrawg)

From: John E. Malmberg @. <mailto:@.> > Sent: Thursday, October 26, 2023 09:29 To: ham-radio-software/D-Rats @. <mailto:@.> > Cc: Subscribed @. <mailto:@.> > Subject: [ham-radio-software/D-Rats] Fix the send image resize dialog (PR

270)

The GTK project removed support for older code.

changes/265.bugfix: Description of this fix.

d_rats/image.py: Use currently documented GTK api.


You can view, comment on, or merge this pull request online at:

https://github.com/ham-radio-software/D-Rats/pull/270

Commit Summary

File Changes

(2 https://github.com/ham-radio-software/D-Rats/pull/270/files files)

Patch Links:

— Reply to this email directly, view it on GitHub < https://github.com/ham-radio-software/D-Rats/pull/270> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIOGDGNT3OBAOQXIDRMJVFLYBJQTHAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DGNJYGA3TCMI> . You are receiving this because you are subscribed to this thread. < https://github.com/notifications/beacon/AIOGDGLQ6CTG4LVZRILSVITYBJQTHA5CNFSM6AAAAAA6RG7T22WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHKCO5E4.gif> Message ID: @. <mailto:@.> @. <mailto:@.> > >

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1781630976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2W7OUJQZJHWAUC2BJ7GOTYBKTNPAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGYZTAOJXGY . You are receiving this because your review was requested.Message ID: @. <mailto:@.> >

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1781884807 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOGDGLFUBWCLIWYSP5MF63YBLFFTAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRHA4DIOBQG4 . You are receiving this because your review was requested. https://github.com/notifications/beacon/AIOGDGORJKBPRM5U4CODV4DYBLFFTA5CNFSM6AAAAAA6RG7T22WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTKGVTYO.gif Message ID: @. @.> >

wb8tyw commented 9 months ago

You are testing on the master branch, not the branch that contains this patch. Maurizio is giving you instructions on how to change from the master branch to the branch with this pull request.

flyingfrawg commented 9 months ago

Thanks John,

I did not understand that point, I will try to figure it all out. Never tried to pretend I know much… 😊

Jack – KD4IZ

From: John E. Malmberg @.> Sent: Thursday, October 26, 2023 21:14 To: ham-radio-software/D-Rats @.> Cc: flyingfrawg @.>; Review requested @.> Subject: Re: [ham-radio-software/D-Rats] Fix the send image resize dialog (PR #270)

You are testing on the master branch, not the branch that contains this patch. Maurizio is giving you instructions on how to change from the master branch to the branch with this pull request.

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1782141816 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOGDGMQCEJHHF3N7U7AVVLYBMDGHAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGE2DCOBRGY . You are receiving this because your review was requested. https://github.com/notifications/beacon/AIOGDGNQJSJIA7QW372RWP3YBMDGHA5CNFSM6AAAAAA6RG7T22WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTKHFJXQ.gif Message ID: @. @.> >

ka5mye commented 9 months ago

John thanks for the python one-liner for testing.

On my M1 MBP, and working in the * wb8tyw_pillow branch. My test was successful:

(radio_m1_5) rwwmbp(1420)python -m d_rats.image images/d-rats2.png 10/26/2023 20:08:45:INFO:update_image:Saved to /var/folders/ln/39p4rbl10rdf5ng81nmmvm8w0000gn/T/resized_d-rats2.jpg

and the image appeared in a pop-up entitled Send Image that included a resize drop down option that worked.

Then upon hitting the close window button in the upper left of the window, the screen showed:

10/26/2023 20:17:45:INFO:image:send_image returned None!

It seems to have worked well.

73,

KA5MYE


Rodney Whitaker @.***

On Oct 26, 2023, at 4:56 PM, John E. Malmberg @.***> wrote:

With the working directory set to the git checkout directory:

python -m d_rats.image images/d-rats2.png

The unit test can be used to test the change with out actually having to send the file.

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/pull/270#issuecomment-1782013006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQ2LJIKJSOG52J2YFCJBC3YBLTDLAVCNFSM6AAAAAA6RG7T22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGAYTGMBQGY. You are receiving this because your review was requested.

wb8tyw commented 9 months ago

@flyingfrawg It works best to post updates to this review using a browser to the URL for the pull request in the message instead of replying to the e-mail that it sends. When you use a browser you will see a big difference on how to read what is doing on.

In order to test a pull request, you have to be running from a git checkout of the specific pull request.

You need git installed,steps which vary based on your operating system, and Maurizio, also has "gh" installed, which for Microsoft windows.

Those tools allow you to setup an environment for testing this pull request.

wb8tyw commented 9 months ago

@ka5mye if this is working for you can you set the approved flag?