1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

- Maintainer ported the plugin to Trac 0.11

- Makefile stylistic fixes & added macros from bsd.python.mk
- Added pkg-message file with configuration details

PR:		ports/126112
Submitted by:	Anton Batenev <antonbatenev@yandex.ru>
Approved by:	beech (mentor, implicit)
This commit is contained in:
Greg Larkin 2008-08-14 23:05:40 +00:00
parent 8940d9ebe9
commit 271540e064
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=218566
5 changed files with 147 additions and 18 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= TracGantt PORTNAME= TracGantt
PORTVERSION= 0.3.2a PORTVERSION= 0.3.2a
PORTREVISION= 2 PORTREVISION= 3
CATEGORIES= www devel python CATEGORIES= www devel python
MASTER_SITES= http://willbarton.com/files/ \ MASTER_SITES= http://willbarton.com/files/ \
http://dryice.name/computer/FreeBSD/distfiles/ http://dryice.name/computer/FreeBSD/distfiles/
@ -16,30 +16,26 @@ PKGNAMEPREFIX= trac-
MAINTAINER= dryice@dryice.name MAINTAINER= dryice@dryice.name
COMMENT= A plugin to creates Gantt charts for trac COMMENT= A plugin to creates Gantt charts for trac
RUN_DEPENDS+= tracd:${PORTSDIR}/www/trac
BUILD_DEPENDS+= easy_install:${PORTSDIR}/devel/py-setuptools BUILD_DEPENDS+= easy_install:${PORTSDIR}/devel/py-setuptools
RUN_DEPENDS+= trac>=0.11:${PORTSDIR}/www/trac
NO_BUILD= yes
USE_PYTHON= 2.3+ USE_PYTHON= 2.3+
USE_PYDISTUTILS=yes
PLIST_SUB+= PORTVERSION=${PORTVERSION} PYTHONVERSION=${_PYTHON_VERSION} PLIST_SUB+= PORTVERSION=${PORTVERSION} PYTHONVERSION=${_PYTHON_VERSION}
PYDISTUTILS_NOEGGINFO= yes
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
PORTDOCS= PKG-INFO README PORTDOCS= PKG-INFO README
.endif .endif
do-build: .include <bsd.port.pre.mk>
cd ${WRKSRC}; \
${PYTHON_CMD} setup.py bdist_egg
do-install:
.for i in *
${INSTALL_DATA} ${WRKSRC}/dist/${i} ${PYTHON_SITELIBDIR}/
.endfor
post-install:
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR} @${INSTALL} -d ${DOCSDIR}
.for i in ${PORTDOCS} @cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif .endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk> .include <bsd.port.post.mk>

View File

@ -0,0 +1,13 @@
--- setup.py.orig 2008-08-13 08:54:31.000000000 -0400
+++ setup.py 2008-08-13 08:54:44.000000000 -0400
@@ -9,8 +9,8 @@
packages = ['tracgantt'],
package_data={'tracgantt': ['templates/*.cs', 'htdocs/*.css']},
- #install_requires = ['trac>=0.9'],
- #entry_points = {'trac.plugins': ['module_name = gantt']},
+ install_requires = ['trac>=0.11'],
+ entry_points = {'trac.plugins': ['tracgantt = tracgantt']},
author = "Will Barton",
author_email = "wbb4@opendarwin.org",

View File

@ -0,0 +1,48 @@
--- tracgantt/gantt.py.orig 2006-07-20 21:07:06.000000000 +0400
+++ tracgantt/gantt.py 2008-08-14 05:44:53.000000000 +0400
@@ -115,7 +115,7 @@
show_opened = self.env.config.getbool('gantt-charts',
'show_opened', 'false')
- tickets,dates,broken = self._tickets_for_report(db, report['query'])
+ tickets,dates,broken = self._tickets_for_report(db, report['query'], req.perm.username)
tickets,dates = self._paginate_tickets(tickets, dates)
req.hdf['gantt.tickets'] = tickets
@@ -163,7 +163,7 @@
return {'id':id, 'title':title, 'query':query, 'description':description}
- def _tickets_for_report(self, db, query):
+ def _tickets_for_report(self, db, query, username):
""" Get a list of Ticket instances for the tickets in a report """
tickets = []
@@ -172,7 +172,7 @@
## Get tickets for this report
cursor = db.cursor()
- cursor.execute(query)
+ cursor.execute(query.replace('$USER', "'%s'" % username))
info = cursor.fetchall() or []
cols = [s[0] for s in cursor.description or []]
db.rollback()
@@ -344,7 +344,7 @@
"use_creation_date", "true")
if use_cdate:
- start = datetime.date.fromtimestamp(ticket.time_created)
+ start = datetime.date.fromordinal(ticket.time_created.toordinal())
else:
raise ValueError, "Couldn't get start date"
@@ -370,8 +370,8 @@
% (str(ticket.id), str(start), str(due))
# Finally the ticket itself's open and close dates
- open = datetime.date.fromtimestamp(ticket.time_created)
- changed = datetime.date.fromtimestamp(ticket.time_changed)
+ open = ticket.time_created.date()
+ changed = ticket.time_changed.date()
return (start, due, open, changed)

View File

@ -1,6 +1,5 @@
A plugin for the Trac project/source code management system that A plugin for the Trac project/source code management system that
creates Gantt charts based on ticket reports. It is a creates Gantt charts based on ticket reports. It is a work-in-progress.
work-in-progress.
A Gantt chart is a graphical representation of the duration of tasks A Gantt chart is a graphical representation of the duration of tasks
against the progression of time. Gantt charts are very useful for against the progression of time. Gantt charts are very useful for
@ -14,4 +13,4 @@ Tickets" tab in Trac). The Gantt charts are pure XHTML and are
generated on-the-fly from the ticket reports, using only the tickets generated on-the-fly from the ticket reports, using only the tickets
provided by the report. provided by the report.
WWW: http://willbarton.com/ WWW: http://willbarton.com/code/tracgantt/

View File

@ -0,0 +1,73 @@
----------------------------------------------------------------------
To use the TracGantt plugin, please follow these instructions:
Edit your Trac config file to add custom fields to tickets, as well
as set the expected date format of those fields.
The first things to add are the new ticket fields. If you already
have a ticket-custom section, append these to it:
[ticket-custom]
due_assign = text
due_assign.label = Due to assign
due_assign.value = DD/MM/YYYY
dependencies = text
dependencies.label = Dependencies
dependencies.value =
due_close= text
due_close.label = Due to close
due_close.value = DD/MM/YYYY
include_gantt = checkbox
include_gantt.label = Include in GanttChart
include_gantt.value =
This will add four new fields to tickets, a "Due to assign" field,
which contains the date by which this ticket should be assigned, a
"Dependencies" field, for listing ticket numbers upon which this
ticket depends, a "Due to close" field, which contains the date by
which this ticket should be closed, and finally a checkbox that
allows the ticket to be included in Gantt charts.
In addition, TracGantt provides several tweakable configuration
knobs that you can use to change the behavior of the gantt charts.
They are listed below with their default values.
[gantt-charts]
# The format of dates entered by humans in the above ticket
# fields
date_format = %m/%d/%Y
# Include the ticket summary in the gantt chart display
include_summary = true
# Trim the included summary to the given number of characters
summary_length = 16
# Use the creation date of a ticket as the "due assign"
# date if no assignment date is given
use_creation_date = true
# Show on the gantt chart the date the ticket was opened,
# to contrast with the assignment date.
show_opened = true
NOTE: If you are placing the module anywhere outside of Trac's
standard 'plugins' directory (i.e. to share across Trac instances),
then you will also need to add:
[components]
tracgantt.* = enabled
to your Trac config file. Again, this is only necessary if the egg
file is placed outside of the Trac 'plugins' folder, in a standard
Python search path.
If you are using Trac with Apache and mod_python, you may also need
to restart Apache, to avoid the plugin being accessible from one
Apache process, but not others.
----------------------------------------------------------------------