From c5749895ab4f6893bdf1d398691d1dd33e81574c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 16 Nov 2008 20:15:34 +0000 Subject: 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 --- lib/thandy/packagesys/PackageSystem.py | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lib/thandy/packagesys/PackageSystem.py (limited to 'lib/thandy/packagesys/PackageSystem.py') 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() -- cgit v1.2.3