Table of Contents

Poldek unofficial Python bindings

Here's some information i managed to gather by looking at swig source and py code. A lot of help gave cli/test_cli.c, had no clue where to start from.

You may also find useful poldek/python/test.py from poldek cvs

poldek_ctx

import poldek
poldek.lib_init()
ctx = poldek.poldek_ctx()
ctx.load_config("/etc/poldek/poldek.conf")
ctx.setup()

CONFIGFILE string path to config file

>>> import poldekmod
>>> ctx.configure(poldekmod.POLDEK_CONF_PM, "vrpm")
1
>>> ctx.configure(poldekmod.POLDEK_CONF_CACHEDIR, "/tmp/cache")
1

sample

print ctx.get_avail_packages()

poldek_ts

poldek_ts(ctx, FLAGS)

where flags can be (from poldek_ts.c::poldek_ts_setf):

ts = poldek.poldek_ts(ctx, 0)
ts = poldek.poldek_ts(ctx, poldekmod.POLDEK_TS_INSTALL)
ts = poldek.poldek_ts(ctx, poldekmod.POLDEK_OP_GREEDY)

poclidek_ctx

cctx = poldek.poclidek_ctx(ctx)
cmd = cctx.rcmd_new(ts)

poclidek_rcmd

>>> rcmd = poldek.poclidek_rcmd(cctx, ts)
>>> rcmd.execline("ls xmms*")
1
>>> a = rcmd.get_packages()
>>> print a
[xmms-1.2.10-4, xmms-alarm-0.3.6-1, xmms-clxmms-0.6-4, xmms-devel-1.2.10-4, xmms-effect-liveice-1.0.0-7, xmms-effect-rva-0.7.6-4, xmms-effect-volnorm-0.4.1-1, xmms-general-audioscrobbler-0.3.6-1, xmms-general-crystality-0.92-4, xmms-general-goodnight-0.3.2-3, xmms-general-infopipe-1.3-25, xmms-general-lirc-1.2-5, xmms-general-status-1.0-4, xmms-general-xosd-2.2.10-1, xmms-gnome-mime-info-1.2.10-4, xmms-imms-1.1-1, xmms-input-cdaudio-1.2.10-4, xmms-input-faad2-2.0-5.3, xmms-input-faad2-2.0-6, xmms-input-flac-1.1.2-3, xmms-input-midi-0.03-4, xmms-input-mikmod-1.2.10-4, xmms-input-modplug-2.05-2, xmms-input-mpg123-1.2.10-4, xmms-input-musepack-1.2-1, xmms-input-nosefart-2.0-2, xmms-input-sap-0.4-3, xmms-input-sid-0.8.0beta10-3, xmms-input-sndfile-1.2-1, xmms-input-speex-0.9.1-1, xmms-input-tonegen-1.2.10-4, xmms-input-uade-1.03-1, xmms-input-vorbis-1.2.10-4, xmms-input-vqf-0.94-1, xmms-input-vtx-0.8.1-1, xmms-input-wav-1.2.10-4, xmms-input-wma-1.0.3-1, xmms-input-xmp-2.0.5-0.pre3.3, xmms-kde-3.1-2, xmms-libs-1.2.10-4, xmms-output-ALSA-1.2.10-4, xmms-output-OSS-1.2.10-4, xmms-output-arts-0.7.1-1, xmms-output-crossfade-0.3.8-1, xmms-output-disk-1.2.10-4, xmms-output-esd-1.2.10-4, xmms-output-jack-0.10-1, xmms-output-lame-0.2.2-3, xmms-output-ogg-0.2-3, xmms-shell-0.99.3-2, xmms-skin-2K-1.0-7, xmms-skin-Advanced-1.0-7, xmms-skin-BlackDawn-1.0-7, xmms-skin-BlueSteel-1.0-7, xmms-skin-Bluecurve-0.117-2, xmms-skin-Camel-1.0-7, xmms-skin-CrystalBastard-1.0-7, xmms-skin-Digitool-1.0-7, xmms-skin-ElectroPC-1.0-7, xmms-skin-Escalate-1.0-7, xmms-skin-ForcedToBe-1.0-7, xmms-skin-Industrial-0.2.34-7, xmms-skin-Kinwashi-Auriga-1.0-7, xmms-skin-Mercury-1.0-7, xmms-skin-Merregnon-1.0-7, xmms-skin-Plastik-1.0-7, xmms-skin-Relic-1.0-7, xmms-skin-Topaz-1.0-7, xmms-skin-WinampX-1.0-7, xmms-skin-aqua-1.0-4, xmms-skin-gorilla-1.0-5, xmms-skin-nvidia-1.0b-1, xmms-skins-1.2.10-4, xmms-skins2-1.0-7, xmms-static-1.2.10-4, xmms-visualization-GL-1.2.10-4, xmms-visualization-blur-scope-max-1.3-4, xmms-visualization-blursk-1.3-0.1, xmms-visualization-dflowers-1.2.1-3, xmms-visualization-dscope-1.3.1-3, xmms-visualization-dspectogram-1.2.1-3, xmms-visualization-dspectral-1.2.1-3, xmms-visualization-infinity-0.2-4, xmms-visualization-iris-0.12-1, xmms-visualization-jess-2.0.0-4, xmms-visualization-levelmeter-0.1-2, xmms-visualization-nebulus-0.6.0-1, xmms-visualization-palace-0.2.1-3, xmms-visualization-synaesthesia-0.0.3-3, xmms-visualization-vigor-0.1.1-1, xmms-wm-1.2.10-4, xmmsfind-0.5.1-1]
>>>