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/ExePackages.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/thandy/packagesys/ExePackages.py (limited to 'lib/thandy/packagesys/ExePackages.py') diff --git a/lib/thandy/packagesys/ExePackages.py b/lib/thandy/packagesys/ExePackages.py new file mode 100644 index 0000000..1688da3 --- /dev/null +++ b/lib/thandy/packagesys/ExePackages.py @@ -0,0 +1,33 @@ +# Copyright 2008 The Tor Project, Inc. See LICENSE for licensing information. + +import thandy.packagesys.PackageSystem as ps +import thandy.packagesys.PackageDB as pdb + +class ExePackageSystem(pdb.DBBackedPackageSystem): + + def getName(self): + return "executable" + + def packageHandleFromJSON(self, json): + raise NotImplemented() #XXXX???? + + def canBeAutomatic(self): + return True + + def canHaveUI(self): + return True + +class ExePackageHandle(pdb.DBBackedPackageHandle): + def __init__(self, packageDB, name, version, filelist, filename, + arguments): + pdb.DBBackedPackageHandle.__init__(packageDB, name, version, filelist) + self._filename = filename + self._arguments = arguments + + def _doInstall(self): + commandline = [ self._filename ] + self._arguments + logging.info("Installing %s. Command line: %s", self._filename, + commandLine) + subprocess.call(commandline) + + -- cgit v1.2.3