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 lines
676B

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