summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-08-03 08:44:54 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-08-03 08:44:54 +0000
commitfe89d597e3f73c82488d17a8be8a8b8c900127ed (patch)
tree16638137b0aa748f6e7927b6a623f7b2323c4e31
parentdaf13af88e15fa27c0d911e87210e897894c5b9d (diff)
downloadpython-apt-fe89d597e3f73c82488d17a8be8a8b8c900127ed.tar.gz
* API BREAK: follow PEP08 now
-rw-r--r--apt/cache.py66
-rw-r--r--apt/package.py102
-rw-r--r--apt/progress.py43
-rw-r--r--debian/changelog5
-rw-r--r--doc/examples/gui-inst.py20
-rw-r--r--doc/examples/inst.py2
-rw-r--r--python/progress.cc42
-rw-r--r--tests/apt-test.py8
-rw-r--r--tests/depcache.py2
9 files changed, 151 insertions, 139 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 23085603..0579b655 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -36,7 +36,7 @@ class Cache(object):
for callback in self._callbacks[name]:
apply(callback)
- def Open(self, progress):
+ def open(self, progress):
""" Open the package cache, after that it can be used like
a dictionary
"""
@@ -54,7 +54,7 @@ class Cache(object):
size=len(self._cache.Packages)
for pkg in self._cache.Packages:
if progress != None and last+100 < i:
- progress.Update(i/float(size)*100)
+ progress.update(i/float(size)*100)
last=i
# drop stuff with no versions (cruft)
if len(pkg.VersionList) > 0:
@@ -62,7 +62,7 @@ class Cache(object):
self._records, self, pkg)
i += 1
if progress != None:
- progress.Done()
+ progress.done()
self._runCallbacks("cache_post_open")
def __getitem__(self, key):
@@ -81,34 +81,34 @@ class Cache(object):
def keys(self):
return self._dict.keys()
- def GetChanges(self):
+ def getChanges(self):
""" Get the marked changes """
changes = []
for name in self._dict.keys():
p = self._dict[name]
- if p.MarkedUpgrade() or p.MarkedInstall() or p.MarkedDelete() or \
- p.MarkedDowngrade() or p.MarkedReinstall():
+ if p.markedUpgrade() or p.markedInstall() or p.markedDelete() or \
+ p.markedDowngrade() or p.markedReinstall():
changes.append(p)
return changes
- def Upgrade(self, DistUpgrade=False):
+ def upgrade(self, DistUpgrade=False):
""" Upgrade the all package, DistUpgrade will also install
new dependencies
"""
- self.CachePreChange()
+ self.cachePreChange()
self._depcache.Upgrade(DistUpgrade)
- self.CachePostChange()
+ self.cachePostChange()
- def Commit(self, fprogress, iprogress):
+ def commit(self, fprogress, iprogress):
""" Apply the marked changes to the cache """
self._depcache.Commit(fprogress, iprogress)
# cache changes
- def CachePostChange(self):
+ def cachePostChange(self):
" called internally if the cache has changed, emit a signal then "
self._runCallbacks("cache_post_change")
- def CachePreChange(self):
+ def cachePreChange(self):
""" called internally if the cache is about to change, emit
a signal then """
self._runCallbacks("cache_pre_change")
@@ -132,7 +132,7 @@ class Filter(object):
class MarkedChangesFilter(Filter):
""" Filter that returns all marked changes """
def apply(self, pkg):
- if pkg.MarkedInstall() or pkg.MarkedDelete() or pkg.MarkedUpgrade():
+ if pkg.markedInstall() or pkg.markedDelete() or pkg.markedUpgrade():
return True
else:
return False
@@ -147,8 +147,8 @@ class FilteredCache(object):
self.cache = Cache(progress)
else:
self.cache = cache
- self.cache.connect("cache_post_change", self.FilterCachePostChange)
- self.cache.connect("cache_post_open", self.FilterCachePostChange)
+ self.cache.connect("cache_post_change", self.filterCachePostChange)
+ self.cache.connect("cache_post_open", self.filterCachePostChange)
self._filtered = {}
self._filters = []
def __len__(self):
@@ -176,17 +176,17 @@ class FilteredCache(object):
self._filtered[pkg] = 1
break
- def SetFilter(self, filter):
+ def setFilter(self, filter):
" set the current active filter "
self._filters = []
self._filters.append(filter)
#self._reapplyFilter()
# force a cache-change event that will result in a refiltering
- self.cache.CachePostChange()
+ self.cache.cachePostChange()
- def FilterCachePostChange(self):
+ def filterCachePostChange(self):
" called internally if the cache changes, emit a signal then "
- #print "FilterCachePostChange()"
+ #print "filterCachePostChange()"
self._reapplyFilter()
# def connect(self, name, callback):
@@ -217,29 +217,29 @@ if __name__ == "__main__":
c.connect("cache_post_change", cache_post_changed)
print c.has_key("aptitude")
p = c["aptitude"]
- print p.Name()
+ print p.name()
print len(c)
for pkg in c.keys():
- x= c[pkg].Name()
+ x= c[pkg].name()
- c.Upgrade()
- changes = c.GetChanges()
+ c.upgrade()
+ changes = c.getChanges()
print len(changes)
for p in changes:
- #print p.Name()
- x = p.Name()
+ #print p.name()
+ x = p.name()
print "Testing filtered cache (argument is old cache)"
f = FilteredCache(c)
f.cache.connect("cache_pre_change", cache_pre_changed)
f.cache.connect("cache_post_change", cache_post_changed)
- f.cache.Upgrade()
- f.SetFilter(MarkedChangesFilter())
+ f.cache.upgrade()
+ f.setFilter(MarkedChangesFilter())
print len(f)
for pkg in f.keys():
- #print c[pkg].Name()
- x = f[pkg].Name()
+ #print c[pkg].name()
+ x = f[pkg].name()
print len(f)
@@ -247,11 +247,11 @@ if __name__ == "__main__":
f = FilteredCache(progress=OpTextProgress())
f.cache.connect("cache_pre_change", cache_pre_changed)
f.cache.connect("cache_post_change", cache_post_changed)
- f.cache.Upgrade()
- f.SetFilter(MarkedChangesFilter())
+ f.cache.upgrade()
+ f.setFilter(MarkedChangesFilter())
print len(f)
for pkg in f.keys():
- #print c[pkg].Name()
- x = f[pkg].Name()
+ #print c[pkg].name()
+ x = f[pkg].name()
print len(f)
diff --git a/apt/package.py b/apt/package.py
index 97752813..bae90b05 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -34,7 +34,7 @@ class Package(object):
pass
# helper
- def _LookupRecord(self, UseCandidate=True):
+ def _lookupRecord(self, UseCandidate=True):
""" internal helper that moves the Records to the right
position, must be called before _records is accessed """
if UseCandidate:
@@ -55,16 +55,16 @@ class Package(object):
return True
# basic information
- def Name(self):
+ def name(self):
""" return the name of the package """
return self._pkg.Name
- def ID(self):
+ def id(self):
""" return a uniq ID for the pkg, can be used to store
additional information about the pkg """
return self._pkg.ID
- def InstalledVersion(self):
+ def installedVersion(self):
""" return the installed version as string """
ver = self._pkg.CurrentVer
if ver != None:
@@ -72,7 +72,7 @@ class Package(object):
else:
return None
- def CandidateVersion(self):
+ def candidateVersion(self):
""" return the candidate version as string """
ver = self._depcache.GetCandidateVer(self._pkg)
if ver != None:
@@ -80,20 +80,20 @@ class Package(object):
else:
return None
- def SourcePackageName(self):
+ def sourcePackageName(self):
""" return the source package name as string """
- self._LookupRecord()
+ self._lookupRecord()
src = self._records.SourcePkg
if src != "":
return src
else:
return self._pkg.Name
- def Section(self):
+ def section(self):
""" return the section of the package"""
return self._pkg.Section
- def Priority(self, UseCandidate=True):
+ def priority(self, UseCandidate=True):
""" return the priority """
if UseCandidate:
ver = self._depcache.GetCandidateVer(self._pkg)
@@ -104,14 +104,14 @@ class Package(object):
else:
return None
- def Summary(self):
+ def summary(self):
""" return the short description (one-line summary) """
- self._LookupRecord()
+ self._lookupRecord()
return self._records.ShortDesc
- def Description(self, format=False):
+ def description(self, format=False):
""" return the long description """
- self._LookupRecord()
+ self._lookupRecord()
if format:
desc = ""
for line in string.split(self._records.LongDesc, "\n"):
@@ -125,30 +125,30 @@ class Package(object):
return self._records.LongDesc
# depcache state
- def MarkedInstall(self):
+ def markedInstall(self):
return self._depcache.MarkedInstall(self._pkg)
- def MarkedUpgrade(self):
+ def markedUpgrade(self):
return self._depcache.MarkedUpgrade(self._pkg)
- def MarkedDelete(self):
+ def markedDelete(self):
return self._depcache.MarkedDelete(self._pkg)
- def MarkedKeep(self):
+ def markedKeep(self):
return self._depcache.MarkedKeep(self._pkg)
- def MarkedDowngrade(self):
+ def markedDowngrade(self):
return self._depcache.MarkedDowngrade(self._pkg)
- def MarkedReinstall(self):
+ def markedReinstall(self):
return self._depcache.MarkedReinstall(self._pkg)
- def IsInstalled(self):
+ def isInstalled(self):
return (self._pkg.CurrentVer != None)
- def IsUpgradable(self):
- return self.IsInstalled() and self._depcache.IsUpgradable(self._pkg)
+ def isUpgradable(self):
+ return self.isInstalled() and self._depcache.IsUpgradable(self._pkg)
# depcache action
- def MarkKeep(self):
- self._pcache.CachePreChange()
+ def markKeep(self):
+ self._pcache.cachePreChange()
self._depcache.MarkKeep(self._pkg)
- self._pcache.CachePostChange()
- def MarkDelete(self, autoFix=True):
- self._pcache.CachePreChange()
+ self._pcache.cachePostChange()
+ def markDelete(self, autoFix=True):
+ self._pcache.cachePreChange()
self._depcache.MarkDelete(self._pkg)
# try to fix broken stuffsta
if autoFix and self._depcache.BrokenCount > 0:
@@ -158,9 +158,9 @@ class Package(object):
Fix.Remove(self._pkg)
Fix.InstallProtect()
Fix.Resolve()
- self._pcache.CachePostChange()
- def MarkInstall(self, autoFix=True):
- self._pcache.CachePreChange()
+ self._pcache.cachePostChange()
+ def markInstall(self, autoFix=True):
+ self._pcache.cachePreChange()
self._depcache.MarkInstall(self._pkg)
# try to fix broken stuff
if autoFix and self._depcache.BrokenCount > 0:
@@ -168,29 +168,29 @@ class Package(object):
fixer.Clear(self._pkg)
fixer.Protect(self._pkg)
fixer.Resolve(True)
- self._pcache.CachePostChange()
- def MarkUpgrade(self):
- if self.IsUpgradable():
+ self._pcache.cachePostChange()
+ def markUpgrade(self):
+ if self.isUpgradable():
self.MarkInstall()
# FIXME: we may want to throw a exception here
sys.stderr.write("MarkUpgrade() called on a non-upgrable pkg")
# size
- def PackageSize(self, UseCandidate=True):
+ def packageSize(self, UseCandidate=True):
if UseCandidate:
ver = self._depcache.GetCandidateVer(self._pkg)
else:
ver = self._pkg.GetCurrentVer
return ver.Size
- def InstalledSize(self, UseCandidate=True):
+ def installedSize(self, UseCandidate=True):
if UseCandidate:
ver = self._depcache.GetCandidateVer(self._pkg)
else:
ver = self._pkg.GetCurrentVer
return ver.InstalledSize
- def Commit(self, fprogress, iprogress):
+ def commit(self, fprogress, iprogress):
self._depcache.Commit(fprogress, iprogress)
# self-test
@@ -203,18 +203,18 @@ if __name__ == "__main__":
iter = cache["apt-utils"]
pkg = Package(cache, depcache, records, None, iter)
- print "Name: %s " % pkg.Name()
- print "Installed: %s " % pkg.InstalledVersion()
- print "Candidate: %s " % pkg.CandidateVersion()
- print "SourcePkg: %s " % pkg.SourcePackageName()
- print "Section: %s " % pkg.Section()
- print "Priority (Candidate): %s " % pkg.Priority()
- print "Priority (Installed): %s " % pkg.Priority(False)
- print "Summary: %s" % pkg.Summary()
- print "Description:\n%s" % pkg.Description()
- print "Description (formated) :\n%s" % pkg.Description(True)
- print "InstalledSize: %s " % pkg.InstalledSize()
- print "PackageSize: %s " % pkg.PackageSize()
+ print "Name: %s " % pkg.name()
+ print "Installed: %s " % pkg.installedVersion()
+ print "Candidate: %s " % pkg.candidateVersion()
+ print "SourcePkg: %s " % pkg.sourcePackageName()
+ print "Section: %s " % pkg.section()
+ print "Priority (Candidate): %s " % pkg.priority()
+ print "Priority (Installed): %s " % pkg.priority(False)
+ print "Summary: %s" % pkg.summary()
+ print "Description:\n%s" % pkg.description()
+ print "Description (formated) :\n%s" % pkg.description(True)
+ print "InstalledSize: %s " % pkg.installedSize()
+ print "PackageSize: %s " % pkg.packageSize()
# now test install/remove
import apt
@@ -224,9 +224,9 @@ if __name__ == "__main__":
print "Running install on random upgradable pkgs with AutoFix: %s " % i
for name in cache.keys():
pkg = cache[name]
- if pkg.IsUpgradable():
+ if pkg.isUpgradable():
if random.randint(0,1) == 1:
- pkg.MarkInstall(i)
+ pkg.markInstall(i)
print "Broken: %s " % cache._depcache.BrokenCount
print "InstCount: %s " % cache._depcache.InstCount
@@ -238,7 +238,7 @@ if __name__ == "__main__":
for name in cache.keys():
if random.randint(0,1) == 1:
try:
- cache[name].MarkDelete(i)
+ cache[name].markDelete(i)
except SystemError:
print "Error trying to remove: %s " % name
print "Broken: %s " % cache._depcache.BrokenCount
diff --git a/apt/progress.py b/apt/progress.py
index d04d64e4..1520e34e 100644
--- a/apt/progress.py
+++ b/apt/progress.py
@@ -22,65 +22,76 @@
import sys
class OpProgress:
- """ Abstract class to implement reporting on cache opening """
+ """ Abstract class to implement reporting on cache opening
+ Subclass this class to implement simple Operation progress reporting
+ """
def __init__(self):
pass
- def Update(self, percent):
+ def update(self, percent):
pass
- def Done(self):
+ def done(self):
pass
class OpTextProgress(OpProgress):
""" A simple text based cache open reporting class """
def __init__(self):
OpProgress.__init__(self)
- def Update(self, percent):
+ def update(self, percent):
sys.stdout.write("\r%s: %.2i " % (self.Op,percent))
sys.stdout.flush()
- def Done(self):
+ def done(self):
sys.stdout.write("\r%s: Done\n" % self.Op)
class FetchProgress:
+ """ Report the download/fetching progress
+ Subclass this class to implement fetch progress reporting
+ """
def __init__(self):
pass
- def Start(self):
+ def start(self):
pass
- def Stop(self):
+ def stop(self):
pass
- def UpdateStatus(self, uri, descr, shortDescr, status):
+ def updateStatus(self, uri, descr, shortDescr, status):
pass
- def Pulse(self):
+ def pulse(self):
pass
- def MediaChange(self, medium, drive):
+ def mediaChange(self, medium, drive):
pass
class InstallProgress:
+ """ Report the install progress
+ Subclass this class to implement install progress reporting
+ """
def __init__(self):
pass
- def StartUpdate(self):
+ def startUpdate(self):
pass
- def FinishUpdate(self):
+ def finishUpdate(self):
pass
- def UpdateInterface(self):
+ def updateInterface(self):
pass
class CdromProgress:
+ """ Report the cdrom add progress
+ Subclass this class to implement cdrom add progress reporting
+ """
def __init__(self):
pass
- def Update(self, text, step):
+ def update(self, text, step):
""" update is called regularly so that the gui can be redrawn """
pass
- def AskCdromName(self):
+ def askCdromName(self):
pass
- def ChangeCdrom(self):
+ def changeCdrom(self):
pass
# module test code
diff --git a/debian/changelog b/debian/changelog
index c46b89fd..140c067d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-apt (0.6.12ubuntu1mvo1) breezy; urgency=low
+python-apt (0.6.13) breezy; urgency=low
* support for Marked{Downgrade,Reinstall} added
* Cache.GetChanges() added
@@ -6,7 +6,8 @@ python-apt (0.6.12ubuntu1mvo1) breezy; urgency=low
* added "connect()" to {Pre,Post}CacheChange
* support for the PkgProblemResolver
* added tests/ directory with various tests for the code
-
+ * made the apt/ python code pep8 conform
+
-- Michael Vogt <michael.vogt@ubuntu.com> Wed, 1 Jun 2005 14:57:57 +0200
python-apt (0.6.12ubuntu1) breezy; urgency=low
diff --git a/doc/examples/gui-inst.py b/doc/examples/gui-inst.py
index 26164b0c..677fee8b 100644
--- a/doc/examples/gui-inst.py
+++ b/doc/examples/gui-inst.py
@@ -12,7 +12,7 @@ import gtk
import vte
import time
-from progress import OpProgress, FetchProgress, InstallProgress
+from apt.progress import OpProgress, FetchProgress, InstallProgress
class GuiFetchProgress(gtk.Window, FetchProgress):
def __init__(self):
@@ -27,14 +27,14 @@ class GuiFetchProgress(gtk.Window, FetchProgress):
self.vbox.pack_start(self.progress)
self.vbox.pack_start(self.label)
self.resize(300,100)
- def Start(self):
+ def start(self):
self.progress.set_fraction(0)
self.show()
- def Stop(self):
+ def stop(self):
self.hide()
- def Pulse(self):
- self.label.set_text("Speed: %s/s" % apt_pkg.SizeToStr(self.CurrentCPS))
- self.progress.set_fraction(self.CurrentBytes/self.TotalBytes)
+ def pulse(self):
+ self.label.set_text("Speed: %s/s" % apt_pkg.SizeToStr(self.currentCPS))
+ self.progress.set_fraction(self.CurrentBytes/self.totalBytes)
while gtk.events_pending():
gtk.main_iteration()
@@ -45,15 +45,15 @@ class TermInstallProgress(InstallProgress, gtk.Window):
self.term = vte.Terminal()
self.term.show()
self.add(self.term)
- def Start(self):
+ def start(self):
self.progress.set_fraction(0)
self.show()
- def Stop(self):
+ def stop(self):
self.hide()
- def UpdateInterface(self):
+ def updateInterface(self):
while gtk.events_pending():
gtk.main_iteration()
- def FinishUpdate(self):
+ def finishUpdate(self):
sys.stdin.readline()
def fork(self):
return self.term.forkpty()
diff --git a/doc/examples/inst.py b/doc/examples/inst.py
index 6b3ade25..3cc4094e 100644
--- a/doc/examples/inst.py
+++ b/doc/examples/inst.py
@@ -5,7 +5,7 @@ import apt_pkg
import sys, os
import copy
-from progress import OpProgress, FetchProgress, InstallProgress
+from apt.progress import OpProgress, FetchProgress, InstallProgress
# init
diff --git a/python/progress.cc b/python/progress.cc
index b7c5854e..3439bfd8 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -53,21 +53,21 @@ void PyOpProgress::Update()
PyObject *o;
o = Py_BuildValue("s", Op.c_str());
- PyObject_SetAttrString(callbackInst, "Op", o);
+ PyObject_SetAttrString(callbackInst, "op", o);
o = Py_BuildValue("s", SubOp.c_str());
- PyObject_SetAttrString(callbackInst, "SubOp", o);
+ PyObject_SetAttrString(callbackInst, "subOp", o);
o = Py_BuildValue("b", MajorChange);
- PyObject_SetAttrString(callbackInst, "MajorChange", o);
+ PyObject_SetAttrString(callbackInst, "majorChange", o);
// Build up the argument list...
PyObject *arglist = Py_BuildValue("(f)", Percent);
if(CheckChange(0.05))
- RunSimpleCallback("Update", arglist);
+ RunSimpleCallback("update", arglist);
};
void PyOpProgress::Done()
{
- RunSimpleCallback("Done");
+ RunSimpleCallback("done");
}
@@ -85,7 +85,7 @@ bool PyFetchProgress::MediaChange(string Media, string Drive)
//std::cout << "MediaChange" << std::endl;
PyObject *arglist = Py_BuildValue("(ss)", Media.c_str(), Drive.c_str());
PyObject *result;
- RunSimpleCallback("MediaChange", arglist, &result);
+ RunSimpleCallback("mediaChange", arglist, &result);
bool res = true;
if(!PyArg_Parse(result, "b", &res))
@@ -101,7 +101,7 @@ void PyFetchProgress::UpdateStatus(pkgAcquire::ItemDesc &Itm, int status)
{
//std::cout << "UpdateStatus: " << Itm.URI << " " << status << std::endl;
PyObject *arglist = Py_BuildValue("(sssi)", Itm.URI.c_str(), Itm.Description.c_str(), Itm.ShortDesc.c_str(), status);
- RunSimpleCallback("UpdateStatus", arglist);
+ RunSimpleCallback("updateStatus", arglist);
}
void PyFetchProgress::IMSHit(pkgAcquire::ItemDesc &Itm)
@@ -128,7 +128,7 @@ void PyFetchProgress::Start()
{
//std::cout << "Start" << std::endl;
pkgAcquireStatus::Start();
- RunSimpleCallback("Start");
+ RunSimpleCallback("start");
}
@@ -136,7 +136,7 @@ void PyFetchProgress::Stop()
{
//std::cout << "Stop" << std::endl;
pkgAcquireStatus::Stop();
- RunSimpleCallback("Stop");
+ RunSimpleCallback("stop");
}
// FIXME: it should just set the attribute for
@@ -152,17 +152,17 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
// set stats
PyObject *o;
o = Py_BuildValue("f", CurrentCPS);
- PyObject_SetAttrString(callbackInst, "CurrentCPS", o);
+ PyObject_SetAttrString(callbackInst, "currentCPS", o);
o = Py_BuildValue("f", CurrentBytes);
- PyObject_SetAttrString(callbackInst, "CurrentBytes", o);
+ PyObject_SetAttrString(callbackInst, "currentBytes", o);
o = Py_BuildValue("i", CurrentItems);
- PyObject_SetAttrString(callbackInst, "CurrentItems", o);
+ PyObject_SetAttrString(callbackInst, "currentItems", o);
o = Py_BuildValue("i", TotalItems);
- PyObject_SetAttrString(callbackInst, "TotalItems", o);
+ PyObject_SetAttrString(callbackInst, "totalItems", o);
o = Py_BuildValue("f", TotalBytes);
- PyObject_SetAttrString(callbackInst, "TotalBytes", o);
+ PyObject_SetAttrString(callbackInst, "totalBytes", o);
- RunSimpleCallback("Pulse");
+ RunSimpleCallback("pulse");
// this can be canceld by returning false
@@ -175,17 +175,17 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
void PyInstallProgress::StartUpdate()
{
- RunSimpleCallback("StartUpdate");
+ RunSimpleCallback("startUpdate");
}
void PyInstallProgress::UpdateInterface()
{
- RunSimpleCallback("UpdateInterface");
+ RunSimpleCallback("updateInterface");
}
void PyInstallProgress::FinishUpdate()
{
- RunSimpleCallback("FinishUpdate");
+ RunSimpleCallback("finishUpdate");
}
pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm)
@@ -251,14 +251,14 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm)
void PyCdromProgress::Update(string text, int current)
{
PyObject *arglist = Py_BuildValue("(si)", text.c_str(), current);
- RunSimpleCallback("Update", arglist);
+ RunSimpleCallback("update", arglist);
}
bool PyCdromProgress::ChangeCdrom()
{
PyObject *arglist = Py_BuildValue("()");
PyObject *result;
- RunSimpleCallback("ChangeCdrom", arglist, &result);
+ RunSimpleCallback("changeCdrom", arglist, &result);
bool res = true;
if(!PyArg_Parse(result, "b", &res))
@@ -272,7 +272,7 @@ bool PyCdromProgress::AskCdromName(string &Name)
{
PyObject *arglist = Py_BuildValue("()");
PyObject *result;
- RunSimpleCallback("AskCdromName", arglist, &result);
+ RunSimpleCallback("askCdromName", arglist, &result);
const char *new_name;
bool res;
diff --git a/tests/apt-test.py b/tests/apt-test.py
index 45ecad98..c44d3117 100644
--- a/tests/apt-test.py
+++ b/tests/apt-test.py
@@ -6,9 +6,9 @@ if __name__ == "__main__":
print cache
for name in cache.keys():
pkg = cache[name]
- if pkg.IsUpgradable():
- pkg.MarkInstall()
- for pkg in cache.GetChanges():
+ if pkg.isUpgradable():
+ pkg.markInstall()
+ for pkg in cache.getChanges():
#print pkg.Name()
pass
print "Broken: %s " % cache._depcache.BrokenCount
@@ -19,6 +19,6 @@ if __name__ == "__main__":
for name in cache.keys():
import random
if random.randint(0,1) == 1:
- cache[name].MarkDelete()
+ cache[name].markDelete()
print "Broken: %s " % cache._depcache.BrokenCount
print "DelCount: %s " % cache._depcache.DelCount
diff --git a/tests/depcache.py b/tests/depcache.py
index f5deed33..f4821b4f 100644
--- a/tests/depcache.py
+++ b/tests/depcache.py
@@ -30,7 +30,7 @@ def main():
if depcache.MarkedInstall(p):
depcache.MarkKeep(p)
if depcache.InstCount != 0:
- print "Error undoing the selection for %s" % x
+ print "Error undoing the selection for %s (InstCount: %s)" % (x,depcache.InstCount)
print "\r%i/%i=%.3f%% " % (i,all,(float(i)/float(all)*100)),
print