You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

27 line
710B

  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. Generates files from csv table.
  5. Part of Kai's Text Tools
  6. (c) 2013 Ivan "Kai SD" Korystin
  7. License: GPLv3
  8. '''
  9. from sys import argv
  10. from atg import ATG
  11. from data import CSVData
  12. from template import TemplateV2
  13. from os.path import split
  14. if __name__ == '__main__':
  15. if len(argv) == 3:
  16. generator = ATG(CSVData(argv[1]), TemplateV2(argv[2]))
  17. generator.write_files()
  18. elif len(argv) == 4:
  19. generator = ATG(CSVData(argv[1]), TemplateV2(argv[2]))
  20. generator.write_files(argv[3])
  21. else:
  22. print 'Usage:', split(argv[0])[-1], '<CSV file>', '<Template file>', '[Output directory]'
  23. print '(c)2013 Ivan "Kai SD" Korystin'