| Rev | Line | |
|---|
| [775] | 1 | '''
|
|---|
| 2 | Resource Objects
|
|---|
| 3 | Created on 30.06.2009
|
|---|
| 4 |
|
|---|
| 5 | @author: hmueller
|
|---|
| 6 | '''
|
|---|
| 7 |
|
|---|
| 8 | class 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 |
|
|---|
| 27 | class Director(Resource):
|
|---|
| 28 | pass
|
|---|
| 29 |
|
|---|
| 30 | class Job(Resource):
|
|---|
| 31 | DIRECTIVE="Job"
|
|---|
| 32 |
|
|---|
| 33 | class JobDefs(Resource):
|
|---|
| 34 | DIRECTIVE="JobDefs"
|
|---|
| 35 |
|
|---|
| 36 | class Schedule(Resource):
|
|---|
| 37 | DIRECTIVE="Schedule"
|
|---|
| 38 |
|
|---|
| 39 | class FileSet(Resource):
|
|---|
| 40 | DIRECTIVE="FileSet"
|
|---|
| 41 |
|
|---|
| 42 | class Client(Resource):
|
|---|
| 43 | DIRECTIVE="Client"
|
|---|
| 44 |
|
|---|
| 45 | class Storage(Resource):
|
|---|
| 46 | DIRECTIVE="Storage"
|
|---|
| 47 |
|
|---|
| 48 | class Pool(Resource):
|
|---|
| 49 | DIRECTIVE="Pool"
|
|---|
| 50 |
|
|---|
| 51 | class Catalog(Resource):
|
|---|
| 52 | # ITEMS_DIRD = cdef.dird_cat_items
|
|---|
| 53 | DIRECTIVE="Catalog"
|
|---|
| 54 |
|
|---|
| 55 | class Messages(Resource):
|
|---|
| 56 | DIRECTIVE=""
|
|---|
| 57 |
|
|---|
| 58 | class Console(Resource):
|
|---|
| 59 | DIRECTIVE=""
|
|---|
| 60 |
|
|---|
| 61 | class Counter(Resource):
|
|---|
| 62 | DIRECTIVE=""
|
|---|
| 63 |
|
|---|
| 64 | class Device(Resource):
|
|---|
| 65 | DIRECTIVE=""
|
|---|
| 66 |
|
|---|
| 67 | class Autochanger(Resource):
|
|---|
| 68 | DIRECTIVE=""
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.