Repo moved to http://github.com/husio/aurshell/tree/master
[AurShell.git] / plugin / aur2.py
blob8c014c307e0acde94e5be70444d505015290653a
1 #!/usr/bin/python
2 # -*- coding: utf-8-*-
4 import os
7 class aur(object):
8 """
9 Search and build packages with PKGBUILDs from AUR.
10 As for now, it's not ready to use. AUR2 need to be
11 done first.
12 """
13 def __init__(self, put, conf):
14 self.conf = conf
15 self.put = put
17 def do_seturl(self, url=None, *ignore):
18 """Set non-default url for AUR database"""
19 if not url:
20 self.put("AUR url: ", "GREEN", False)
21 self.put(self.conf.aur_url)
22 else:
23 self.conf.aur_url = url
24 self.put("New AUR url: ", "GREEN", False)
25 self.put(self.conf.aur_url)
27 def do_search(self, *args):
28 """Search package with <arg list> in it's name or description"""
29 #TODO 2008-02-11 15:35:33
30 self.put("TODO", "RED", True)
31 self.put("AUR2 search:", color="GREEN")
32 self.put(" ".join(args))
35 def do_upgrade(self, *ignore):
36 """Upgrade packages from AUR"""
37 #TODO 2008-02-11 15:35:28
38 self.put("TODO", "RED", True)
39 for pkg in os.popen("pacman -Qm"):
40 pkg, ver = pkg.split()
41 self.put(" }-->", "GREEN", False)
42 self.put(pkg.ljust(32), "green", False)
43 self.put(ver, newline=True)