backend/common/rhnLib.py | 8 --------
backend/server/rhnChannel.py | 5 ++---
client/tools/rhnpush/rhnpush_config.py | 17 +----------------
3 files changed, 3 insertions(+), 27 deletions(-)
New commits:
commit 2a1ef88f0308cee27ab8164d2a869936fd7c7fa1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Feb 1 14:35:19 2010 +0100
removed dead code; no more python 1.5...
diff --git a/client/tools/rhnpush/rhnpush_config.py
b/client/tools/rhnpush/rhnpush_config.py
index 70d07e0..fc8cb75 100644
--- a/client/tools/rhnpush/rhnpush_config.py
+++ b/client/tools/rhnpush/rhnpush_config.py
@@ -104,10 +104,7 @@ class rhnpushConfigParser:
def write(self, fileobj):
try:
- if hasattr(self.settings, "write"):
- self.settings.write(fileobj)
- else:
- _write(self.settings, fileobj)
+ self.settings.write(fileobj)
except IOError, e:
print "Config File Error: line %s, file %s: $s" % (e.lineno,
e.filename, e)
sys.exit(1)
@@ -148,15 +145,3 @@ class rhnpushConfigParser:
print "Option %s is being set to the default value of %s."
% (thiskey, self.options_defaults[thiskey])
self.__dict__[thiskey] = self.options_defaults[thiskey]
-#Used in Python 1.5.2 because its ConfigParser class doesn't have write().
-#settings needs to be a ConfigParser object.
-#fileobj is a fileobj that's ready to be written to.
-def _write(settings, fileobj):
- all_sections = settings.sections()
-
- for sect in all_sections:
- fileobj.write("[%s]\n" % (sect))
-
- for opt in settings.options(sect):
- fileobj.write("%s = %s\n" % (opt, settings.get(sect, opt)))
-
commit 6b0967ad917635378cba38650fb3e5373c2f32e9
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Feb 1 14:49:27 2010 +0100
removed dead code; no more python 1.5
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 12c4bd8..12c2704 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,11 +172,3 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
-
-def startswith(s, prefix):
- """
- Trivial function that I wish existed in python 1.5
- """
- return s[:len(prefix)] == prefix
-
-
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index e16cda9..88be7e1 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -24,7 +24,6 @@ from types import IntType, ListType, DictType
# common module
from common import log_debug, log_error, rhnFault, rhnException, rhnCache, rhnFlags, CFG
from common.rhnTranslate import _
-from common.rhnLib import startswith
from spacewalk.common import rhn_rpm
from rhnServer import server_lib
from rhnDependency import MakeEvrError
@@ -82,9 +81,9 @@ class BaseDatabaseObject:
self._row = None
def __getattr__(self, name):
- if startswith(name, 'get_'):
+ if name.startswith('get_'):
return rhnLib.CallableObj(name[4:], self._get)
- if startswith(name, 'set_'):
+ if name.startswith('set_'):
return rhnLib.CallableObj(name[4:], self._set)
raise AttributeError(name)
Show replies by date