Skip to content
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

Fix paste exception type and use private clipboard in linux #184

Merged
merged 2 commits into from
Apr 17, 2020

Conversation

kbengs
Copy link
Member

@kbengs kbengs commented Apr 17, 2020

The clipboard data is only useful to pdfarranger, so I think it is best if it is not visible to other applications. We can also cause many errors by pasting to a text editor and manipulate the data, and paste that data back to pdfarranger. (#178 can also happen this way)

So this line:

self.clipboard = Gtk.Clipboard.get(Gdk.Atom.intern('_SELECTION_PDFARRANGER', False))

gives a "private" clipboard that can not be seen by other applications.
But unfortunately is does not work in windows. It doesn't throw any exceptions or anything, the clipboard just seems to be empty. So that's why windows does not use the same clipboard.

Could the reason be that some library or something is missing in the windows installation? Now when I have tested this in windows I have just replaced the pdfarranger.pyc with pdfarranger.py.

@lgtm-com
Copy link

lgtm-com bot commented Apr 17, 2020

This pull request fixes 2 alerts when merging 4b1167f into c48d7be - view on LGTM.com

fixed alerts:

  • 2 for Except block handles 'BaseException'

@jeromerobert jeromerobert merged commit 075bbc3 into pdfarranger:master Apr 17, 2020
@kbengs
Copy link
Member Author

kbengs commented Apr 18, 2020

@jeromerobert
I have built the msi installer on a Windows 7 virtual machine. (following the win32.md guide) Installation of msi seems to go fine. But when I try to start pdfarranger this message comes up:
Error when start
Do you know what I should do to solve it?
My intention was to test if the "private" clipboard could work in Windows when everything is rebuilt. My idea was that maybe the Windows installation is missing something so that it does not know what Gdk.Atom.intern means)

@jeromerobert
Copy link
Member

  • /mingw64/bin/python3 -m pip install --user pikepdf should have created c:/Users/Win7Pro/.local/lib/python3.8/site-packages/pikepdf/_qpdf-cpython-38.dll. Could you check that ?
  • Before trying to run the MSI installation you can also try to run /mingw64/bin/python3 - m pdfarranger from the MSYS2 command line
  • Do you have the same issue with the .zip ?
  • Do you have the same issue when running the MSI pdfarranger.exe file from the command line (and from its parent folder) ?
  • I'm a bit puzzled by the You may installed Microsoft Visual C++ 2015-2019 message. Mingw64 python3 and qpdf should not request that. May you have an official python installed (it's built with Visual C++) and it conflict with the one of Mingw64.

@kbengs
Copy link
Member Author

kbengs commented Apr 18, 2020

The pikepdf command did not create the dll because it already found some files there. So I renamed the site-packages to OLD and did a new try with pikepdf. That was successfull and installation worked after that. (I had already tried to build pdfarranger a few months ago and this probably had caused the problem)
Good to know about /mingw64/bin/python3 - m pdfarranger !
Thanks for help!

@kbengs kbengs deleted the kben/except branch May 24, 2020 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants