diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-02 12:56:26 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-02 12:56:26 +0000 |
| commit | 442066f04db10be923c15455d16155358a6d5321 (patch) | |
| tree | c8c9e870a89ea0630ecbe6ac08b661788d102839 | |
| parent | 41006b0fd874a862195b918fad17a7ae04f4fe57 (diff) | |
| download | python-apt-442066f04db10be923c15455d16155358a6d5321.tar.gz | |
* started to implement a more flexible config file approach
| -rw-r--r-- | DistUpgrade/DistUpgrade.cfg | 4 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 14 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewNonInteractive.py | 3 |
3 files changed, 14 insertions, 7 deletions
diff --git a/DistUpgrade/DistUpgrade.cfg b/DistUpgrade/DistUpgrade.cfg new file mode 100644 index 00000000..979d7c0c --- /dev/null +++ b/DistUpgrade/DistUpgrade.cfg @@ -0,0 +1,4 @@ +[Distro] +From=breezy +To=Dapper +ValidOrigin=Ubuntu diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index ca43e80c..1ba0f7e0 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -28,8 +28,8 @@ import subprocess import logging import re import statvfs +import ConfigParser -from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp from SoftwareProperties.aptsources import SourcesList, SourceEntry from gettext import gettext as _ from DistUpgradeCache import MyCache @@ -42,13 +42,13 @@ class DistUpgradeControler(object): self._view.updateStatus(_("Reading cache")) self.cache = None + self.config = ConfigParser.ConfigParser() + self.config.read(['DistUpgrade.cfg']) + # some constants here - #self.fromDist = "hoary" - #self.toDist = "breezy" - self.fromDist = "breezy" - self.toDist = "dapper" - - self.origin = "Ubuntu" + self.fromDist = self.config.get("Distro","From") + self.toDist = self.config.get("Distro","To") + self.origin = self.config.get("Distro","ValidOrigin") # forced obsoletes self.forced_obsoletes = [] diff --git a/DistUpgrade/DistUpgradeViewNonInteractive.py b/DistUpgrade/DistUpgradeViewNonInteractive.py index f77d3d43..e8236565 100644 --- a/DistUpgrade/DistUpgradeViewNonInteractive.py +++ b/DistUpgrade/DistUpgradeViewNonInteractive.py @@ -19,6 +19,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +import apt +import logging + class NonInteractiveDistUpgradeView(object): " non-interactive version of the upgrade view " def __init__(self): |
