comparison contrib/sawmill/web/details.py @ 474:a8f77807d710

sawmill: create links for tag builds
author Sascha Teichmann <teichmann@intevation.de>
date Fri, 10 Sep 2010 14:18:07 +0000
parents d8012571f9e1
children 28aa6ac933fb
comparison
equal deleted inserted replaced
473:d8012571f9e1 474:a8f77807d710
41 self.loaded = False 41 self.loaded = False
42 self.status = None 42 self.status = None
43 self.start = None 43 self.start = None
44 self.stop = None 44 self.stop = None
45 self.logs = None 45 self.logs = None
46 self.tags = None
46 47
47 def check_loaded(self): 48 def check_loaded(self):
48 if not self.loaded: 49 if not self.loaded:
49 f = open(self.status_file) 50 f = open(self.status_file)
50 try: 51 try:
54 key, value = [x.strip() for x in m.groups()] 55 key, value = [x.strip() for x in m.groups()]
55 56
56 if key == 'status': self.status = value 57 if key == 'status': self.status = value
57 elif key == 'start': self.start = _create_time(value) 58 elif key == 'start': self.start = _create_time(value)
58 elif key == 'stop': self.stop = _create_time(value) 59 elif key == 'stop': self.stop = _create_time(value)
60 elif key == 'tags': self.tags = value
59 finally: 61 finally:
60 f.close() 62 f.close()
61 self.loaded = True 63 self.loaded = True
62 64
63 def get_build_status(self): 65 def get_build_status(self):
69 return self.start 71 return self.start
70 72
71 def get_build_stop(self): 73 def get_build_stop(self):
72 self.check_loaded() 74 self.check_loaded()
73 return self.stop 75 return self.stop
76
77 def get_tags(self):
78 self.check_loaded()
79 return self.tags
74 80
75 def log_path(self, log): 81 def log_path(self, log):
76 return "%s/tracks/%s/pkg/%s/log/%s" % ( 82 return "%s/tracks/%s/pkg/%s/log/%s" % (
77 self.treepkg, self.track, self.revision, log) 83 self.treepkg, self.track, self.revision, log)
78 84
90 96
91 build_status = property(get_build_status) 97 build_status = property(get_build_status)
92 build_start = property(get_build_start) 98 build_start = property(get_build_start)
93 build_stop = property(get_build_stop) 99 build_stop = property(get_build_stop)
94 build_logs = property(get_build_logs) 100 build_logs = property(get_build_logs)
101 build_tags = property(get_tags)
95 102
96 103
97 def __scan_track_items(treepkg, path): 104 def __scan_track_items(treepkg, path):
98 items = [] 105 items = []
99 106
100 tracks_path = os.path.join(path, "tracks") 107 tracks_path = os.path.join(path, "tracks")
101 if os.path.isdir(track_path): 108 if os.path.isdir(tracks_path):
102 for track in os.listdir(tracks_path): 109 for track in os.listdir(tracks_path):
103 track_path = os.path.join(tracks_path, track) 110 track_path = os.path.join(tracks_path, track)
104 if not os.path.isdir(track_path): continue 111 if not os.path.isdir(track_path): continue
105 revisions_path = os.path.join(track_path, "pkg") 112 revisions_path = os.path.join(track_path, "pkg")
106 if not os.path.isdir(revisions_path): continue 113 if not os.path.isdir(revisions_path): continue
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)