summaryrefslogtreecommitdiff
path: root/lib/thandy/packagesys/ExePackages.py
blob: 1688da326d83f1ace0e6b84ef943596ac59c96dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)