Nick Piper | 1 Mar 12:59 2011
Picon

Re: [Trac-dev] Integer type for custom fields


On 28/01/11 10:01, Steffen Hoffmann wrote:
> Nick Piper wrote:

>> I believe (also from the list at
>> http://trac.edgewall.org/wiki/TracTicketsCustomFields) that most of the
>> 'types' of custom fields are about the graphical representation of the
>> field in the ticket page.
> 
>> Is anyone aware of work to introduce some "data" types, such as
>> integer/float/(date - but I know about
>> http://trac-hacks.org/wiki/DateFieldPlugin).
> 
> When I started to actually code something to solve Trac #1942 it has
> been mentioned, that this _might_ be the last improvement upon the
> mature but aged custom field implementation. Work should in general go
> towards a major rework i.e. with new concept for the db backend storage
> organization, that has been announced with buzz words like GenericTrac.

I agree my patch for numeric fields is kind of temporary until a more
generic field system is introduced. Hopefully one with less iterating
over the fields list so much ;-)

>> One reason we'd really like the numeric types is so that we could add
>> some 'aggregation' options to the query pages. For example, if there was
>> a custom field 'cost', it would be great to be able to sum() those costs
>> on the query page to provide a total. Doing that requires to know the
>> field is a numeric type, as well as some niceties such as validation of
>> user input, a nicer HTML widget for the user input, and so on. The
>> actual storage to the database backend is likely to stay as strings
(Continue reading)

Remy Blank | 1 Mar 14:13 2011
Picon

[Trac-dev] Re: Ticket id before creating ticket

(Replied to list for others to give their feedback)

Franz wrote:
> Hi Remy,
> 
> thanks for your answer. I found, how I could manage it, so I would
> like to lay it out for further plugin-developers (maybe it could also
> be introduced in some kind of "best-practices"). Also you might give
> me some confirmation, if it was done correctly in the sense of Trac or
> it should be done in a different way.
> 
> Basically I did following:
> In method "validate_ticket" I parse all fields and save it into list
> "_budgets":
> if not self._budgets:
>             self._budgets = self._get_fields(req)
> 
> In method "filter_stream" I read saved list and displaying it:
> list_str = ''
> if self._budgets:
> 	for pos, budget in self._budgets.iteritems():
> 		# make list_str to insert into HTML-Object
> html = HTML(list_str)
> 
> In method "post_process_request" I save the list to DB:
> tkt = data['ticket']
> if tkt and tkt.id and Ticket.id_is_valid(tkt.id):
> 	self._save_budget(tkt)
> 
> As I said, this is working. But is it also coded in a nice way or is
(Continue reading)

Franz | 1 Mar 14:23 2011
Picon

[Trac-dev] Re: Ticket id before creating ticket

Hi Remy,

I parse the values in ITicketManipulator.validate_ticket(), because
ITicketChangeListener.ticket_changed won't be called if only the
budget info would be changed and nothing at the core ticket fields
itself. Isn't it that way?

When saving, I check in "post_process_request" if ticket and ticket-id
is correct.

Regards,
Franz

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Bogdan Stanciu | 1 Mar 15:10 2011
Picon

[Trac-dev] adding a [bzr] repo - Q & Error

Hi there!

I just added an existing Bazaar repo to trac, from Admin>Repositories>Add.

I get this nice message:

  • The repository "openobject-addons" has been added.
  • You should now run trac-admin $ENV repository resync "openobject-addons" to synchronize Trac with the repository.
  • You should also set up a post-commit hook on the repository to call trac-admin $ENV changeset added "openobject-addons" $REV for each committed changeset.
1. Shouldn't the $ENV be replaced by the actual value? (just nice to have, maybe...)

2. running trac-admin /var/tracprojects/OpenERP repository resync "openobject-addons"
i get the error:
TimeoutError: Unable to get database connection within 0 seconds. (TracError(u'Database "/var/tracprojects/OpenERP/db/trac.db" not found.',))
looks like trac-admin is looking for SQLite db...

3. Is there a HowTo page for adding a post-commit hook for bzr? I remember having a hard time with 0.11 and svn...

thank you!
Bogdan
ubuntu10.10
py2.6
trac 0.12.2
apache2
mySQL

--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Remy Blank | 1 Mar 15:28 2011
Picon

Re: [Trac-dev] adding a [bzr] repo - Q & Error

> 1. Shouldn't the $ENV be replaced by the actual value? (just nice to
> have, maybe...)

Heh, that's a good idea, my bad for not doing that in the first place.
Care to provide a patch?

> 2. running trac-admin /var/tracprojects/OpenERP repository resync
> "openobject-addons"
> i get the error:
> TimeoutError: Unable to get database connection within 0 seconds.
> (TracError(u'Database "/var/tracprojects/OpenERP/db/trac.db" not found.',))
> looks like trac-admin is looking for SQLite db...

This is usually a permission issue, more precisely the user running
trac-admin doesn't have permission to read trac.ini. I think we already
have an open ticket for this issue.

> 3. Is there a HowTo page for adding a post-commit hook for bzr? I
> remember having a hard time with 0.11 and svn...

I can't help you there, I haven't ever used bzr.

-- Remy

Bogdan Stanciu | 1 Mar 15:34 2011
Picon

Re: [Trac-dev] adding a [bzr] repo - Q & Error

On 01. 03. 11 15:28, Remy Blank wrote:
>> 1. Shouldn't the $ENV be replaced by the actual value? (just nice to
>> have, maybe...)
> Heh, that's a good idea, my bad for not doing that in the first place.
> Care to provide a patch?

I would do it with great pleasure, but I don't have yet the dev
environment for trac. I just thought about setting up one, but I need
some time... Any suggestion on how to set it up (I use eclipse with
pydev) in a efficient way will be more that welcome:-)
>> 2. running trac-admin /var/tracprojects/OpenERP repository resync
>> "openobject-addons"
>> i get the error:
>> TimeoutError: Unable to get database connection within 0 seconds.
>> (TracError(u'Database "/var/tracprojects/OpenERP/db/trac.db" not found.',))
>> looks like trac-admin is looking for SQLite db...
> This is usually a permission issue, more precisely the user running
> trac-admin doesn't have permission to read trac.ini. I think we already
> have an open ticket for this issue.
>
oh, should I just use sudo trac-admin for the time being? or will I get
in other troubles? :-)
>> 3. Is there a HowTo page for adding a post-commit hook for bzr? I
>> remember having a hard time with 0.11 and svn...
> I can't help you there, I haven't ever used bzr.
>
:-) i had to, for other projects...
> -- Remy
>
thank you!
Bogdan

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Remy Blank | 1 Mar 16:32 2011
Picon

Re: [Trac-dev] adding a [bzr] repo - Q & Error

Bogdan Stanciu wrote:
> Any suggestion on how to set it up (I use eclipse with
> pydev) in a efficient way will be more that welcome:-)

Ok, here's the (very) short story, for Linux. Completely untested, of
course, but you should get the idea.

Create a checkout and set up the development environment:

  svn co http://svn.edgewall.org/repos/trac/trunk trac-trunk
  cd trac-trunk
  virtualenv venv
  . venv/bin/activate
  python setup.py develop

Create an environment:

  trac-admin env initenv
  trac-admin env permission add bogdan TRAC_ADMIN
  python contrib/htdigest.py -c htdigest trac bogdan

Run tracd in development mode on port 8000:

  tracd --http11 -p 8000 -a *,htdigest,trac env -r -s

... and hack away! tracd should auto-reload every time you save your
changes (you may have to restart it from time to time, for example when
you introduce a syntax error).

Every time you open a new shell, you have to activate the virtualenv:

  cd trac-trunk
  . venv/bin/activate

For more details, see:

  http://trac.edgewall.org/wiki/TracDev/DevelopmentEnvironmentSetup

> oh, should I just use sudo trac-admin for the time being? or will I get
> in other troubles? :-)

I use that to sudo as the user running my web server.

-- Remy

Bogdan Stanciu | 2 Mar 17:46 2011
Picon

[Trac-dev] post-commit hook

hi there,

I am setting up a trac env with svn, and i try to fix the hooks. I have
one question:

what should be the PYTHON_EGG_CACHE path?

the example reads:

#!/bin/sh
export PYTHON_EGG_CACHE="/path/to/cache/dir"
/usr/bin/trac-admin /var/lib/trac/YourProject changeset added "$1" "$2"

what should be "/path/to/cache/dir"?

thank you!

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Emmanuel Blot | 2 Mar 18:52 2011
Picon

Re: [Trac-dev] post-commit hook

> what should be "/path/to/cache/dir"?

Wherever it fits: it is the path to a temporary directory where Trac
will extract the contents of the plugins (which are eggs == zip
files). It's really up to you. The directory should be read/writable
for the Trac application (ex: www-data if you use Apache or lighttpd
on  Ubuntu/Apache).

HTH,
Manu

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Christian Boos | 2 Mar 22:29 2011
Picon

Re: [Trac-dev] something like MOTD for trac

On 2/28/2011 10:13 AM, Christian Boos wrote:
On 2/28/2011 9:26 AM, Masopust, Christian wrote:
Hi all,
 
I'm maintaining several trac-instances (one code-base) for different projects here
on my server. Everytime when maintenance has to be done I've to write mails to
project-admins, members....
 
What I would like to have would be a plugin that shows something like a "motd"
when a user opens trac (any page). This motd should, in it's simpiest form, come
from a text-file and just inform the user about some upcoming maintenance.
 
Any idea if such a plugin exists?


No idea, but sounds useful and should be *very* easy to do (hint: request post-processor and add_info).
Anyone's up for the challenge of the smallest (useful) Trac plugin ever? ;-)

9 lines to beat, the path to the motd file should be configurable, TracDev/CodingStyle not mandatory ;-)


Hm, so nobody managed to make it in less than 9 lines, ... or nobody tried?
Ok, tomorrow I'll post my solution, then...

-- Christian

--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.


Gmane