You are not logged in.
I put up a screenie of my prototype,
but the point with libpypac/libpysrc is that you should code your own frontend, 8)
arch + gentoo + initng + python = enlisy
Offline
nice stuff xerxes2. Any links to screenshots will be appreciated! Shame that only one person in this thread doesn't seem to agree with you. User contributions are great (one day I'll do something...sniff)
There is no spoon in Arch...
Offline
I put up a screenie of my prototype,
but the point with libpypac/libpysrc is that you should code your own frontend, Cool
True, but seeing other peoples results is still nice!
There is no spoon in Arch...
Offline
there is a link to a screenie in thr first post if that's what you're looking for,
arch + gentoo + initng + python = enlisy
Offline
right! completely missed out *stupid*
There is no spoon in Arch...
Offline
well, it was stupidly placed by me, I move it to the top instead,
arch + gentoo + initng + python = enlisy
Offline
i got inspired by team arch over at linuxtag so i fixed a few things in libpypac and added a few functions,
i also wrote a console frontend(lazy-pac-cli) which will also work as a much better manual for libpypac than the gui frontend which is cluttered by gtk code,
special thanks to iphitus for giving me a simple sollution for a nasty problem,
arch + gentoo + initng + python = enlisy
Offline
No problem, I need to use libpypac for the gtk frontend dibble requested. I'll be thanking you!
iphitus
Offline
and added a few functions
I updated my install have I haven't had a chance to check out these new functions yet Thanks for the work but
Offline
i think of putting that database-optimize function in libpypac,
i'm so bloody lazy so i ask first if someone else could do it,
it can't be more than 10 lines of code ...
arch + gentoo + initng + python = enlisy
Offline
i don't know exactly how the filesystem works,
something like this maybe:
# Optimize packagedatabase
def opt_packdb():
tar = tarfile.open(root_dir + "packdb.tar", "w")
tar.add(root_dir)
tar.close()
tar = tarfile.open(root_dir + "packdb.tar", "r")
for i in tar:
tar.extract(i, "/")
tar.close()
arch + gentoo + initng + python = enlisy
Offline
Offline
i don't know how to use that anyway iphitus,
all i do in the other function is to tar it down and then tar it up again,
is that enough or should there be more things done?
arch + gentoo + initng + python = enlisy
Offline
Shutil is just coping and moving functions.
All you really need to do is,
import shutil
shutil.copytree(src, destination)
shutil.rmtree(src)
shutil.copytree(destination,src)
mind you.... there's no error checking whatsoever in that, but thats what you'd have to do.
iphitus
Offline
just copy the files like that won't copy them physicly,
isn't that just a change in the filesystems journals?
arch + gentoo + initng + python = enlisy
Offline
Please can we have your PKGBUILDs in Aur
I'm sure many Archers would love to try them ;-)
Mr Green
Offline
they can be found on my site,
there are pkgbuilds for everything,
it's better so people don't think it's 'official' software,
the packages uses distutils now so they compiles to bytecode when you install them,
lazy-edit is a must for all l33t editing,
arch + gentoo + initng + python = enlisy
Offline
lazy-edit should be in community ;-)
Mr Green
Offline
putting stuff in AUR doesn't make it official, it just makes it easier to find. :-P
Offline
you put it AUR every Arch user will vote for it .....
oops mentioned voting :oops:
Mr Green
Offline
Some things I think should be added to libpypac:
Ability to list packages in a group. This could sortof be done with checking the deps, but then you might get other deps as well.
Ability to check if a package is in a group.
Better error handling in pack_info(), I get exceptions on some packages because of poorly detailed packages. This is not really a problem with libpypac but still. This is the exception I get from user repos
Traceback (most recent call last):
File "./paku-gui.py", line 175, in on_TreePkgsIn_select
desc, deps = pac.pkginfo(model.get_value(iter,0), pac.repos)
File "/home/lunke/Projekt/paku/paku_base.py", line 94, in pkginfo
ret = libpypac.pack_info(pkgname, repos)
File "/usr/lib/python2.4/site-packages/libpypac.py", line 1599, in pack_info
index_next = package_desc_list.index("%CSIZE%")
ValueError: list.index(x): x not in list
Abillity to list packages that are not installed. I use this function for my frontend, but I guess it could do a bit pollishing. Use whatever you wish.
def pkglist(self, repos):
dir_local = "/var/lib/pacman/"
installedpkgs = self.listinstalled()
pkgname, pkgver, pkgrel, pkgrepo = [], [], [], []
for i in range(0,len(repos)):
repos[i] = repos[i].lstrip("[")
repos[i] = repos[i].rstrip("]")
list = os.listdir(dir_local + repos[i])
list.sort(lambda x,y : cmp (x.lower(), y.lower()))
for dir in list:
if dir in installedpkgs: continue
_item = dir.split("-")
version = _item[len(_item)-2]
release = _item[len(_item)-1]
_item = _item[:-2]
name = ""
for n in range(0,len(_item)):
name += "-" + _item[n]
name = name.lstrip("-")
if release == ".lastupdate": continue
pkgname.append(name)
pkgver.append(version)
pkgrel.append(release)
pkgrepo.append(repos[i])
return pkgname, pkgver, pkgrel, pkgrepo
Offline
hello lunke,
i've put the stuff in pack_info inside try statements to avoid errors, hope it works,
and for listing not installed packages i modified your function to fit into libpypac,
# List not installed packages (idea and initial code submitted by lunke)
def list_not_installed(server_list):
localpkg_list = os.listdir(root_dir + "local")
localpkg_list.sort(lambda x,y : cmp (x.lower(), y.lower()))
name_list, ver_list, rel_list, repo_list = [], [], [], []
for k in server_list:
h = k.lstrip("[").rstrip("]")
h_list = os.listdir(root_dir + h)
h_list.sort(lambda x,y : cmp (x.lower(), y.lower()))
try:
h_list.remove(".lastupdate")
except:
pass
for g in h_list:
mode = "0"
g_name, g_ver, g_rel = get_name(g)
for i in localpkg_list:
if i.startswith(g_name):
i_name, i_ver , i_rel = get_name(i)
if g_name == i_name:
mode = "1"
# This line doesn't work if packages exist on different servers(e.g if you use testing)
localpkg_list.remove(i)
break
if mode == "0":
name_list.append(g_name)
ver_list.append(g_ver)
rel_list.append(g_rel)
repo_list.append(h)
return name_list, ver_list, rel_list, repo_list
you can find a new version of libpypac at my site, if you want to change something just submit some code and i throw it in there,
arch + gentoo + initng + python = enlisy
Offline
Ability to list packages in a group. This could sortof be done with checking the deps, but then you might get other deps as well.
done, just check lazy-pac-cli for info,
Ability to check if a package is in a group.
on the todo list, i also went over the whole libpypac and cleaned it up a bit, it's 1656 lines now so it's nice if there is not so much crap in there,
arch + gentoo + initng + python = enlisy
Offline
Found a bug in the download function, atleast I think so.
for s in conf_list_new:
if s.startswith("["):
if s != "[" + repo + "]":
break
should be:
for s in conf_list_new:
if s.startswith("["):
if s != "[" + repo + "]":
continue
Otherwise you won't be able to download from servers other then the one that is first in conf_list_new.
Offline
i can't see that bug lunke, i just tried it with broken serverstrings and it worked,
those lines are for handling multiple listings of the same server,
conf_list_new =[ '[current]' '[current]', 'Server = ftp://******', ..., '[extra]', ...]
this is/was pacmans default layout, one in pacman.conf and one in the serverfile,
arch + gentoo + initng + python = enlisy
Offline