From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Egli Subject: Re: org and taskjuggler Date: Mon, 15 Dec 2008 11:37:07 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCApO-000458-Ph for emacs-orgmode@gnu.org; Mon, 15 Dec 2008 05:37:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCApN-00043R-2m for emacs-orgmode@gnu.org; Mon, 15 Dec 2008 05:37:29 -0500 Received: from [199.232.76.173] (port=51262 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCApM-000439-OG for emacs-orgmode@gnu.org; Mon, 15 Dec 2008 05:37:28 -0500 Received: from main.gmane.org ([80.91.229.2]:60295 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LCApL-0002t7-R7 for emacs-orgmode@gnu.org; Mon, 15 Dec 2008 05:37:28 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LCApB-0002E1-12 for emacs-orgmode@gnu.org; Mon, 15 Dec 2008 10:37:17 +0000 Received: from d05.sbszh.ch ([217.192.14.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Dec 2008 10:37:17 +0000 Received: from christian.egli by d05.sbszh.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Dec 2008 10:37:17 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Shelagh Manton writes: > One of the set tasks for the project scenario is to produce a Gantt > chart. > > Or perhaps someone knows another way to get a Gantt chart out of > org-mode data. I'm using a very hackish "works-for-me" python script that converts a tsv export from an org-mode file to a taskjuggler file. Probably has lots of implizit assumptions which not even I remember. The basic work-flow is to create your hierarchy of tasks, add some effort estimates and some other properties, export this to a csv and run the attached python script on it. This will generate a taskjuggler include file (tji) which can be used in a main taskjuggler file (tjp). You could use the following Makefile snippet to automate the process: projectPlan.csv: projectPlan.org $(EMACS) -batch \ -eval "(progn (find-file \"$<\") (re-search-forward \"^| Task\") (org-table-export \"$@\"))" -kill projectPlan.tji: projectPlan.csv $(CSV2TASKJUGGLER) < $< > $@ projectPlan.taskreport.html: projectPlan.tjp projectPlan.tji $(TASKJUGGLER) $< Attached is the python script, an example org file and an example for a tjp file. Let me know if this works for you. I meant to write a tutorial about this but you know how it is. Maybe you could write one as you get this to work :-) Hope this helps Christian --=-=-= Content-Disposition: inline; filename=projectPlan.org Content-Description: Example project plan (org-mode) # -*- mode: org; coding: utf-8 -*- #+TITLE: XMLP Project Plan #+LANGUAGE: en #+OPTIONS: H:2 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:nil skip:t d:nil tags:not-in-toc #+PROPERTY: Effort_ALL 0.5 1.0 2.0 3.0 5.0 8.0 10.0 15.0 20.0 25.0 40.0 50.0 150.0 200.0 #+PROPERTY: Complete_ALL 0 50 100 #+PROPERTY: NoDepends_ALL True False #+COLUMNS: %40ITEM(Task) %Effort(Estimated Effort) %Allocate %Account %Start %NoDepends %3Complete(Percent Complete) %Note %Priority * XML-Project :PROPERTIES: :ID: XML-Project :Account: project_costs :Start: 2008-09-01 :END: ** Fasttrack :PROPERTIES: :Allocate: team :END: *** Iteration (Basics) **** Specification :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: **** Plan :PROPERTIES: :Effort: 0.5 :Complete: 100 :END: **** Admin ***** Setup svn :PROPERTIES: :Effort: 1.0 :Complete: 0 :END: **** Generate large print ***** Install Daisy pipeline :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: ***** Enhance DTBook2Latex with variable font size :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Enhance DTBook2Latex with language handling :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Customize layout If the layout created by the Daisy pipeline converter is not what people want then this needs to be adjusted :PROPERTIES: :Effort: 2.0 :Complete: 100 :Note: Canceled, To be done at a later stage :END: ***** Test :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Documentation :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Contribute improvements back to Daisy :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: **** Generate XHTML ***** Install Daisy pipeline :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: ***** Run the DTBook to XHTML converter :PROPERTIES: :Effort: 0.5 :Complete: 100 :END: ***** Test the result :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: ***** Customize layout :PROPERTIES: :Effort: 2.0 :Complete: 100 :Note: Canceled, To be done at a later stage :END: **** Generate DTBs ***** Install narrator from Daisy pipeline :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Install TTS :PROPERTIES: :Complete: 100 :END: ***** Test :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: ***** Documentation :PROPERTIES: :Effort: 1.0 :Complete: 100 :END: **** Generate Braille (hard copy, grade 0 only) ***** Install liblouis + liblouisxml :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** adapt grade 0 table for swiss german :PROPERTIES: :Effort: 3.0 :Complete: 100 :END: ***** adapt the semantic action file for DTBook :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Test :PROPERTIES: :Effort: 3.0 :Complete: 100 :END: ***** Documentation :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: ***** Contribute improvements back to liblouis :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: **** Primitive Web GUI ***** Implement :PROPERTIES: :Effort: 2.0 :Complete: 100 :Note: Canceled. Was for demo and test purposes only. Replaced by Daisy Pipeline :END: ***** Test :PROPERTIES: :Effort: 1.0 :Complete: 100 :Note: Canceled. Was for demo and test purposes only. Replaced by Daisy Pipeline :END: **** Review/Presentation/Demo :PROPERTIES: :Effort: 2.0 :Complete: 100 :END: **** Reporting :PROPERTIES: :Effort: 0.5 :Complete: 100 :END: * Export :PROPERTIES: :TABLE_EXPORT_FORMAT: orgtbl-to-tsv :END: #+BEGIN: columnview :hlines 1 :id "XML-Project" | Task | Estimated Effort | Allocate | Account | Start | NoDepends | Percent Complete | Note | Priority | |----------------------------------------------------+------------------+----------+---------------+------------+-----------+------------------+---------------------------------------------------------------------------+----------| | * XML-Project | | | project_costs | 2008-09-01 | | | | | | ** Fasttrack | | team | | | | | | | | *** Iteration (Basics) | | | | | | | | | | **** Specification | 1.0 | | | | | 100 | | | | **** Plan | 0.5 | | | | | 100 | | | | **** Admin | | | | | | | | | | ***** Setup svn | 1.0 | | | | | 0 | | | | **** Generate large print | | | | | | | | | | ***** Install Daisy pipeline | 1.0 | | | | | 100 | | | | ***** Enhance DTBook2Latex with variable font size | 2.0 | | | | | 100 | | | | ***** Enhance DTBook2Latex with language handling | 2.0 | | | | | 100 | | | | ***** Customize layout | 2.0 | | | | | 100 | Canceled, To be done at a later stage | | | ***** Test | 2.0 | | | | | 100 | | | | ***** Documentation | 2.0 | | | | | 100 | | | | ***** Contribute improvements back to Daisy | 2.0 | | | | | 100 | | | | **** Generate XHTML | | | | | | | | | | ***** Install Daisy pipeline | 1.0 | | | | | 100 | | | | ***** Run the DTBook to XHTML converter | 0.5 | | | | | 100 | | | | ***** Test the result | 1.0 | | | | | 100 | | | | ***** Customize layout | 2.0 | | | | | 100 | Canceled, To be done at a later stage | | | **** Generate DTBs | | | | | | | | | | ***** Install narrator from Daisy pipeline | 2.0 | | | | | 100 | | | | ***** Install TTS | | | | | | 100 | | | | ***** Test | 1.0 | | | | | 100 | | | | ***** Documentation | 1.0 | | | | | 100 | | | | **** Generate Braille (hard copy, grade 0 only) | | | | | | | | | | ***** Install liblouis + liblouisxml | 2.0 | | | | | 100 | | | | ***** adapt grade 0 table for swiss german | 3.0 | | | | | 100 | | | | ***** adapt the semantic action file for DTBook | 2.0 | | | | | 100 | | | | ***** Test | 3.0 | | | | | 100 | | | | ***** Documentation | 2.0 | | | | | 100 | | | | ***** Contribute improvements back to liblouis | 2.0 | | | | | 100 | | | | **** Primitive Web GUI | | | | | | | | | | ***** Implement | 2.0 | | | | | 100 | Canceled. Was for demo and test purposes only. Replaced by Daisy Pipeline | | | ***** Test | 1.0 | | | | | 100 | Canceled. Was for demo and test purposes only. Replaced by Daisy Pipeline | | | **** Review/Presentation/Demo | 2.0 | | | | | 100 | | | | **** Reporting | 0.5 | | | | | 100 | | | #+END: --=-=-= Content-Disposition: inline; filename=projectPlan.tjp Content-Description: Example taskjuggler main project plan project foo "FOO" "1.0" 2008-09-01 - 2010-12-31 account project_costs "Project Costs" cost { } resource team "The team" { resource jane "Jane" {} resource joe "Joe" {} } include "projectPlan.tji" taskreport "Gantt Chart" { headline "Project Gantt Chart" columns hierarchindex, name, note, start, end, effort, duration, cost, chart timeformat "%Y-%m-%d" loadunit days hideresource 1 } resourcereport "Resource Graph" { headline "Resource Allocation Graph" columns no, name, chart } htmltaskreport "projectPlan.taskreport.html"{ timeformat "%Y-%m-%d" columns hierarchindex, name, note, effort, completed, duration, start, end } htmlstatusreport "projectPlan.statusreport.html"{ } --=-=-= Content-Type: text/x-python Content-Disposition: inline; filename=csv2taskjuggler.py Content-Description: Script to convert csv to taskjuggler #! /usr/bin/env python import csv import re import sys def openTask(id, name, effort, depends, allocate, account, start, complete, note, priority): print """task id%s "%s" {""" % ( id, name) if effort: print " effort %sd" % (effort) if depends: print " depends !id%s" % (depends) if allocate: print " allocate %s" % (allocate) if account: print " account %s" % (account) if start: print " start %s" % (start) if complete: print " complete %s" % (complete) if note: print " note \"%s\"" % (note) if priority: print " priority %s" % (priority) def closeTask(): print "}" reader = csv.reader(sys.stdin, delimiter='\t', quoting=csv.QUOTE_NONE) id = 1 oldLevel = 0 predecessors = range(10) p = re.compile("(\*+) (.*)\Z") for row in reader: task, effort, allocate, account, start, doDepends, complete, note, priority = row m = p.match(task) if m == None: continue level, taskName = m.groups() level = len(level) if level > oldLevel: openTask(id, taskName, effort, None, allocate, account, start, complete, note, priority) if not doDepends: predecessors[level] = id elif level == oldLevel: closeTask() openTask(id, taskName, effort, (None if doDepends else predecessors[level]), allocate, account, start, complete, note, priority) if not doDepends: predecessors[level] = id else: while oldLevel >= level: closeTask() oldLevel -= 1 openTask(id, taskName, effort, (None if doDepends else predecessors[level]), allocate, account, start, complete, note, priority) if not doDepends: predecessors[level] = id oldLevel = level id += 1 while level > 0: closeTask() level -= 1 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--