Modify

Opened 10 years ago

Last modified 10 years ago

#11812 new enhancement

cannot nest Include macro in CSV

Reported by: 5@… Owned by: Alec Thomas
Priority: normal Component: CsvMacro
Severity: normal Keywords: nest
Cc: Trac Release:

Description (last modified by Ryan J Ollos)

I want to auto-generate tables in csv form, and have them show up in the wiki as soon as they're checked in. The CsvMacro and IncludeMacro have the two functions I need, but won't nest. Here's a test:

trac tests

bracket form Include doesn't work in brace-bracket CSV

{{{
#!CSV
[[Include(http://www.andrewpatton.com/countrylist.csv)]]
}}}

next: CSV works in bracket form

[[CSV(hi, there)]]

but: bracket Include in bracket CSV doesn't work

[[CSV([[Include(source:python/systemTests/weakSignal.csv)]])]]

although bracket form Include works on its own

[[Include(http://www.andrewpatton.com/countrylist.csv)]]

Attachments (1)

CSVInclude.py (2.4 KB) - added by anonymous 10 years ago.
CSVInclude macro -- quick and dirty hack

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by Jun Omae

Description: modified (diff)

comment:2 Changed 10 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 10 years ago by Jun Omae

Component: IncludeMacroCsvMacro
Keywords: csv removed
Owner: changed from Ryan J Ollos to Alec Thomas

Macro's content usually cannot be written wiki text except some macros. Especially, CsvMacro's content is comma-separated values and the macro never parse the content as wiki text.

comment:4 Changed 10 years ago by 5@…

Ah, I guess I see the issue. Borrowing heavily from your code and that of CSVMacro, I hacked together a CSVInclude macro that works for me; but I wouldn't call it shippable software, and I'm not a good enough coder that I should volunteer to maintain it. Maybe I'll get brave and figure out how to publish it and run away.

comment:5 Changed 10 years ago by Ryan J Ollos

Feel free to just attach your code to this ticket. We have too many projects on trac-hacks already that are unmaintained.

Changed 10 years ago by anonymous

Attachment: CSVInclude.py added

CSVInclude macro -- quick and dirty hack

comment:6 Changed 10 years ago by anonymous

Ok, done. Thanks for your time, and for the open-source code that let me get what I needed done.

It might have been more tasteful for me to teach Include about text/csv, but I doubt I'd ever have debugged that.

I'd close the ticket, but "anonymous" doesn't seem to have the power.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Alec Thomas.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.