New conf.py variables.
[AurShell.git] / plugin / aur2.py
blobec3ed207d24c28d952da44bfc96132613a234a10
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("aur2 search:", color="GREEN", newline=True)
31 self.put("TODO, but AUR2 isn't readu yet.")
33 def do_upgrade(self, *ignore):
34 """Upgrade packages from AUR"""
35 #TODO 2008-02-11 15:35:28
36 for pkg in os.popen("pacman -Qm"):
37 pkg, ver = pkg.split()
38 self.put(" }-->", "GREEN", False)
39 self.put(pkg.ljust(32), "green", False)
40 self.put(ver, newline=True)