py2deb examples

back

When we do :

p=Py2deb("packageName")

'p' acts like a dict, where the keys are the destination folder, and the value : a list of existing files.

p["/usr/share/deleteme"]=["file1.py","file2.png",]

(files "file1.py" and "file2.png" should be in the current execution path)

It will generate a "packageName" deb which will install files like that :

Relatives files are installed with their relative path, so something like this :

p["/usr/share/deleteme"]=["file1.py","data/file2.png",]

will produce :

It's possible to define files with absolute path too, like that :

p["/usr/share/deleteme"]=["file1.py","/home/me/file2.png",]

which will produce :

But it's possible to rename files, with the 'pipe trick', which can be very handy is some cases :

p["/usr/bin"]=["file1.py|executable",]
p["/usr/share/doc/me"]=["/home/me/mon_cv.htm|cv.html",]

which will produce :

It can be useful to relocate some files too, like that :

p["/usr/share/deleteme"]=["data/images/image.png|image.png","README|doc/french/readme.txt"]

which will produce :

At anytime, to see what will be produce, simple 'print p', it will print informations about current package 'p', and list where files will be.

In this case, if the folder 'test' contains file1.py and file2.py

from glob import glob
...
p["/usr/lib/aeff2"] = glob("test/*")
p["/usr/lib/aeff3"] = [i+"|"+i[5:] for i in glob("test/*")]
...
print p

will print :

[...]
/usr/lib/aeff2/test/file1.py
/usr/lib/aeff2/test/file2.py
/usr/lib/aeff3/file1.py (test/file1.py)
/usr/lib/aeff3/file2.py (test/file2.py)
[...]

when a line contains something in '()', it should warn you that the file was renamed/relocated, so the real path of the file is displayed between the '()'.

Just note that the two following commands should produce the same thing :

p["/usr/lib/hello"] = ["file1.png|data/file1.png",]
p["/usr/lib/hello/data"] = ["file1.png",]

something like this : /usr/lib/hello/data/file1.png

back

log in

manatlan