25개 이상의 토픽을 선택하실 수 없습니다. 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.

ktt_atgcsv.py 710B

11 년 전
11 년 전
123456789101112131415161718192021222324252627
  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 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'