List Info

Thread: Converting to Trac-- again




Converting to Trac-- again
user name
2007-03-20 22:54:23
H'lo. Long time no see. :P

I'm in the process of converting our internal wiki back over to Trac; I don't remember precisely *why* it was ever decided to go to MediaWiki in the first place, which is pretty amusing.

The data conversion was fairly straight-forward and relatively easy: I got a list of all the pages, dumped them into mediaWiki's export utility, then had it export it all in a big ol' XML file. Five lines of code for chunking that out (Hello, ElementTree), and about ten simple string replacements, then a trac-admin wiki load, and  the content is mostly over and at least present.

Now comes the fun part. We had a number of specialized templates for formatting certain common data in a visually pleasing way. I'm writing simple macros for that (as one-file plugins from WikiMacroBase).

The first big hiccup I've noticed? I like to use keyword arguments, since otherwise the peers won't remember what's what, and looking over the pages... I can't rely upon them ever being able to type them in with the proper case.

[[APTBuild(build=256, Revision=4587, date=03/03/2007, path=/release/build256)]]

Notice the R.

The question: Am I missing anything obvious(a feature, option, etc) to make this not an issue? If not, then I'll probably end up making a patch to have parse_args return a case-insensitive dict.

Thanks in advance.

--Stephen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users"; group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Converting to Trac-- again
country flaguser name
United States
2007-03-21 01:24:58
On Mar 20, 11:54 pm, "Stephen Hansen"
<apt.shan...gmail.com> wrote:
> Now comes the fun part. We had a number of specialized
templates for
> formatting certain common data in a visually pleasing
way. I'm writing
> simple macros for that (as one-file plugins from
WikiMacroBase).

It sounds like you may be putting each macro in a separate
.py file
like how the old-style macros were written.  The new style
doesn't
depend on the filename for the name of the macro so you're
actually
free to define multiple macros in a single class if you
prefer.

> The first big hiccup I've noticed? I like to use
keyword arguments, since
> otherwise the peers won't remember what's what, and
looking over the
> pages... I can't rely upon them ever being able to type
them in with the
> proper case.
>
> [[APTBuild(build=256, Revision=4587, date=03/03/2007,
> path=/release/build256)]]
>
> Notice the R. 
>
> The question: Am I missing anything obvious(a feature,
option, etc) to make
> this not an issue? If not, then I'll probably end up
making a patch to have
> parse_args return a case-insensitive dict.

No, parse_args just returns them in whatever case was
provided.  If
you need to normalize the keyword args to lower-case you can
do it
like:

args, kw = parse_args(arg_string)
kw = dict([(k.lower(), v) for k,v in kw.iteritems()])

In Python 2.4 and up the square-brackets in the second line
are
optional.  And of course if you're doing this in multiple
places you
may want to define that as a function that you can reuse.

-- Matt Good


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Trac Users" group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to
trac-users-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Converting to Trac-- again
user name
2007-03-21 15:17:09
On 3/20/07, Matt Good < mattmatt-good.net">mattmatt-good.net> wrote:

On Mar 20, 11:54 pm, "Stephen Hansen&quot; < apt.shan...gmail.com">apt.shan...gmail.com> wrote:
>; Now comes the fun part. We had a number of specialized templates for
> formatting certain common data in a visually pleasing way. I'm writing
> simple macros for that (as one-file plugins from WikiMacroBase).

It sounds like you may be putting each macro in a separate .py file
like how the old-style macros were written.&nbsp; The new style doesn't
depend on the filename for the name of the macro so you're actually
free to define multiple macros in a single class if you prefer.

Well, the only thing I could find was http://trac.edgewall.org/ticket/4381 -- and from that example, I wasn't even sure just how the heck it got the name of the macro save from the filename or some odd class-name-fu. I intended on looking up IWikiMacroProvider since the syntax on said ticket made it seem a lot cleaner... just never got around to it. Still doing some MediaWiki->Trac data cleanups. (And *so* turning off WIKI_CREATE for all of the users since they don't grok anything like consistency in naming schemes or that wiki names shouldn9;t be oddly cased sentences :P)

> The first big hiccup I've noticed? I like to use keyword arguments, since
&gt; otherwise the peers won't remember what's what, and looking over the
> pages... I can't rely upon them ever being able to type them in with the
> proper case.
>
> [[APTBuild(build=256, Revision=4587, date=03/03/2007,
&gt; path=/release/build256)]]
>
&gt; Notice the R.
>
> The question: Am I missing anything obvious(a feature, option, etc) to make
> this not an issue? If not, then I'll probably end up making a patch to have
>; parse_args return a case-insensitive dict.

No, parse_args just returns them in whatever case was provided.&nbsp; If
you need to normalize the keyword args to lower-case you can do it
like:

args, kw = parse_args(arg_string)
kw = dict([(k.lower(), v) for k,v in kw.iteritems()])

In Python 2.4 and up the square-brackets in the second line are
optional. &nbsp;And of course if you're doing this in multiple places you
may want to define that as a function that you can reuse.

I know how to do it, yes I just found it odd that it wasn't an issue for everyone, that's all. Perhaps my people just use macros themselves a lot more then the average joe, or are a lot less willing to pay attention to such things on the fly.

Thanks.

--S


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users"; group.
To post to this group, send email to trac-usersgooglegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )