Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

25 lines
674B

  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 ktt 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)2013 Ivan "Kai SD" Korystin'