summaryrefslogtreecommitdiff
path: root/lib/thandy/packagesys/PackageSystem.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-11-16 20:15:34 +0000
committerNick Mathewson <nickm@torproject.org>2008-11-16 20:15:34 +0000
commitc5749895ab4f6893bdf1d398691d1dd33e81574c (patch)
tree4ee47c3c6c56e313c3074f04c77a3637cf0fe31d /lib/thandy/packagesys/PackageSystem.py
parent02a2e5807f23ad0cad9a49b5febe08ec25fcc74c (diff)
have some more thandy. This update includes a working downloader with tor support, a package system framework, and more. Most of what's left is glue code.
git-svn-id: file:///home/or/svnrepo/updater/trunk@17288 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/packagesys/PackageSystem.py')
-rw-r--r--lib/thandy/packagesys/PackageSystem.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/thandy/packagesys/PackageSystem.py b/lib/thandy/packagesys/PackageSystem.py
new file mode 100644
index 0000000..ad1e221
--- /dev/null
+++ b/lib/thandy/packagesys/PackageSystem.py
@@ -0,0 +1,58 @@
+# Copyright 2008 The Tor Project, Inc. See LICENSE for licensing information.
+
+class PackageSystem:
+ def getName(self):
+ raise NotImplemented()
+
+ def packageHandleFromJSON(self, json):
+ raise NotImplemented()
+
+ def canBeAutomatic(self):
+ return True
+
+ def canHaveUI(self):
+ return False
+
+ def getTransaction(self):
+ return PackageTransaction()
+
+class PackageTransaction:
+ def __init__(self):
+ self._transactions = []
+
+ def _start(self):
+ pass
+
+ def _commit(self):
+ pass
+
+ def run(self):
+ self._start()
+ for cb in self._transactions:
+ cb(self)
+ self._commit()
+
+ def addInstall(self, packageHandle):
+ self._transactions.append(packageHandle.install)
+
+ def addRemove(self, packageHandle):
+ self._transactions.append(packageHandle.remove)
+
+class PackageHandle:
+ def isInstalled(self, transaction=None):
+ raise NotImplemented()
+
+ def anyVersionInstalled(self, transaction=None):
+ raise NotImplemented()
+
+ def getInstalledVersion(self, transaction=None):
+ raise NotImplemented()
+
+ def install(self, transaction):
+ raise NotImplemented()
+
+ def remove(self, transaction):
+ raise NotImplemented()
+
+ def checkInstall(self, transaction=None):
+ raise NotImplemented()