source: vanHelsing/trunk/src/resource.py@ 790

Last change on this file since 790 was 775, checked in by hmueller, on Jul 6, 2009 at 3:21:47 PM
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-python
File size: 1.2 KB
RevLine 
[775]1'''
2Resource Objects
3Created on 30.06.2009
4
5@author: hmueller
6'''
7
8class Resource(object):
9
10 def __init__(self):
11 self.items = []
12 self.comments = []
13
14 def __str__(self):
15 s = "\n".join(self.comments)
16 s += self.__name__ + "{\n"
17 for d in self.items:
18 s += " " + str(d) + "\n"
19 s += "}\n"
20 return s
21
22 def add_comment(self, comment):
23 if not comment.lstrip().startswith("#"):
24 comment = "# " + comment
25 self.comments.append(comment)
26
27class Director(Resource):
28 pass
29
30class Job(Resource):
31 DIRECTIVE="Job"
32
33class JobDefs(Resource):
34 DIRECTIVE="JobDefs"
35
36class Schedule(Resource):
37 DIRECTIVE="Schedule"
38
39class FileSet(Resource):
40 DIRECTIVE="FileSet"
41
42class Client(Resource):
43 DIRECTIVE="Client"
44
45class Storage(Resource):
46 DIRECTIVE="Storage"
47
48class Pool(Resource):
49 DIRECTIVE="Pool"
50
51class Catalog(Resource):
52 # ITEMS_DIRD = cdef.dird_cat_items
53 DIRECTIVE="Catalog"
54
55class Messages(Resource):
56 DIRECTIVE=""
57
58class Console(Resource):
59 DIRECTIVE=""
60
61class Counter(Resource):
62 DIRECTIVE=""
63
64class Device(Resource):
65 DIRECTIVE=""
66
67class Autochanger(Resource):
68 DIRECTIVE=""
Note: See TracBrowser for help on using the repository browser.