Book a Demo

Author Topic: Iterate through imports in code template?  (Read 2640 times)

jrimig

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Iterate through imports in code template?
« on: August 23, 2008, 01:24:07 am »
Using the list macro it's easy to get output in the form
Code: [Select]
IMPORTS
    classA from file1
    classB from file1
    classC from file1
    classD from file2
    classE from file2
    classF from file2;
but how would I get something in the form
Code: [Select]
IMPORTS
   classA, classB, classC
   FROM file1
   classD, classE, classF
   FROM file2;
I'd like to group the imports by the file in which the classes are defined.
Thanks.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Iterate through imports in code template?
« Reply #1 on: August 28, 2008, 01:28:22 pm »
Copy the Python Import Section template. The trick is to list over an extra imports template with a condition and then remove the duplicates.