def __init__(self, source_name = None, source_path = None, verbose = 1, config = None): ctx = poldek.poldek_ctx() self._cb = PyldekCallbacks() self._progress = vfileProgress() ctx.set_callbacks(self._cb) ctx.set_vfile_progress(self._progress) ctx.set_verbose(verbose) src = None if source_name: # -n source_name ? print "## Configured %s" % source_name src = poldek.source(source_name) ctx.configure(ctx.CONF_SOURCE, src) if source_path: # -s source_name ? print "## Configured %s" % source_path src = poldek.source(None, None, source_path, None) ctx.configure(ctx.CONF_SOURCE, src) ctx.load_config() if not ctx.setup(): raise RuntimeError, "poldek setup failed" self.ctx = ctx self.cctx = poldek.poclidek_ctx(ctx)
def __init__(self, source_name=None, source_path=None, verbose=1, config=None): ctx = poldek.poldek_ctx() self._cb = PyldekCallbacks() self._progress = vfileProgress() ctx.set_callbacks(self._cb) ctx.set_vfile_progress(self._progress) ctx.set_verbose(verbose) src = None if source_name: # -n source_name ? print "## Configured %s" % source_name src = poldek.source(source_name) ctx.configure(ctx.CONF_SOURCE, src) if source_path: # -s source_name ? print "## Configured %s" % source_path src = poldek.source(None, None, source_path, None) ctx.configure(ctx.CONF_SOURCE, src) ctx.load_config() if not ctx.setup(): raise RuntimeError, "poldek setup failed" self.ctx = ctx self.cctx = poldek.poclidek_ctx(ctx)
def __init__(self): ctx = poldek.poldek_ctx() ctx.load_config() if not ctx.setup(): raise RuntimeError, "poldek setup failed" self.ctx = ctx self.cctx = poldek.poclidek_ctx(ctx)
def __init__(self): '''Prepare poldek config and repositories''' self.ctx = poldek.poldek_ctx() self.cctx = poldek.poclidek_ctx(self.ctx) self.ctx.load_config() try: self.ctx.setup() except: sys.exit(_('Poldek setup error.')) self.load_packages()
def get_options(): parser = OptionParser() parser.add_option("-n", "--sn", dest="source") (options, args) = parser.parse_args() return options locale.setlocale(locale.LC_ALL, '') options = get_options() if not options.source: print "no source specified" sys.exit(1) poldek.lib_init() ctx = poldek.poldek_ctx() #poldek_set_verbose(1) src = poldek.source(options.source) ctx.configure(ctx.CONF_SOURCE, src) ctx.load_config() if not ctx.setup(): print "poldek setup failed" sys.exit(1) print "Loading packages..." arr = ctx.get_avail_packages() print "Loaded %d packages" % len(arr) if len(arr) == 0: sys.exit(0) a = qt.QApplication(sys.argv)