blob: 049259561c2b856154683042e41b6e5051e73252 [file] [log] [blame]
mblighdcd57a82007-07-11 23:06:47 +00001#!/usr/bin/python
2#
3# Copyright 2007 Google Inc. Released under the GPL v2
4
mblighdc735a22007-08-02 16:54:37 +00005"""
6This module defines the InstallableObject class
mblighdcd57a82007-07-11 23:06:47 +00007
8 InstallableObject: a software package that can be installed on a Host
9"""
10
mblighdc735a22007-08-02 16:54:37 +000011__author__ = """
12mbligh@google.com (Martin J. Bligh),
mblighdcd57a82007-07-11 23:06:47 +000013poirier@google.com (Benjamin Poirier),
mblighdc735a22007-08-02 16:54:37 +000014stutsman@google.com (Ryan Stutsman)
15"""
mblighdcd57a82007-07-11 23:06:47 +000016
17
18import utils
19
20
21class InstallableObject(object):
mblighdc735a22007-08-02 16:54:37 +000022 """
23 This class represents a software package that can be installed on
mblighdcd57a82007-07-11 23:06:47 +000024 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
mblighdc735a22007-08-02 16:54:37 +000029 instantiate one of those leaf subclasses.
30 """
mblighdcd57a82007-07-11 23:06:47 +000031
32 source_material= None
33
34 def __init__(self):
35 super(InstallableObject, self).__init__()
mblighdc735a22007-08-02 16:54:37 +000036
mblighdcd57a82007-07-11 23:06:47 +000037
38 def get(self, location):
mblighdc735a22007-08-02 16:54:37 +000039 """
40 Get the source material required to install the object.
mblighdcd57a82007-07-11 23:06:47 +000041
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)
mblighdc735a22007-08-02 16:54:37 +000052
mblighdcd57a82007-07-11 23:06:47 +000053
54 def install(self, host):
55 pass