1 # -*- coding: iso8859-15 -*- 2 from faces import * 3 from faces.tools import clocking 4 ... 5 6 class dev1(Resource): pass 7 ... 8 9 def Acso(): 10 title = "Accounting Software" 11 note = "" 12 ... 13 14 times = [] 15 try: 16 times = clocking.read("/mnt/common/work_times", ".clk") 17 except Exception, e: 18 print "Cannot read working time data", e 19 20 acso_standard = BalancedProject(Acso, balance=SLOPPY, performed=times) 21 22 def generate_clocking_file(fname): 23 clocking.generate(fname, acso_standard) 24 return True 25 26 generate_clocking_file.faces_menu = "clocking/generate" 27 generate_clocking_file.faces_savefile = "" 28 ...
generate_clocking_file.faces_menu = "clocking/generate"
assigns the menu Tools > clocking > generate
to the function.
The line generate_clocking_file.faces_savefile = ""
notifies
faces, that the functions needs a filename, returned by the
Save File dialog as first and only argument. Instead
of an empty string you can also assign a default filename.
generate_clocking_file returns True to
generate a success message.
When you have generated the project description file, you must distribute it to your developers. The simplest way is by a common public directory on a fileserver. The file is a simple ascii file that lists all resources and tasks of the project.
"/mnt/common/work_times"
that have an extension of code".clk".
These files are generated by the clocking application. The lines are
enclosed by an try except construct to catch all
errors. The result of the clocking.read is sequence of
working time date, that can be used in BalancedProject (line 20).