Changeset 248 for tbroadcast/HEAD/scripts/generateGantt
- Timestamp:
- Sep 25, 2006, 3:39:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tbroadcast/HEAD/scripts/generateGantt
r247 r248 1 1 #!/usr/bin/env python 2 #----------------------------------# 3 # -- Author: V. Garonne 4 # -- Mail: garonne@lal.in2p3.fr 5 # -- Date: 08/25/2006 6 # -- Name: generateGantt 7 # -- Description: script to generate 8 # -- the gantt chart from a input file 9 # -- It uses Paw. 10 #----------------------------------# 2 11 3 12 import os … … 5 14 import time 6 15 import string 16 import commands 17 18 def usage (): 19 print 'Usage : > generateGannt <input file>' 7 20 8 21 if __name__ == '__main__': 9 file = sys.argv[1] 10 f = open (file) 22 if len(sys.argv) != 2: 23 usage () 24 sys.exit(-1) 25 26 # First read the file 27 file = sys.argv[1] 28 f = open (file) 11 29 lines = f.readlines() 12 30 f.close () 31 32 # Instanciate constants 13 33 total = len(lines) 14 34 min = time.time() … … 22 42 max = float(end) 23 43 44 # then compute for each package its line 24 45 packages = {} 25 46 for line in lines: … … 40 61 packages[package]['index']= index 41 62 done.append(package) 42 print i,index, package63 #print i,index, package 43 64 if not package in start: 44 65 if packages[package]['start']> i: … … 50 71 y = 0 51 72 for package in packages: 73 print package 52 74 if packages[package]['index'] > y: 53 75 y = packages[package]['index'] … … 105 127 106 128 f = open ("exec.kumac", "w+") 107 f.write ("\n\n kumac/"+string.lower(Site)+".kumac")129 f.write ("\n\n gantt.kumac") 108 130 f.close () 109 131 110 status, output = commands.getstatusoutput ("paw<exec.kumac") 111 # status, output = commands.getstatusoutput (cmd) 112 # 113 # 114 # 115 # for package in packages: 116 # #print packages[package]['start'], packages[package]['end'] 117 # concurent = list() 118 # for pack in packages: 119 # if (packages[package]['start'] < packages[pack]['start'] and packages[pack]['start'] < packages[package]['end'])\ 120 # or (packages[package]['start'] < packages[pack]['end'] and packages[pack]['end'] < packages[package]['end']): 121 # concurent.append (pack) 122 # packages[package]['concurent'] = concurent 123 # 124 # total = 0 125 # for package in packages: 126 # if len(packages[package]['concurent'])> total: 127 # total = len(packages[package]['concurent']) 128 # if not packages[package].has_key('index'): 129 # index = 1 130 # for pack in packages[package]['concurent']: 131 # if packages[package]['end']<packages[pack]['end']: 132 # index = index + 1 133 # packages[package]['index'] = index 134 # 132 status, output = commands.getstatusoutput ("paw<exec.kumac") 133 #--------- EoF --------#
Note: See TracChangeset
for help on using the changeset viewer.