mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # |
| 3 | # Copyright 2007 Google Inc. Released under the GPL v2 |
| 4 | |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 5 | """ |
| 6 | This module defines the InstallableObject class |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 7 | |
| 8 | InstallableObject: a software package that can be installed on a Host |
| 9 | """ |
| 10 | |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 11 | __author__ = """ |
| 12 | mbligh@google.com (Martin J. Bligh), |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 13 | poirier@google.com (Benjamin Poirier), |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 14 | stutsman@google.com (Ryan Stutsman) |
| 15 | """ |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 16 | |
| 17 | |
| 18 | import utils |
| 19 | |
| 20 | |
| 21 | class InstallableObject(object): |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 22 | """ |
| 23 | This class represents a software package that can be installed on |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 24 | a Host. |
| 25 | |
| 26 | Implementation details: |
| 27 | This is an abstract class, leaf subclasses must implement the methods |
| 28 | listed here. You must not instantiate this class but should |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 29 | instantiate one of those leaf subclasses. |
| 30 | """ |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 31 | |
| 32 | source_material= None |
| 33 | |
| 34 | def __init__(self): |
| 35 | super(InstallableObject, self).__init__() |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 36 | |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 37 | |
| 38 | def get(self, location): |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 39 | """ |
| 40 | Get the source material required to install the object. |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 41 | |
| 42 | Through the utils.get() function, the argument passed will be |
| 43 | saved in a temporary location on the LocalHost. That location |
| 44 | is saved in the source_material attribute. |
| 45 | |
| 46 | Args: |
| 47 | location: the path to the source material. This path |
| 48 | may be of any type that the utils.get() |
| 49 | function will accept. |
| 50 | """ |
| 51 | self.source_material= utils.get(location) |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 52 | |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 53 | |
| 54 | def install(self, host): |
| 55 | pass |