# Path: scripts/load_as_rst.py
# def convert(fname_in, fname_out=None, preamble=None, strict=False):
#     """
#     Converts an file at ``fname_in`` from a format understood by pypandoc
#     to ReStructuredText.
# 
#     :param fname_in:
#         Filename to read.
# 
#     :param fname_out:
#         Filename to write to - this will be overwritten. If unspecified,
#         the converted text is returned.
# 
#     :param preamble:
#         A preamble to add to the file (e.g. "#This is an auto-generated file")
#     """
#     if fname_in is None:
#         raise ValueError('Must specify an input file')
# 
#     if not os.path.exists(fname_in):
#         raise IOError('File not found: {}'.format(fname_in))
# 
#     text = preamble or ''
#     text = '\n'.join((text, load_text(fname_in, strict=strict)))
# 
#     if fname_out is not None:
#         with open(fname_out, 'w') as f:
#             print(text, file=f)
# 
#         return None         # Just being explicit
#     else:
#         return text


import sys
from setuptools import setup
from scripts.load_as_rst import convert
    from setuptools_scm import get_version
# -*- coding: utf-8 -*-
#
#  setup.py
#  cjktools
#

"""
Package setup file for the cjktools package.
"""



try:

    VERSION = get_version()

    with open('cjktools/__version__.py', 'w') as f:
        f.write('# Autogenerated by setup.py\n')
        f.write('version = "%s"\n' % VERSION)

except ImportError:
    pass


# Path: scripts/load_as_rst.py
# def convert(fname_in, fname_out=None, preamble=None, strict=False):
#     """
#     Converts an file at ``fname_in`` from a format understood by pypandoc
#     to ReStructuredText.
# 
#     :param fname_in:
#         Filename to read.
# 
#     :param fname_out:
#         Filename to write to - this will be overwritten. If unspecified,
#         the converted text is returned.
# 
#     :param preamble:
#         A preamble to add to the file (e.g. "#This is an auto-generated file")
#     """
#     if fname_in is None:
#         raise ValueError('Must specify an input file')
# 
#     if not os.path.exists(fname_in):
#         raise IOError('File not found: {}'.format(fname_in))
# 
#     text = preamble or ''
#     text = '\n'.join((text, load_text(fname_in, strict=strict)))
# 
#     if fname_out is not None:
#         with open(fname_out, 'w') as f:
#             print(text, file=f)
# 
#         return None         # Just being explicit
#     else:
#         return text


# Path: setup.py
import sys
from setuptools import setup
from scripts.load_as_rst import convert
    from setuptools_scm import get_version

# -*- coding: utf-8 -*-
#
#  setup.py
#  cjktools
#

"""
Package setup file for the cjktools package.
"""



try:

    VERSION = get_version()

    with open('cjktools/__version__.py', 'w') as f:
        f.write('# Autogenerated by setup.py\n')
        f.write('version = "%s"\n' % VERSION)

except ImportError:
    pass


LONG_DESCRIPTION = convert('README.md', strict=False)