You are not logged in.

#1 2010-08-28 23:09:34

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

pdi - Pacman database Informer 2.2

Hi guys , I'll throw this thing called Pacman database Informer in the wild , maybe someone will find it useful.
It's a pyqt gui for listing installed packages in various ways , per repo , searching for foreign and orphan packages. It can show the list of the files or the installation script of a selected packages.
What need for a gui, you'll say? because people use gui , I like to have a more comfortable reading from pacman outputs and above all I need some practice with python and pyqt.
deps:
- pacman , of course
- python2 and pyqt
- pacman-contrib

This is NOT a package manager , it won't hurt your databases , just perform some useful queries and listings.
Mandatory screenshot:

schermata22.th.png
schermata23.th.png

Uploaded with ImageShack.us

here it is http://www.deprecated.it/download/pdi-2.2.tar.gz
PKGBUILD:  http://www.deprecated.it/download/pdi.tar.gz

comments and suggestions are welcomed.
cheers

update: 2.2 release , fix a stupid bug in 'All' listing. Thanks to EnvoyRising for the patch, cheers

Last edited by mangus (2010-11-01 15:43:10)

Offline

#2 2010-08-28 23:46:19

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: pdi - Pacman database Informer 2.2

Some comments, observations:
- German locale characters (like öäü) don't get displayed correctly, they're messed up.
- I see some "paclist" in the def for the individual repos. Is that a script of yours or so? I can't find it in package names of AUR nor repos. So for me the individual repos show "0 packages". (Also, multilib is only 64bit afaik, and not everybody has testing on. Have you thought about parsing /etc/pacman.conf for a list of activated repos?)
- The tooltip for every interactive element is "Pacman database information manager", was that intended/too much effort to change?

That's it for now

Oh and upon closing i saw (besidees sh complaining about not finding paclist) this:

Traceback (most recent call last):
  File "./main.py", line 57, in listFiles
    a=self.main_form.listWidget.selectedItems()[0]
IndexError: list index out of range

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#3 2010-08-29 00:58:16

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

Ogion wrote:

Some comments, observations:
- German locale characters (like öäü) don't get displayed correctly, they're messed up.
- I see some "paclist" in the def for the individual repos. Is that a script of yours or so? I can't find it in package names of AUR nor repos. So for me the individual repos show "0 packages". (Also, multilib is only 64bit afaik, and not everybody has testing on. Have you thought about parsing /etc/pacman.conf for a list of activated repos?)
- The tooltip for every interactive element is "Pacman database information manager", was that intended/too much effort to change?

That's it for now

Oh and upon closing i saw (besidees sh complaining about not finding paclist) this:

Traceback (most recent call last):
  File "./main.py", line 57, in listFiles
    a=self.main_form.listWidget.selectedItems()[0]
IndexError: list index out of range

Ogion

Locales *should* be fixed now , you can find 'paclist'  in the  pacman-contrib package in community, listed as dep.
The old tooltip is fixed also. That error may show up when one of the repo is not activated or an item is not selected, but it's harmless , I'll fix it someday
thanks for the feedback

Last edited by mangus (2010-08-29 01:02:30)

Offline

#4 2010-08-29 07:57:18

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: pdi - Pacman database Informer 2.2

Indeed. Locale fixed, installed pacman-contrib and it worked fine then,
With the tooltip i meant that it is kinda weird to have a tooltip with the name of the program on every interactive element, but that's just aesthetics.

One last idea i'd have is have a Quit menu entry, instead of relying on the window manager to close it. (Which again is, i guess, a matter of personal preference).

I probably won't use it much, since i'm a commandline guy, but i think it's a nice idea nonetheless. (It might even inspire me to write something like that on my own, for learning puproses). wink

Happy Hacking
Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#5 2010-08-29 18:14:07

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

ver 1.1 up , fixed weird console error , added a refresh button
enjoy

Offline

#6 2010-08-30 03:36:55

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: pdi - Pacman database Informer 2.2

I might just make a PKGBUILD for this. I'll get back to you on that one. big_smile

EDIT:  This is actually my first attempt at making a PKGBUILD for a new application from complete scratch, bear with me here. I tested all of these commands and am sure that it will download the source. I'm just not sure how to check the PKGBUILD myself as I get "error: 'pkgname=pdi' could not find or read package' from yaourt. big_smile So, it's untested.

# PKGBUILD by KittyKatt (kittykatt@silverirc.com, http://www.kittykatt.tk)
# Maintainer: Manganelli Federico
pkgname=pdi
pkgver=1.1
pkgrel=1
pkgdesc="Pacman database Informer - GUI to perform Pacman queries quickly and easily."
arch=('i686' 'x86_64')
url="http://deprecated.it"
license=('unknown')
depends=('python' 'pyqt' 'pacman-contrib')
source=(http://www.deprecated.it/download/${pkgname}-${pkgver}.tar.gz)
md5sums=('e3bf5dd3ec74693b2c74879fa142f53c')

build() {
    cd "$srcdir/${pkgname}-${pkgver}"

    msg "Moving files"
    mv $srcdir $pkgdir/usr/share/pdi
    ln -s /usr/share/pdi/main.py $pkgdir/usr/bin/pdi
    msg2 "Done moving files"
}

Last edited by kittykatt (2010-08-30 04:39:06)


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#7 2010-09-18 18:10:19

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

bump for version 1.2 , some gui rework , improvements for usability
enjoy

Offline

#8 2010-09-23 21:53:25

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: pdi - Pacman database Informer 2.2

Made an AUR package for it.

http://aur.archlinux.org/packages.php?ID=41064

I'll gladly orphan it if you want me to so that you can adopt it. Otherwise, I'd be glad to maintain it. Just keep this thread up to date when you update a version and I can upload a new PKGBUILD. big_smile


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#9 2010-09-23 21:56:01

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

kittykatt wrote:

Made an AUR package for it.

http://aur.archlinux.org/packages.php?ID=41064

I'll gladly orphan it if you want me to so that you can adopt it. Otherwise, I'd be glad to maintain it. Just keep this thread up to date when you update a version and I can upload a new PKGBUILD. big_smile

Thank you for your work big_smile

Offline

#10 2010-09-23 22:38:19

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: pdi - Pacman database Informer 2.2

Glad to help. I've used this handy little application more than once since I first posted in the thread. big_smile


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#11 2010-09-25 19:14:18

VCoolio
Member
From: Netherlands
Registered: 2010-01-05
Posts: 120

Re: pdi - Pacman database Informer 2.2

When I run it, I get:

/bin/bash: \: No such file or directory

I guess this is because /usr/bin/pdi looks like:

#!/bin/bash \
python /usr/share/pdi/main.py

If I delete that \ however I get:

Traceback (most recent call last):
  File "/usr/share/pdi/main.py", line 2, in <module>
    python /usr/share/pdi/main.py
NameError: name 'python' is not defined

Does this ring a bell? The screenshot looks good, now to get it working...

Last edited by VCoolio (2010-09-25 19:17:15)

Offline

#12 2010-09-25 22:46:11

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

@ VCoolio:
there's an error in the PKGBUILD in AUR , it won't work...python scripts may be tricky if not launched from the working dir because of hardcoded path , anyway.. the simpliest way to run pdi is to download the tar.gz , unpack , and run ./main.py from there otherwise I manage to change some things and correct the pkgbuild , you can try this:

PKGBUILD

# PKGBUILD by KittyKatt (kittykatt@silverirc.com, [url]http://www.kittykatt.tk[/url])
# Maintainer: Manganelli Federico
pkgname=pdi
pkgver=1.3
pkgrel=1
pkgdesc="Pacman database Informer - GUI to perform Pacman queries quickly and easily."
arch=('i686' 'x86_64')
url="http://www.deprecated.it"
license=('unknown')
depends=('python' 'pyqt' 'pacman-contrib')
source=(http://www.deprecated.it/download/${pkgname}-${pkgver}.tar.gz)
md5sums=('57d05757bb55cb1fd9502a27b4f7928a')
install=('pdi.install')
build() {
    cd "$srcdir/${pkgname}-${pkgver}"

    install -d $pkgdir/usr/share
    install -d $pkgdir/usr/bin

    chmod a+x main.py

    cd $srcdir
    cp -r "${pkgname}-${pkgver}" $pkgdir/usr/share/pdi
    cp  ${pkgname}-${pkgver}/pdi $pkgdir/usr/bin/
}

pdi.install

post_install () {
    ln -s /usr/share/pdi/pixmaps/archlinux-icon-crystal-64.svg /usr/share/pixmaps
    chmod a+x /usr/bin/pdi
}

this should work either ways...

@KittyKatt
Can you please update the AUR pkgbuild and test if this works?

thanks to all

Offline

#13 2010-09-26 02:00:53

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: pdi - Pacman database Informer 2.2

Yeah, sorry for that error. I was stupid. Thanks for catching it. I'll update it and post here.


Uploaded and done. big_smile

Last edited by kittykatt (2010-09-26 02:07:17)


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#14 2010-09-26 08:31:52

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

Fast! thanks , now it should work ok, enjoy big_smile

Offline

#15 2010-09-26 13:24:40

VCoolio
Member
From: Netherlands
Registered: 2010-01-05
Posts: 120

Re: pdi - Pacman database Informer 2.2

mangus wrote:

Fast! thanks , now it should work ok, enjoy big_smile

Confirmed; thank you. It works faster and lighter than I dared to expect. Nice!

Offline

#16 2010-09-26 19:09:02

EnvoyRising
Member
Registered: 2008-08-08
Posts: 118

Re: pdi - Pacman database Informer 2.2

Nice. Couple of thoughts:

- Deps Tree should be a tab in the right window.
- Change signal from doubleClicked to Clicked
- perhaps the radio buttons should be check boxes instead
    * I might even argue that there should instead be a "Repos" menu with those options instead

Otherwise solid. I'd contribute patches if not on my way to work.

PS- A lot of the signals you've defined can be set as automatic signals-- slightly less typing, more pythonic, and easier to read. For example:

@QtCore.pyqtSlot(int)
def on_spinbox_valueChanged(self, i):
    # i will be an integer.
    pass

Offline

#17 2010-09-26 21:04:30

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

Thank you for the comments, I'll take a look and revamp something, but remember I'm a newbie pythonist big_smile
patch are welcomed
cheers

Offline

#18 2010-09-27 17:50:36

EnvoyRising
Member
Registered: 2008-08-08
Posts: 118

Re: pdi - Pacman database Informer 2.2

On the run again so I'll be brief:

Patch:
- more pythonic
- multiple inheritence
- single click instead of doubleclick

From d4a0805a7769ab8fd273516b781bac4bacb977d4 Mon Sep 17 00:00:00 2001
From: Edwin O Marshall <aspidites@inbox.com>
Date: Mon, 27 Sep 2010 06:15:49 -0500
Subject: [PATCH 2/3] main.py is more pythonic

---
 main.py |  320 +++++++++++++++++++++++++++++++++------------------------------
 1 files changed, 169 insertions(+), 151 deletions(-)
 mode change 100755 => 100644 main.py

diff --git a/main.py b/main.py
old mode 100755
new mode 100644
index fddeb7e..693ad13
--- a/main.py
+++ b/main.py
@@ -9,157 +9,175 @@ import sys
 import os
 import subprocess
 from PyQt4 import QtGui, QtCore
-from mainform import *
-
-class MainWindow(QtGui.QMainWindow):
-    def __init__(self):
-        QtGui.QMainWindow.__init__(self)
-        self.main_form = Ui_MainWindow()
-        self.main_form.setupUi(self)
-        self.main_form.statusbar.showMessage('Pacman database Informer')
-        self.listAll()
-        self.main_form.radioButton.setChecked(True)
-        #signals
-        self.main_form.listWidget.itemDoubleClicked.connect(self.info)
-        self.main_form.pushButton_2.clicked.connect(self.listOrphans)
-        self.main_form.pushButton_3.clicked.connect(self.listForeign)
-        self.main_form.pushButton_5.clicked.connect(self.refresh)
-        self.main_form.pushButton_6.clicked.connect(self.depTree)
-        self.main_form.radioButton.toggled.connect(self.listAll)
-        self.main_form.radioButton_2.toggled.connect(self.listRepo)
-        self.main_form.radioButton_3.toggled.connect(self.listRepo)
-        self.main_form.radioButton_4.toggled.connect(self.listRepo)
-        self.main_form.radioButton_5.toggled.connect(self.listRepo)
-        self.main_form.radioButton_6.toggled.connect(self.listRepo)
-        self.main_form.actionAbout_Qt.triggered.connect(self.aboutQt)
-        self.main_form.actionAbout.triggered.connect(self.about)
-        self.connect(self.main_form.label, QtCore.SIGNAL("linkActivated(QString)"), self.Activated)
-
-    def listAll(self):
-        self.main_form.listWidget.clear()
-        for i in os.popen("pacman -Q","r"):
-          item = QtGui.QListWidgetItem(i.strip())
-          item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
-          self.main_form.listWidget.addItem(item)
-        c=self.main_form.listWidget.count()
-        self.main_form.statusbar.showMessage(str(c) + ' installed packages')
-
-    def info(self,item):
-        ### first tab info
-         self.main_form.textEdit.clear()
-         self.main_form.textEdit_2.clear()
-         self.main_form.textEdit_3.clear()
-             p=str(item.text()).split(" ")[0]
-             cmd="pacman -Qi " + p
-             a=os.popen(cmd).read().decode( "utf-8")
-         self.main_form.textEdit.setText(a)
-
-        ### second tab files
-         self.main_form.textEdit_2.clear()
-         if not self.main_form.listWidget.selectedItems():
-              self.main_form.statusbar.showMessage('no package selected')
-              self.main_form.textEdit_2.setText('no package selected.')
-              return
-         a=self.main_form.listWidget.selectedItems()[0]
-         p=str(a.text()).split(" ")[0]
-         cmd="pacman -Ql " + p
-         l=os.popen(cmd).read()
-         self.main_form.textEdit_2.setText(l)
-
-        ### third tab scripts
-         self.main_form.textEdit_3.clear()
-         if not self.main_form.listWidget.selectedItems():
-              self.main_form.statusbar.showMessage('no package selected')
-              self.main_form.textEdit_3.setText('no package selected.')
-              return
-         a=self.main_form.listWidget.selectedItems()[0]
-         p=str(a.text()).split(" ")[0]
-         cmd="pacscripts " + p
-         r = subprocess.Popen(cmd, shell=True ,stdout=subprocess.PIPE, stdin=subprocess.PIPE,  stderr=subprocess.PIPE)
-         o=r.stdout.read().decode( "utf-8")
-         u=r.stderr.read().decode( "utf-8")
-         self.main_form.textEdit_3.setText(str(o)+str(u))
-         self.main_form.statusbar.showMessage('Package Info')
-
-    def listOrphans(self):
-         self.main_form.listWidget.clear()
-         for i in os.popen("pacman -Qdt","r"):
-            item = QtGui.QListWidgetItem(i.strip())
-            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
-            self.main_form.listWidget.addItem(item)
-         c=self.main_form.listWidget.count()
-         self.main_form.statusbar.showMessage(str(c) + ' orphans packages')
-
-    def listForeign(self):
-         self.main_form.listWidget.clear()
-         for i in os.popen("pacman -Qm","r"):
-            item = QtGui.QListWidgetItem(i.strip())
-            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
-            self.main_form.listWidget.addItem(item)
-         c=self.main_form.listWidget.count()
-         self.main_form.statusbar.showMessage(str(c) + ' foreign packages')
-
-    def listRepo(self):
-         self.main_form.listWidget.clear()
-         self.main_form.textEdit.clear()
-         self.main_form.textEdit_2.clear()
-         self.main_form.textEdit_3.clear()
-         repo=''
-         if self.main_form.radioButton_2.isChecked():
-           repo='core'
-         if self.main_form.radioButton_3.isChecked():
-           repo='extra'
-         if self.main_form.radioButton_4.isChecked():
-           repo='community'
-         if self.main_form.radioButton_5.isChecked():
-           repo='testing'
-         if self.main_form.radioButton_6.isChecked():
-           repo='multilib'
-         for i in os.popen("paclist "+ repo,"r"):
-          item = QtGui.QListWidgetItem(i.strip())
-          item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
-          self.main_form.listWidget.addItem(item)
-         c=self.main_form.listWidget.count()
-         self.main_form.statusbar.showMessage(str(c) + ' ' + repo +' packages')
-
-    def refresh (self):
-          self.main_form.listWidget.clear()
-          self.main_form.textEdit.clear()
-          self.main_form.textEdit_2.clear()
-          self.main_form.textEdit_3.clear()
-          self.main_form.radioButton.setChecked(True)
-          self.main_form.radioButton_2.setChecked(False)
-          self.main_form.radioButton_3.setChecked(False)
-          self.main_form.radioButton_4.setChecked(False)
-          self.main_form.radioButton_5.setChecked(False)
-          self.listAll()
-
-    def depTree(self):
-          self.main_form.textEdit.clear()
-          self.main_form.textEdit_2.clear()
-          self.main_form.textEdit_3.clear()
-          if not self.main_form.listWidget.selectedItems():
-              self.main_form.statusbar.showMessage('no package selected')
-              self.main_form.textEdit.setText('no package selected.')
-              return
-          a=self.main_form.listWidget.selectedItems()[0]
-          p=str(a.text()).split(" ")[0]
-          app.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
-          cmd="pactree " + p
-          l=os.popen(cmd).read()
-          self.main_form.textEdit.setText(l)
-          self.main_form.tabWidget.setCurrentWidget(self.main_form.tab_3)
-          self.main_form.statusbar.showMessage('Package deps tree')
-          app.restoreOverrideCursor()
-
-    def about (self):
-          QtGui.QMessageBox.about(self ,"Pacman database Informer" , 'Pacman database Informer v 1.3 by mangus \n \n A little tool for little queries to the pacman database \n mangus@deprecated.it \n \n The ARCHLINUX name and logo are recognized trademarks \n See http://www.archlinux.org/ for acceptable use and restrictions.')
-
-    def aboutQt (self) :
-          QtGui.QMessageBox.aboutQt(self)
-
-    def Activated(self, URL):
-          QtGui.QDesktopServices().openUrl(QtCore.QUrl(URL))
+from mainform import Ui_MainWindow
+#from ui_main_window import Ui_MainWindow
+
+class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
+    def __init__(self, parent=None):
+        super(MainWindow, self).__init__(parent)
+        self.setupUi(self)
+        self.repo = ''
+        self.statusbar.showMessage('Pacman database Informer')
+        self.on_radioButton_toggled(False)
+        self.radioButton.setChecked(True)
+
+        #signals
+        self.connect(self.label, QtCore.SIGNAL("linkActivated(QString)"), self.Activated)
+
+    def clearAll(self):
+        self.listWidget.clear()
+        self.textEdit.clear()
+        self.textEdit_2.clear()
+        self.textEdit_3.clear()
+        self.repo = '' 
+
+    def on_radioButton_toggled(self, checked):
+        self.listWidget.clear()
+        for i in os.popen("pacman -Q","r"):
+            item = QtGui.QListWidgetItem(i.strip())
+            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
+            self.listWidget.addItem(item)
+        c=self.listWidget.count()
+        self.statusbar.showMessage(str(c) + ' installed packages')
+
+    def on_listWidget_itemClicked(self, item):
+        ### first tab info
+        self.textEdit.clear()
+        self.textEdit_2.clear()
+        self.textEdit_3.clear()
+        p=str(item.text()).split(" ")[0]
+        cmd="pacman -Qi " + p
+        a=os.popen(cmd).read().decode( "utf-8")
+        self.textEdit.setText(a)
+
+        ### second tab files
+        self.textEdit_2.clear()
+        if not self.listWidget.selectedItems():
+            self.statusbar.showMessage('no package selected')
+            self.textEdit_2.setText('no package selected.')
+            return
+        a=self.listWidget.selectedItems()[0]
+        p=str(a.text()).split(" ")[0]
+        cmd="pacman -Ql " + p
+        l=os.popen(cmd).read()
+        self.textEdit_2.setText(l)
+
+        ### third tab scripts
+        self.textEdit_3.clear()
+        if not self.listWidget.selectedItems():
+            self.statusbar.showMessage('no package selected')
+            self.textEdit_3.setText('no package selected.')
+            return
+        a=self.listWidget.selectedItems()[0]
+        p=str(a.text()).split(" ")[0]
+        cmd="pacscripts " + p
+        r = subprocess.Popen(cmd, shell=True ,stdout=subprocess.PIPE, stdin=subprocess.PIPE,  stderr=subprocess.PIPE)
+        o=r.stdout.read().decode( "utf-8")
+        u=r.stderr.read().decode( "utf-8")
+        self.textEdit_3.setText(str(o)+str(u))
+        self.statusbar.showMessage('Package Info')
+
+
+    def on_pushButton_2_clicked(self, enabled):
+        self.listWidget.clear()
+        for i in os.popen("pacman -Qdt","r"):
+            item = QtGui.QListWidgetItem(i.strip())
+            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
+            self.listWidget.addItem(item)
+        c=self.listWidget.count()
+        self.statusbar.showMessage(str(c) + ' orphans packages')
+
+    def on_pushButton_5_clicked(self, enabled):
+        self.listWidget.clear()
+        for i in os.popen("pacman -Qm","r"):
+            item = QtGui.QListWidgetItem(i.strip())
+            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
+            self.listWidget.addItem(item)
+        c=self.listWidget.count()
+        self.statusbar.showMessage(str(c) + ' foreign packages')
+
+    def on_pushButton_5_clicked(self, enabled):
+        self.listWidget.clear()
+        self.textEdit.clear()
+        self.textEdit_2.clear()
+        self.textEdit_3.clear()
+        self.radioButton.setChecked(True)
+        self.radioButton_2.setChecked(False)
+        self.radioButton_3.setChecked(False)
+        self.radioButton_4.setChecked(False)
+        self.radioButton_5.setChecked(False)
+        self.listAll()
+
+    def on_pushButton_6_clicked(self, enabled):
+        self.textEdit.clear()
+        self.textEdit_2.clear()
+        self.textEdit_3.clear()
+        if not self.listWidget.selectedItems():
+            self.statusbar.showMessage('no package selected')
+            self.textEdit.setText('no package selected.')
+            return
+        a=self.listWidget.selectedItems()[0]
+        p=str(a.text()).split(" ")[0]
+        app.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
+        cmd="pactree " + p
+        l=os.popen(cmd).read()
+        self.textEdit.setText(l)
+        self.tabWidget.setCurrentWidget(self.tab_3)
+        self.statusbar.showMessage('Package deps tree')
+        app.restoreOverrideCursor()
+
+
+    def on_radioButton_2_toggled(self, checked):
+        self.clearAll()
+        self.repo = 'core'
+        self.updatePackages()
+
+    def on_radioButton_3_toggled(self, checked):
+        self.clearAll()
+        self.repo = 'extra'
+        self.updatePackages()
+
+    def on_radioButton_4_toggled(self, checked):
+        self.clearAll()
+        self.repo = 'community'
+        self.updatePackages()
+
+    def on_radioButton_5_toggled(self, checked):
+        self.clearAll()
+        self.repo = 'testing'
+        self.updatePackages()
+
+    def on_radioButton_6_toggled(self, checked):
+        self.clearAll()
+        self.repo = 'multilib'
+        self.updatePackages()
+
+    def updatePackages(self):
+        for i in os.popen("paclist "+ self.repo,"r"):
+            item = QtGui.QListWidgetItem(i.strip())
+            item.setIcon(QtGui.QIcon('pixmaps/tgz.png'))
+            self.listWidget.addItem(item)
+        c=self.listWidget.count()
+        self.statusbar.showMessage(str(c) + ' ' + self.repo +' packages')
+
+
+    def on_actionAbout_triggered(self, enabled):
+        QtGui.QMessageBox.about(self, "Pacman database Informer", 
+                                "Pacmandatabase Informer v 1.3 by mangus\n\n"
+                                "A little tool for little queries to the "
+                                "pacman database \n"
+                                "mangus@deprecated.it\n\n"
+                                "The ARCHLINUX name and logo are recognized "
+                                "trademarks\n"
+                                "See http://www.archlinux.org/ for acceptable "
+                                "use and restrictons.")
+        #QtGui.QMessageBox.about(self ,"Pacman database Informer" , 'Pacman database Informer v 1.3 by mangus \n \n A little tool for little queries to the pacman database \n mangus@deprecated.it \n \n The ARCHLINUX name and logo are recognized trademarks \n See http://www.archlinux.org/ for acceptable use and restrictions.')
+
+    def on_actionAbout_Qt_triggered(self, enabled):
+        QtGui.QMessageBox.aboutQt(self)
+
+    def Activated(self, URL):
+        QtGui.QDesktopServices().openUrl(QtCore.QUrl(URL))
 
 app = QtGui.QApplication(sys.argv)
 main = MainWindow()
-- 
1.7.3

mock up for what I think is an improved design:
201009270452421440x900s.th.png

Uploaded with ImageShack.us

Offline

#19 2010-09-28 16:13:25

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

thank you very much , I'll see what comes up with this ... don't you think that a a menu entry for the repos is redundant if a spinbox or a combobox is present?
btw I managed to parse pacman.conf to find the active repos in order to be more realistic , we'll see smile

Offline

#20 2010-10-01 15:22:21

EnvoyRising
Member
Registered: 2008-08-08
Posts: 118

Re: pdi - Pacman database Informer 2.2

Sorry, the combo box only replaces the Orphan/Foreign package filter, not repositories, so no redundancy. It may make since however to remove the box all together and add options under the menu. I'm off the next couple of days, so I'll see what I can come up with to give you more concrete examples.

Offline

#21 2010-10-02 19:30:53

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

bump for 2.0beta version:
-major rewrite and rework of the interface
-listed repos are now real repos activated in pacman.conf(parsed)
-pacman -Qo function implemented , file entry requires full path
-systemtray icon implemented , you can keep it open to be ready for use (instead of using a terminal, of course..yakuake anyone? :-)  )
-file .desktop for convenient menu entry
-a lot of fix here and there
-coded using  qt 4.7 in testing , not tested with qt 4.6

@EnvoyRising
thanks for the hints, I managed to follow your mockup and I came up with this in the end , tell me what you think big_smile  the code is always not so pythonic as I'm noob and I use qt a lot it seems
@kittykatt
you can update the PKGBUILD in AUR with the one provided in the first thread , as I changed something in the installation.take a look..

thaks to everyone
cheers

P.S. the logo in the widget is ugly? naah..
point me to something alternative if you wish , I took it from kde-look.org ..btw many thanks to the author!

Last edited by mangus (2010-10-03 10:20:05)

Offline

#22 2010-10-02 21:47:22

EnvoyRising
Member
Registered: 2008-08-08
Posts: 118

Re: pdi - Pacman database Informer 2.2

I much prefer the logo in the widget that wasting precious real estate at the top. Good call. Actually, I really like the new UI overall.

Things to note:

- Repos in the combo box still means you can only ever see packages from one repo. Is it that you never intended to be able to show more than one repo?
- The system tray thing should be a configurable option. Also, there should be the option of starting minimized.
- The above ignored, I really like the new UI. I would change the layout to a splitter for the two panels. Patches Follow:

mainform.patch (mainform.py):

*** mainform.py.orig    2010-10-02 16:23:55.453333893 -0500
--- mainform.py    2010-10-02 16:23:24.843333892 -0500
***************
*** 2,8 ****
  
  # Form implementation generated from reading ui file 'mainform3.ui'
  #
! # Created: Sat Oct  2 16:41:15 2010
  #      by: PyQt4 UI code generator 4.7.4
  #
  # WARNING! All changes made in this file will be lost!
--- 2,8 ----
  
  # Form implementation generated from reading ui file 'mainform3.ui'
  #
! # Created: Sat Oct  2 16:23:15 2010
  #      by: PyQt4 UI code generator 4.7.4
  #
  # WARNING! All changes made in this file will be lost!
***************
*** 18,39 ****
          MainWindow.setWindowIcon(icon)
          self.centralwidget = QtGui.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
!         self.gridLayout_7 = QtGui.QGridLayout(self.centralwidget)
!         self.gridLayout_7.setObjectName("gridLayout_7")
!         self.gridLayout_6 = QtGui.QGridLayout()
!         self.gridLayout_6.setObjectName("gridLayout_6")
!         self.gridLayout_5 = QtGui.QGridLayout()
          self.gridLayout_5.setObjectName("gridLayout_5")
          self.gridLayout_4 = QtGui.QGridLayout()
          self.gridLayout_4.setObjectName("gridLayout_4")
!         self.comboBox = QtGui.QComboBox(self.centralwidget)
          self.comboBox.setObjectName("comboBox")
          self.gridLayout_4.addWidget(self.comboBox, 0, 0, 1, 1)
!         self.pushButton_5 = QtGui.QPushButton(self.centralwidget)
          self.pushButton_5.setObjectName("pushButton_5")
          self.gridLayout_4.addWidget(self.pushButton_5, 0, 1, 1, 1)
          self.gridLayout_5.addLayout(self.gridLayout_4, 0, 0, 1, 1)
!         self.listWidget = QtGui.QListWidget(self.centralwidget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
--- 18,42 ----
          MainWindow.setWindowIcon(icon)
          self.centralwidget = QtGui.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
!         self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
!         self.verticalLayout.setObjectName("verticalLayout")
!         self.splitter = QtGui.QSplitter(self.centralwidget)
!         self.splitter.setOrientation(QtCore.Qt.Horizontal)
!         self.splitter.setObjectName("splitter")
!         self.widget = QtGui.QWidget(self.splitter)
!         self.widget.setObjectName("widget")
!         self.gridLayout_5 = QtGui.QGridLayout(self.widget)
          self.gridLayout_5.setObjectName("gridLayout_5")
          self.gridLayout_4 = QtGui.QGridLayout()
          self.gridLayout_4.setObjectName("gridLayout_4")
!         self.comboBox = QtGui.QComboBox(self.widget)
          self.comboBox.setObjectName("comboBox")
          self.gridLayout_4.addWidget(self.comboBox, 0, 0, 1, 1)
!         self.pushButton_5 = QtGui.QPushButton(self.widget)
          self.pushButton_5.setObjectName("pushButton_5")
          self.gridLayout_4.addWidget(self.pushButton_5, 0, 1, 1, 1)
          self.gridLayout_5.addLayout(self.gridLayout_4, 0, 0, 1, 1)
!         self.listWidget = QtGui.QListWidget(self.widget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
***************
*** 50,56 ****
          self.gridLayout_5.addWidget(self.listWidget, 1, 0, 1, 1)
          self.gridLayout = QtGui.QGridLayout()
          self.gridLayout.setObjectName("gridLayout")
!         self.lineEdit = QtGui.QLineEdit(self.centralwidget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
--- 53,59 ----
          self.gridLayout_5.addWidget(self.listWidget, 1, 0, 1, 1)
          self.gridLayout = QtGui.QGridLayout()
          self.gridLayout.setObjectName("gridLayout")
!         self.lineEdit = QtGui.QLineEdit(self.widget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
***************
*** 58,64 ****
          self.lineEdit.setSizePolicy(sizePolicy)
          self.lineEdit.setObjectName("lineEdit")
          self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 1)
!         self.pushButton = QtGui.QPushButton(self.centralwidget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
--- 61,67 ----
          self.lineEdit.setSizePolicy(sizePolicy)
          self.lineEdit.setObjectName("lineEdit")
          self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 1)
!         self.pushButton = QtGui.QPushButton(self.widget)
          sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
          sizePolicy.setHorizontalStretch(0)
          sizePolicy.setVerticalStretch(0)
***************
*** 67,74 ****
          self.pushButton.setObjectName("pushButton")
          self.gridLayout.addWidget(self.pushButton, 0, 1, 1, 1)
          self.gridLayout_5.addLayout(self.gridLayout, 2, 0, 1, 1)
!         self.gridLayout_6.addLayout(self.gridLayout_5, 0, 0, 1, 1)
!         self.tabWidget = QtGui.QTabWidget(self.centralwidget)
          self.tabWidget.setTabPosition(QtGui.QTabWidget.South)
          self.tabWidget.setMovable(True)
          self.tabWidget.setObjectName("tabWidget")
--- 70,76 ----
          self.pushButton.setObjectName("pushButton")
          self.gridLayout.addWidget(self.pushButton, 0, 1, 1, 1)
          self.gridLayout_5.addLayout(self.gridLayout, 2, 0, 1, 1)
!         self.tabWidget = QtGui.QTabWidget(self.splitter)
          self.tabWidget.setTabPosition(QtGui.QTabWidget.South)
          self.tabWidget.setMovable(True)
          self.tabWidget.setObjectName("tabWidget")
***************
*** 128,138 ****
          self.textEdit_4.setObjectName("textEdit_4")
          self.gridLayout_11.addWidget(self.textEdit_4, 0, 0, 1, 1)
          self.tabWidget.addTab(self.tab_6, "")
!         self.gridLayout_6.addWidget(self.tabWidget, 0, 1, 1, 1)
!         self.gridLayout_7.addLayout(self.gridLayout_6, 0, 0, 1, 1)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtGui.QMenuBar(MainWindow)
!         self.menubar.setGeometry(QtCore.QRect(0, 0, 672, 19))
          self.menubar.setObjectName("menubar")
          self.menuHelp = QtGui.QMenu(self.menubar)
          self.menuHelp.setObjectName("menuHelp")
--- 130,139 ----
          self.textEdit_4.setObjectName("textEdit_4")
          self.gridLayout_11.addWidget(self.textEdit_4, 0, 0, 1, 1)
          self.tabWidget.addTab(self.tab_6, "")
!         self.verticalLayout.addWidget(self.splitter)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtGui.QMenuBar(MainWindow)
!         self.menubar.setGeometry(QtCore.QRect(0, 0, 672, 21))
          self.menubar.setObjectName("menubar")
          self.menuHelp = QtGui.QMenu(self.menubar)
          self.menuHelp.setObjectName("menuHelp")

mainform3.patch (mainform3.ui)

*** mainform3.ui.orig    2010-10-02 16:21:58.493333892 -0500
--- mainform3.ui    2010-10-02 16:21:15.333333893 -0500
***************
*** 18,27 ****
      <normaloff>pixmaps/archlinux-icon-crystal-64.svg</normaloff>pixmaps/archlinux-icon-crystal-64.svg</iconset>
    </property>
    <widget class="QWidget" name="centralwidget">
!    <layout class="QGridLayout" name="gridLayout_7">
!     <item row="0" column="0">
!      <layout class="QGridLayout" name="gridLayout_6">
!       <item row="0" column="0">
         <layout class="QGridLayout" name="gridLayout_5">
          <item row="0" column="0">
           <layout class="QGridLayout" name="gridLayout_4">
--- 18,30 ----
      <normaloff>pixmaps/archlinux-icon-crystal-64.svg</normaloff>pixmaps/archlinux-icon-crystal-64.svg</iconset>
    </property>
    <widget class="QWidget" name="centralwidget">
!    <layout class="QVBoxLayout" name="verticalLayout">
!     <item>
!      <widget class="QSplitter" name="splitter">
!       <property name="orientation">
!        <enum>Qt::Horizontal</enum>
!       </property>
!       <widget class="QWidget" name="">
         <layout class="QGridLayout" name="gridLayout_5">
          <item row="0" column="0">
           <layout class="QGridLayout" name="gridLayout_4">
***************
*** 111,220 ****
           </layout>
          </item>
         </layout>
!       </item>
!       <item row="0" column="1">
!        <widget class="QTabWidget" name="tabWidget">
!         <property name="tabPosition">
!          <enum>QTabWidget::South</enum>
!         </property>
!         <property name="currentIndex">
!          <number>0</number>
!         </property>
!         <property name="movable">
!          <bool>true</bool>
!         </property>
!         <widget class="QWidget" name="tab_3">
!          <attribute name="title">
!           <string>Info</string>
!          </attribute>
!          <layout class="QGridLayout" name="gridLayout_8">
!           <item row="0" column="0">
!            <widget class="QTextEdit" name="textEdit">
!             <property name="sizePolicy">
!              <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
!               <horstretch>0</horstretch>
!               <verstretch>0</verstretch>
!              </sizepolicy>
!             </property>
!             <property name="font">
!              <font>
!               <family>Monospace</family>
!               <pointsize>9</pointsize>
!              </font>
!             </property>
!             <property name="autoFormatting">
!              <set>QTextEdit::AutoNone</set>
!             </property>
!             <property name="lineWrapMode">
!              <enum>QTextEdit::WidgetWidth</enum>
!             </property>
!             <property name="readOnly">
!              <bool>true</bool>
!             </property>
!            </widget>
!           </item>
!          </layout>
!         </widget>
!         <widget class="QWidget" name="tab_4">
!          <attribute name="title">
!           <string>List Files</string>
!          </attribute>
!          <layout class="QGridLayout" name="gridLayout_2">
!           <item row="0" column="0">
!            <widget class="QTextEdit" name="textEdit_2">
!             <property name="font">
!              <font>
!               <family>Monospace</family>
!              </font>
!             </property>
!             <property name="readOnly">
!              <bool>true</bool>
!             </property>
!            </widget>
!           </item>
!          </layout>
!         </widget>
!         <widget class="QWidget" name="tab_5">
!          <attribute name="title">
!           <string>View installation script</string>
!          </attribute>
!          <layout class="QGridLayout" name="gridLayout_3">
!           <item row="0" column="0">
!            <widget class="QTextEdit" name="textEdit_3">
!             <property name="font">
!              <font>
!               <family>Monospace</family>
!              </font>
!             </property>
!             <property name="readOnly">
!              <bool>true</bool>
!             </property>
!            </widget>
!           </item>
!          </layout>
!         </widget>
!         <widget class="QWidget" name="tab_6">
!          <attribute name="title">
!           <string>Deps tree</string>
!          </attribute>
!          <layout class="QGridLayout" name="gridLayout_11">
!           <item row="0" column="0">
!            <widget class="QTextEdit" name="textEdit_4">
!             <property name="font">
!              <font>
!               <family>Monospace</family>
!              </font>
!             </property>
!             <property name="horizontalScrollBarPolicy">
!              <enum>Qt::ScrollBarAsNeeded</enum>
!             </property>
!            </widget>
!           </item>
!          </layout>
!         </widget>
         </widget>
!       </item>
!      </layout>
      </item>
     </layout>
    </widget>
--- 114,221 ----
           </layout>
          </item>
         </layout>
!       </widget>
!       <widget class="QTabWidget" name="tabWidget">
!        <property name="tabPosition">
!         <enum>QTabWidget::South</enum>
!        </property>
!        <property name="currentIndex">
!         <number>0</number>
!        </property>
!        <property name="movable">
!         <bool>true</bool>
!        </property>
!        <widget class="QWidget" name="tab_3">
!         <attribute name="title">
!          <string>Info</string>
!         </attribute>
!         <layout class="QGridLayout" name="gridLayout_8">
!          <item row="0" column="0">
!           <widget class="QTextEdit" name="textEdit">
!            <property name="sizePolicy">
!             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
!              <horstretch>0</horstretch>
!              <verstretch>0</verstretch>
!             </sizepolicy>
!            </property>
!            <property name="font">
!             <font>
!              <family>Monospace</family>
!              <pointsize>9</pointsize>
!             </font>
!            </property>
!            <property name="autoFormatting">
!             <set>QTextEdit::AutoNone</set>
!            </property>
!            <property name="lineWrapMode">
!             <enum>QTextEdit::WidgetWidth</enum>
!            </property>
!            <property name="readOnly">
!             <bool>true</bool>
!            </property>
!           </widget>
!          </item>
!         </layout>
!        </widget>
!        <widget class="QWidget" name="tab_4">
!         <attribute name="title">
!          <string>List Files</string>
!         </attribute>
!         <layout class="QGridLayout" name="gridLayout_2">
!          <item row="0" column="0">
!           <widget class="QTextEdit" name="textEdit_2">
!            <property name="font">
!             <font>
!              <family>Monospace</family>
!             </font>
!            </property>
!            <property name="readOnly">
!             <bool>true</bool>
!            </property>
!           </widget>
!          </item>
!         </layout>
!        </widget>
!        <widget class="QWidget" name="tab_5">
!         <attribute name="title">
!          <string>View installation script</string>
!         </attribute>
!         <layout class="QGridLayout" name="gridLayout_3">
!          <item row="0" column="0">
!           <widget class="QTextEdit" name="textEdit_3">
!            <property name="font">
!             <font>
!              <family>Monospace</family>
!             </font>
!            </property>
!            <property name="readOnly">
!             <bool>true</bool>
!            </property>
!           </widget>
!          </item>
!         </layout>
!        </widget>
!        <widget class="QWidget" name="tab_6">
!         <attribute name="title">
!          <string>Deps tree</string>
!         </attribute>
!         <layout class="QGridLayout" name="gridLayout_11">
!          <item row="0" column="0">
!           <widget class="QTextEdit" name="textEdit_4">
!            <property name="font">
!             <font>
!              <family>Monospace</family>
!             </font>
!            </property>
!            <property name="horizontalScrollBarPolicy">
!             <enum>Qt::ScrollBarAsNeeded</enum>
!            </property>
!           </widget>
!          </item>
!         </layout>
         </widget>
!       </widget>
!      </widget>
      </item>
     </layout>
    </widget>
***************
*** 224,230 ****
       <x>0</x>
       <y>0</y>
       <width>672</width>
!      <height>19</height>
      </rect>
     </property>
     <widget class="QMenu" name="menuHelp">
--- 225,231 ----
       <x>0</x>
       <y>0</y>
       <width>672</width>
!      <height>21</height>
      </rect>
     </property>
     <widget class="QMenu" name="menuHelp">

(All I modified was the .ui file and regenerated the corresponding .py file)

Offline

#23 2010-10-03 10:18:29

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

EnvoyRising wrote:

I much prefer the logo in the widget that wasting precious real estate at the top. Good call. Actually, I really like the new UI overall.

Things to note:

- Repos in the combo box still means you can only ever see packages from one repo. Is it that you never intended to be able to show more than one repo?
- The system tray thing should be a configurable option. Also, there should be the option of starting minimized.
- The above ignored, I really like the new UI. I would change the layout to a splitter for the two panels. Patches Follow:

Thanks , I applied the patch , the qsplitter is one thing I was looking for big_smile
I uploded a new tarball with this and some minor tweaking to the UI , looks very good now.
Also backspace key now interact with qlineedit search (1 line of code , qt api always amazes me..)

For the other things:
-Why would you need to see two different repos simultaneously with mixed packages? I don't see use for that , and putting all in a checkbox form with multi selections , seems to make things more complex as you have always to click to select or unselect the needed repos. The combobox is way too handy , digging into one repo at time of course...

-If you intend to make a conf file for systray stuff , it's surely doable but a little complex for now , I'll look at that  for next releases
now I'd like to focus on what I got and release a 'stable(?!)' 2.0 soon after some more testing

thanks

Offline

#24 2010-10-04 01:47:22

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: pdi - Pacman database Informer 2.2

Updated PKGBUILD in AUR. Sorry for the slowness. Life interrupted. ^^;


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#25 2010-10-05 16:24:09

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: pdi - Pacman database Informer 2.2

bump for 2.0 stable , source and PKGBUILD in the first post.
The 2.0 release is not tested with the actual state of the Testing repo, which envolves the big python rebuild and the python3 migration. You may expect funky behaviour...I'll take a look at that in the next releases

enjoy and leave some feedback
cheers

Offline

Board footer

Powered by FluxBB