You are not logged in.
Pages: 1
Here's my code - aurgtk - the pygtk powered AUR manager. It was started as a joke ("hey, how to click AUR?!"), but I was also writting it to learn more about gtk programming. Anyway, here it is, not full of features, but mostly working
- Screenshot: http://wit.edu.pl/~husiatyn/screenshots/9.png
- Source code: http://wit.edu.pl/~husiatyn/code/aurgtk.tar.gz
- Git repo: http://husio.homelinux.com/gitweb/?p=au … ;a=summary
Python, pygtk and python-simplejson are required.
Last edited by Husio (2008-09-25 08:55:32)
Offline
thats cool!
edit: patch!
Enables the 'enter' key on the search text entry box.
diff --git a/src/gui/searchwindow.py b/src/gui/searchwindow.py
index 38e38a3..3546592 100644
--- a/src/gui/searchwindow.py
+++ b/src/gui/searchwindow.py
@@ -153,6 +153,7 @@ class SearchWindow(object):
self.search_box = gtk.HBox(False, 5)
self.search_button = gtk.Button(_("Search"))
self.search_entry = gtk.Entry()
+ self.search_entry.connect("activate", self.on_search_button_clicked)
self.search_box.pack_end(self.search_button, False, False)
self.search_box.pack_start(self.search_entry)
self.search_button.connect("clicked", self.on_search_button_clicked)
Last edited by iphitus (2008-09-25 10:10:50)
Offline
Done, thanks.
Any ideas how to easy check if file is plain text?
Offline
http://code.activestate.com/recipes/173220/
there was some discussion about this on here a long time ago, but i can't find it
i dunno how well that code above works
Offline
diff --git a/aurgtk/src/gui/__init__.py b/aurgkt/src/gui/__init__.py
diff --git a/aurgtk/src/gui/aboutwindow.py b/aurgkt/src/gui/aboutwindow.py
diff --git a/aurgtk/src/gui/downloadwindow.py b/aurgkt/src/gui/downloadwindow.py
index fe33d3e..084ac37 100644
--- a/aurgtk/src/gui/downloadwindow.py
+++ b/aurgkt/src/gui/downloadwindow.py
@@ -29,7 +29,7 @@ class DownloadWindow(object):
self.window.add(box)
# progressbar
self.progressbar = gtk.ProgressBar()
- self.progressbar.set_text("Downloading..")
+ self.progressbar.set_text(_("Downloading.."))
box.pack_start(self.progressbar)
# cancel button
self.button = gtk.Button(stock=gtk.STOCK_CANCEL)
@@ -45,14 +45,14 @@ class DownloadWindow(object):
gobject.idle_add(self.progressbar.set_text, fname)
gobject.idle_add(self.progressbar.set_fraction, i/f_len)
url = os.path.join(aur.AUR_FILES, app_name, app_name, fname)
- file_to = os.path.join(pdir, fname)
+ file_to = os.path.join(pdir, os.path.basename(fname))
urllib.urlretrieve(url, file_to)
interrupt_event.set()
self.window.destroy()
pdir = os.path.join(configuration.PKGBUILD_DOWNLOAD_PATH, app_name)
try:
- os.mkdir(pdir)
+ os.makedirs(pdir)
except OSError:
pass
interrupt_event = threading.Event()
diff --git a/aurgtk/src/gui/searchwindow.py b/aurgkt/src/gui/searchwindow.py
index 64a50a6..5376344 100644
--- a/aurgtk/src/gui/searchwindow.py
+++ b/aurgkt/src/gui/searchwindow.py
@@ -31,7 +31,7 @@ class AurListView(gtk.TreeView):
self.append_column(c_nr)
# name
self.COLUMN_NAME = 1
- c_name = gtk.TreeViewColumn(_('name'), renderer, text=self.COLUMN_NAME)
+ c_name = gtk.TreeViewColumn(_('Name'), renderer, text=self.COLUMN_NAME)
c_name.set_resizable(True)
c_name.set_sort_column_id(self.COLUMN_NAME)
self.append_column(c_name)
@@ -44,7 +44,7 @@ class AurListView(gtk.TreeView):
self.append_column(c_version)
# description
self.COLUMN_DESCRIPTION = 3
- c_description = gtk.TreeViewColumn('description', renderer,
+ c_description = gtk.TreeViewColumn(_('Description'), renderer,
text=self.COLUMN_DESCRIPTION)
c_description.set_resizable(True)
c_description.set_sort_column_id(self.COLUMN_DESCRIPTION)
@@ -114,9 +114,9 @@ class AurListMenu(gtk.Menu):
foo_list = aur.get_file_link_list(app_name)
foo_len = float(len(foo_list))
for i, url in enumerate(foo_list):
- name = url.split("/")[-1]
+ name = os.path.basename(url)
gobject.idle_add(sw.progressbar.set_fraction, i/foo_len)
- gobject.idle_add(sw.progressbar.set_text, "downloading: "+name)
+ gobject.idle_add(sw.progressbar.set_text, _("Downloading: "+name))
page = aur.get_file(url)
gobject.idle_add(sw.add_page,
showwindow.AurPage(name, page))
@@ -219,7 +219,7 @@ class SearchWindow(object):
def on_search_button_clicked(self, button):
def _search(pkg_name):
"Search given app name in AUR, update TreeView"
- gobject.idle_add(self.download_progressbar.set_text, "searching: " + pkg_name)
+ gobject.idle_add(self.download_progressbar.set_text, _("searching: " + pkg_name))
s_result = aur.search(s_data)
if not s_result:
self._hide_download_widgets()
@@ -267,7 +267,7 @@ class SearchWindow(object):
self.error_box.show()
time.sleep(timeout)
self.error_box.hide()
- self.error_label.set_text(message)
+ self.error_label.set_text(_(message))
threading.Thread(target=_show).start()
diff --git a/aurgtk/src/gui/showwindow.py b/aurgkt/src/gui/showwindow.py
changes were adding _() for some strings ;; _() added to show_error don't know if that affects consistency
fixed the downloader, it tried to download the file to pdir/url
changed *split*[-1] to os.path.basename
and capitalised some of the list headers
Offline
Done. Don't know how to use gettext yet, so _ function is only placeholder right now.
I've made mirror on http://github.com/husio/aurgtk/tree/master so if anyone wants to add few lines of code, feel free to email me so I could add another account to repository.
Offline
hihi. it's great! but i can't help noticing the irony of a AUR client not being in AUR
Offline
@Heller_Barde: Didn't thought someone would want to use is, but here's the PKGBUILD: http://aur.archlinux.org/packages.php?ID=21006 [+]
Offline
@Heller_Barde: Didn't thought someone would want to use is, but here's the PKGBUILD: http://aur.archlinux.org/packages.php?ID=21006 [+]
you're quick i didn't mean it as serious criticism or anything, but thank you very much *smile* I just saw that today in the morning and had to chuckle ^^
i just RMA'd my archlinux laptop today, so it will be some time until i will use your pkgbuild.
cheers Barde
Offline
Pages: 1