You are not logged in.

#1 2011-06-29 20:55:55

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 689

Getting Quickformat to work with Python2

There's a really good KDE USB and SD card formatting tool from Pardus Linux, but the problem is that Pardus hasn't made the jump to python3.
And the whole scripting that was done for Quickformat is coded in Python2 but refers to Python (which in Arch is Python3).

I'm not a programer nor someone who'd know a lot about scripting. But with a bit of a help by Quickformats dev I'd managed to get it to install. But I can't get it to go any further.
I know I could go and ask him, but I really want to bother him with every little problem I encounter. Especially because Quickformat wasn't written for Arch nor in Python3.

For those interested in Quickformat here you can get the source for it:

svn co https://svn.pardus.org.tr/uludag/trunk/kde/quickformat/

Well I figured that much that I have to change every #!/bin/python to #!/bin/python2. But the next problem is UI. I get this error:

Traceback (most recent call last):
  File "/usr/bin/quickformat", line 30, in <module>
    from quickformat.ui_quickformat import Ui_QuickFormat
ImportError: cannot import name Ui_QuickFormat

And here I get lost. I have no idea why it doesn't want to import quickformat.ui. I mean should it also be in the /usr/bin? Is it somewhere else? If it is where it should be?
I'd really be thankfull for a bit of help. Also once I'll "port" Quickformat to python2 I'll upload it to AUR, because it's one of the few things that are needed in KDE.


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#2 2011-06-30 11:54:26

lunar
Member
Registered: 2010-10-04
Posts: 95

Re: Getting Quickformat to work with Python2

Did you install Quickformat using the setup.py script?  If yes, what was the output of the script?

Last edited by lunar (2011-06-30 12:05:55)

Offline

#3 2011-06-30 13:28:55

kachelaqa
Member
Registered: 2010-09-26
Posts: 216

Re: Getting Quickformat to work with Python2

Primoz wrote:

Well I figured that much that I have to change every #!/bin/python to #!/bin/python2. But the next problem is UI. I get this error:

Traceback (most recent call last):
  File "/usr/bin/quickformat", line 30, in <module>
    from quickformat.ui_quickformat import Ui_QuickFormat
ImportError: cannot import name Ui_QuickFormat

And here I get lost. I have no idea why it doesn't want to import quickformat.ui. I mean should it also be in the /usr/bin? Is it somewhere else? If it is where it should be?

python cannot import "quickformat.ui" because it's not a python module. you need to run setup.py so that the python modules can be created from the *.ui files by the pykdeuic4 script.

you may face a problem here, though. pykdeuic4 is part of kdebindings-python, which depends on python2-pyqt. but the current version of kdebindings-python (4.6.3-1) is incompatible with the current version of python2-pyqt (4.8.4-1).

however, you can download an updated version of the pykdeuic4 script from here:

    https://projects.kde.org/projects/kde/k … kdeuic4.py

i had a go at building quickformat using that version of pykdeuic4, and was able to get it running.

(nb: quickformat also depends on the pyparted package: http://aur.archlinux.org/packages.php?ID=29525).

Offline

#4 2011-06-30 19:48:35

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 689

Re: Getting Quickformat to work with Python2

kachelaqa wrote:
Primoz wrote:

Well I figured that much that I have to change every #!/bin/python to #!/bin/python2. But the next problem is UI. I get this error:

Traceback (most recent call last):
  File "/usr/bin/quickformat", line 30, in <module>
    from quickformat.ui_quickformat import Ui_QuickFormat
ImportError: cannot import name Ui_QuickFormat

And here I get lost. I have no idea why it doesn't want to import quickformat.ui. I mean should it also be in the /usr/bin? Is it somewhere else? If it is where it should be?

python cannot import "quickformat.ui" because it's not a python module. you need to run setup.py so that the python modules can be created from the *.ui files by the pykdeuic4 script.

you may face a problem here, though. pykdeuic4 is part of kdebindings-python, which depends on python2-pyqt. but the current version of kdebindings-python (4.6.3-1) is incompatible with the current version of python2-pyqt (4.8.4-1).

however, you can download an updated version of the pykdeuic4 script from here:

    https://projects.kde.org/projects/kde/k … kdeuic4.py

i had a go at building quickformat using that version of pykdeuic4, and was able to get it running.

(nb: quickformat also depends on the pyparted package: http://aur.archlinux.org/packages.php?ID=29525).

Thanks!
Edit: I've forgot how you install things from source, now I've remebered. I'll post once everything will work.

Last edited by Primoz (2011-06-30 20:30:14)


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#5 2011-06-30 20:33:10

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 689

Re: Getting Quickformat to work with Python2

OK I finally installed it!
(I have no idea if and how should I upload this to AUR though. I mean the Pardus python code has to be changed from python to python2 and then repackage or something. But the easiest thing, which wouldn't work, would be just to connect to Pardus' svn server and install from there... But as I said that wouldn't work. I'll have to think. But given that installing this gavce me so many problems I might not be the right for maintaining this package...)


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

Board footer

Powered by FluxBB