summaryrefslogtreecommitdiff
path: root/lib/thandy/packagesys/ExePackages.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/ExePackages.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/ExePackages.py')
-rw-r--r--lib/thandy/packagesys/ExePackages.py33
1 files changed, 33 insertions, 0 deletions
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)
+
+