Attachment 'GANTT-1.2.1.py'

Download

   1 """
   2     MoinMoin - Processor for GANTT data
   3 
   4     Copyright (c) 2003 by Reimar Bauer <R.Bauer@fz-juelich.de>
   5     All rights reserved.
   6 
   7     This routine is published under the GNU Library General Public License
   8 
   9     2004-04-15 : Daniel Hottinger code fix to work with moin 1.2.1
  10  
  11 """
  12 
  13 import string, os
  14 
  15 from MoinMoin.Page import Page
  16 from MoinMoin import config
  17 from MoinMoin.action import AttachFile
  18 
  19 htdocs_access = isinstance(config.attachments, type({}))
  20 
  21 def process(request, formatter, lines):
  22     # parse bangpath for arguments
  23     exclude = []
  24     image = 'gantt'
  25     renderer = 'png'
  26     txt=''
  27 
  28 
  29     arg=string.split(lines[0])
  30 
  31     for test in arg:
  32       if test == '-name' :
  33          i=string.index(arg,test)
  34          image=arg[i+1]
  35       if test == '-renderer' :
  36          i=string.index(arg,test)
  37          renderer = arg[i+1]
  38       if test == '-csp':
  39          txt = txt + ' --csp '
  40       if test == '-usdates':
  41          txt = txt + ' --usdates '
  42       if test == '-datesinbars':
  43          txt = txt + ' --datesinbars '
  44       if test == '-rappel':
  45          txt = txt + ' --rappel '
  46       if test == '-display-resources':
  47          txt = txt + ' --display-resources '
  48       if test == '-display-id' :
  49          i=string.index(arg,test)
  50          txt = txt + ' --display-id ' + arg[i+1]
  51       if test == '-resource':
  52          i=string.index(arg,test)
  53          txt = txt + ' --resourcep ' + arg[i+1]
  54       if test == '-timestep':
  55          i=string.index(arg,test)
  56          txt = txt + ' --timestep ' + arg[i+1]
  57       if test == '-detail':
  58          i=string.index(arg,test)
  59          txt = txt + ' --detail ' + arg[i+1]
  60       if test == '-datesinbars':
  61          txt = txt + ' --datesinbars '
  62       if test == '-depth':
  63          i=string.index(arg,test)
  64          txt = txt + ' --depth ' + arg[i+1]
  65       if test == '-view-begin':
  66          i=string.index(arg,test)
  67          txt=txt + ' --view-begin=' + arg[i+1]
  68       if test == '-view-end':
  69          i=string.index(arg,test)
  70          txt=txt + ' --view-end=' + arg[i+1]
  71     # remove bang path, create output list
  72     del lines[0]
  73     pagename=formatter.page.page_name
  74     attach_dir=AttachFile.getAttachDir(pagename,create=1)
  75     url=AttachFile.getAttachUrl(pagename,image + '.' + renderer,request)
  76     file_name=attach_dir+ '/' + image + '.' + renderer
  77     cmd='pygantt --renderer '+renderer +' ' + txt + ' - > ' + file_name
  78     f=os.popen(cmd,'w')
  79     for line in lines:
  80        print >>f, line
  81     f.flush()
  82 
  83 
  84     link='<img src="'+url+'" >'
  85     request.write(link)

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2004-05-05 21:34:20, 10.3 KB) [[attachment:AbcMusic.py]]
  • [get | view] (2004-04-15 07:19:38, 3.4 KB) [[attachment:DataLanguage.py]]
  • [get | view] (2004-04-15 20:23:33, 2.5 KB) [[attachment:GANTT-1.2.1.py]]
  • [get | view] (2003-12-07 18:15:55, 2.4 KB) [[attachment:GANTT.py]]
  • [get | view] (2004-07-29 15:04:28, 12.1 KB) [[attachment:IndentTable.py]]
  • [get | view] (2004-10-05 13:12:16, 10.6 KB) [[attachment:MySQL.py]]
  • [get | view] (2004-03-27 18:55:57, 3.7 KB) [[attachment:SimpleTable.py]]
  • [get | view] (2003-12-07 18:15:55, 1.5 KB) [[attachment:TextOnRight.py]]
  • [get | view] (2004-09-17 06:53:46, 3.0 KB) [[attachment:awktable-1.2.3.py]]
  • [get | view] (2004-10-28 13:55:04, 1.0 KB) [[attachment:colorer.py]]
  • [get | view] (2004-11-04 00:26:37, 1.4 KB) [[attachment:csv_python_module.diff]]
  • [get | view] (2004-04-21 18:29:38, 0.2 KB) [[attachment:html.py]]
  • [get | view] (2004-08-16 10:59:24, 4.8 KB) [[attachment:latex-1.2.3.py]]
  • [get | view] (2004-08-07 07:36:59, 3.9 KB) [[attachment:latex-cygwin.py]]
  • [get | view] (2004-04-09 17:05:33, 2.9 KB) [[attachment:latex.1.2.1.py]]
  • [get | view] (2004-02-29 16:50:13, 2.1 KB) [[attachment:latex.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.