You are not logged in.

#51 2010-10-29 22:10:23

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

Re: pdi - Pacman database Informer 2.2

Bump for 2.1 release:  a lot of code cleaning , options for using systray and start minimized. Thanks All for feedback 
and to EnvoyRising for the patches and the help , any suggestion is well accepted
enjoy! smile

Offline

#52 2010-10-30 06:31:51

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: pdi - Pacman database Informer 2.2

mangus wrote:

Bump for 2.1 release:  a lot of code cleaning , options for using systray and start minimized. Thanks All for feedback 
and to EnvoyRising for the patches and the help , any suggestion is well accepted
enjoy! smile

It is not in the aur yet?


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#53 2010-10-30 18:18:19

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

Re: pdi - Pacman database Informer 2.2

SanskritFritz wrote:
mangus wrote:

Bump for 2.1 release:  a lot of code cleaning , options for using systray and start minimized. Thanks All for feedback 
and to EnvoyRising for the patches and the help , any suggestion is well accepted
enjoy! smile

It is not in the aur yet?

should be easy enough to just manually bump the version number in the current PKGBUILD. Be sure to regenerate the checksum, though:

makepkg -g >> PKGBUILD && makepkg

Edit:
That said, perhaps you could open up a git repository, mangus? For one, it would be easier for me and others to contribute, and for two, it would mean the latest version would always be available on AUR, independent of the maintainer's availability.

Edit 2:
You'll also want to change the dependency from python to python2

Last edited by EnvoyRising (2010-10-30 22:03:32)

Offline

#54 2010-10-30 22:33:32

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

Re: pdi - Pacman database Informer 2.2

mangus wrote:

Bump for 2.1 release:  a lot of code cleaning , options for using systray and start minimized. Thanks All for feedback 
and to EnvoyRising for the patches and the help , any suggestion is well accepted
enjoy! smile

"All' option wasn't working correctly. Technically didn't account for foreign packages. I've fixed that though:

Save this as main.patch and copy to same directory as main.py, then run 'patch < main.patch'  :

*** /usr/share/pdi/main.py    2010-10-30 17:04:03.000000000 -0500
--- main.py    2010-10-30 17:28:51.480000432 -0500
***************
*** 20,25 ****
--- 20,26 ----
      def __init__(self,parent=None):
          super(MainWindow, self).__init__(parent)
          self.setupUi(self)
+         self.repo_list = []
          self.statusbar.showMessage('Pacman database Informer')
          self.lineEdit.backspace()
          self.lineEdit.setPlaceholderText('Insert complete PATH - pacman -Qo')
***************
*** 68,77 ****
          self.style()
  
      def refresh(self):
!         global repo_list
!         repo_list=[]
!         repo_list=self.findRepos()
!         self.comboBox.addItems(repo_list)
          self.comboBox.insertSeparator((self.comboBox.count())-3)
          self.clear()
          self.comboBox.setCurrentIndex(0)
--- 69,76 ----
          self.style()
  
      def refresh(self):
!         self.repo_list=self.findRepos()
!         self.comboBox.addItems(self.repo_list)
          self.comboBox.insertSeparator((self.comboBox.count())-3)
          self.clear()
          self.comboBox.setCurrentIndex(0)
***************
*** 79,85 ****
  
      def listRepo(self,repo):
          self.clear()
!         if repo == 'Orphans - pacman -Qdt':
              cmd='pacman -Qdt'
              barstring=' orphans packages'
              self.listPackages(cmd,barstring)
--- 78,88 ----
  
      def listRepo(self,repo):
          self.clear()
!         if repo == 'All':
!             cmd='pacman -Qe'
!             barstring=' packages'
!             self.listPackages(cmd,barstring)
!         elif repo == 'Orphans - pacman -Qdt':
              cmd='pacman -Qdt'
              barstring=' orphans packages'
              self.listPackages(cmd,barstring)
***************
*** 87,103 ****
              cmd='pacman -Qm'
              barstring=' foreign packages'
              self.listPackages(cmd,barstring)
!         else:
!             if repo == 'Stable - All But Testing and Unstable':
!                 repos = [i for i in repo_list[1:-3] if 'testing' not in i and 'unstable' not in i]
!             elif repo == 'All':
!                 repos = repo_list[1:-3]
!             else:
!                 repos = [repo]
              for repo in repos:
                  cmd='paclist '+ str(repo)
                  barstring=' packages'
                  self.listPackages(cmd,barstring)
  
      def listPackages(self,cmd,barstring):
          for i in Popen(cmd,shell=True,stdout=PIPE).stdout:
--- 90,108 ----
              cmd='pacman -Qm'
              barstring=' foreign packages'
              self.listPackages(cmd,barstring)
!         elif repo == 'Stable - All But Testing and Unstable':
!             repos = [i for i in self.repo_list[1:-3] 
!                      if 'testing' not in i and 'unstable' not in i]
! 
              for repo in repos:
                  cmd='paclist '+ str(repo)
                  barstring=' packages'
                  self.listPackages(cmd,barstring)
+         else:
+             cmd='paclist '+ str(repo)
+             barstring=' packages'
+             self.listPackages(cmd,barstring)
+ 
  
      def listPackages(self,cmd,barstring):
          for i in Popen(cmd,shell=True,stdout=PIPE).stdout:
***************
*** 108,123 ****
          self.statusbar.showMessage(str(c) + ' ' + barstring)
  
      def findRepos(self):
!         repo_list = ['All', 'Orphans - pacman -Qdt', 'Foreign - pacman -Qm',
                       'Stable - All But Testing and Unstable']
          f = open('/etc/pacman.conf','r')
          for line in f.readlines():
              if line[0] == '[':  ## this may be ugly....
                  a = line.strip().strip('[]') # first strip needed for white space
!                 repo_list.insert(-3, a)
          f.close()
!         repo_list.pop(repo_list.index('options'))
!         return repo_list
  
      def on_listWidget_itemClicked(self, item):
          ### first tab info
--- 113,128 ----
          self.statusbar.showMessage(str(c) + ' ' + barstring)
  
      def findRepos(self):
!         self.repo_list = ['All', 'Orphans - pacman -Qdt', 'Foreign - pacman -Qm',
                       'Stable - All But Testing and Unstable']
          f = open('/etc/pacman.conf','r')
          for line in f.readlines():
              if line[0] == '[':  ## this may be ugly....
                  a = line.strip().strip('[]') # first strip needed for white space
!                 self.repo_list.insert(-3, a)
          f.close()
!         self.repo_list.pop(self.repo_list.index('options'))
!         return self.repo_list
  
      def on_listWidget_itemClicked(self, item):
          ### first tab info
***************
*** 310,313 ****
  
  if __name__ == "__main__":
      Ini()
!     main()
\ No newline at end of file
--- 315,318 ----
  
  if __name__ == "__main__":
      Ini()
!     main()

Also, global is generally a bad idea. Don't have time now, but at some point unless you get around to it I'll be filing a patch against that as well.

Offline

#55 2010-10-31 06:41:38

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: pdi - Pacman database Informer 2.2

EnvoyRising wrote:

That said, perhaps you could open up a git repository, mangus? For one, it would be easier for me and others to contribute, and for two, it would mean the latest version would always be available on AUR, independent of the maintainer's availability.

Actually makepkg sucks with git (and cvs, darcs etc, but works well with svn or bzr) in this regard. It works though (it does pull the latest version from git), but it simply generates todays date as version, regardless of the actual version in git, thus if you makepkg every day, you get a brand new version of the package every day. Heh, it even says "Determining latest git revision..." but this is a plain lie wink


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#56 2010-11-01 15:41:33

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

Re: pdi - Pacman database Informer 2.2

EnvoyRising wrote:

"All' option wasn't working correctly. Technically didn't account for foreign packages. I've fixed that though:

Save this as main.patch and copy to same directory as main.py, then run 'patch < main.patch'  :

Also, global is generally a bad idea. Don't have time now, but at some point unless you get around to it I'll be filing a patch against that as well.

yes,being in hurry is never good and I introduced the bug while I was trying to not call findRepos() twice at start. I applied your patch
and it's fine, only one thing : why pacman -Qe for 'All'? Shouldn't be pacman -Q ?
Since I don't use testing I cannot test well the behaviour of 'Stable - All But Testing and Unstable' , here is showing the result of
'All but foreign'..could this be correct in your opinion?

For the git repo , I'll see if I find time to learn git , that scares me a little....could gitorius be an option?

I'll release 2.2 with your patch and it's working fine now , as usual people can find the PKGBUILD in the first post , waiting
for KittyKat to show up
thanks to all

Offline

#57 2010-11-01 17:20:16

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

Re: pdi - Pacman database Informer 2.2

I'll upload the new source pkg when I get home tonight. big_smile

I'm also pretty handy with GIT and GIT repositories, if you need some advice or even hosting, seeing as how SilverIRC has its own GIT repository. There's also a way in PKGBUILDs to fix the way makepkg uses the date of the last commit for any GIT hosted packages. It's a bit of a workaround, really. Take a look at screenfetch-git's PKGBUILD for a little example.

Last edited by kittykatt (2010-11-01 17:24:09)


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

Offline

#58 2010-11-01 17:24:59

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

Re: pdi - Pacman database Informer 2.2

mangus wrote:
EnvoyRising wrote:

"All' option wasn't working correctly. Technically didn't account for foreign packages. I've fixed that though:

Save this as main.patch and copy to same directory as main.py, then run 'patch < main.patch'  :

Also, global is generally a bad idea. Don't have time now, but at some point unless you get around to it I'll be filing a patch against that as well.

yes,being in hurry is never good and I introduced the bug while I was trying to not call findRepos() twice at start. I applied your patch
and it's fine, only one thing : why pacman -Qe for 'All'? Shouldn't be pacman -Q ?

see this post

mangus wrote:

Since I don't use testing I cannot test well the behaviour of 'Stable - All But Testing and Unstable' , here is showing the result of
'All but foreign'..could this be correct in your opinion?

Im not at home, so I can't test this, but the last time I checked, its supposed to show all packages from repos that don't have "testing" or "unstable" in their name. It also excludes foreign packages.

mangus wrote:

[
For the git repo , I'll see if I find time to learn git , that scares me a little....could gitorius be an option?

I use gitorious and like it. (name there is aspidites, not EnvoyRising)

mangus wrote:

[
I'll release 2.2 with your patch and it's working fine now , as usual people can find the PKGBUILD in the first post , waiting
for KittyKat to show up
thanks to all

If you are constantly updating the PKGBUILD in the first post, perhaps it would make more since for KittyKat to orphan the package and you maintain it? After all, you are the first to know if there is a new version out tongue

Offline

#59 2010-11-01 17:27:28

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

Re: pdi - Pacman database Informer 2.2

I only offered to maintain it because I was interested in the package and liked the application. If mangus would like to maintain it himself, I'll gladly hand over the AUR package to him.


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

Offline

#60 2010-11-06 08:57:53

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

Re: pdi - Pacman database Informer 2.2

Would be nice if dep tree was an actual tree widget. I haven't quite got the conversion correct, but i have a start:

        last_nest_level = 1
        last_parent = None
        parents = {}
        for dep in l.split("\n")[1:]:
            nest_level = dep.count(' ') / 3

            if nest_level == 1:
                item = QtGui.QTreeWidgetItem(self.treeWidget)
                item.setText(0, dep.split("|--")[-1])
                parents[nest_level] = self.treeWidget
                last_nest_level = nest_level
                last_parent = item
            elif  nest_level == last_nest_level:
                item = QtGui.QTreeWidgetItem(last_parent)
                item.setText(0, dep.split("|--")[-1])
                last_nest_level = nest_level
            elif nest_level > last_nest_level:
                item = QtGui.QTreeWidgetItem(last_parent)
                item.setText(0, dep.split("|--")[-1])
                last_nest_level = nest_level
                parents[nest_level] = item
            elif 0 < nest_level < last_nest_level:
                item = QtGui.QTreeWidgetItem(parents[nest_level])
                item.setText(0, dep.split("|--")[-1])
                last_nest_level = nest_level

The logic is flawed in that it doesn't correctly detect some of the child/parent relationships. The end result is something like this though:
20101106035658793x643sc.th.png

Uploaded with ImageShack.us

I'd suggest not copying the code directly but rather looking at it to get some ideas and come up with a correct implementation. The above attempted to count the number of spaces before a package name to determine the nesting depth.

Offline

#61 2010-12-08 21:51:07

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

Re: pdi - Pacman database Informer 2.2

Feature request: I think that next to the deps tree it might be a good idea to add a reverse deps tree too, like the info that "pactree -r <package>" provides. This prevents trouble to find what exactly needs a package. Like "why do I have hal installed?" then search, hal is needed by a, which is needed by b, which is needed by c, which in the end leads back to only gnome-color-chooser (true story). Pactree -r hal resolves that; pdi could do the same.

Offline

Board footer

Powered by FluxBB