# Path: utility/manage.py
# class CodeInfo(object):
#     def __init__(self):
#         self.code_info_path = os.path.join(os.path.dirname(__file__), '..', 'RENATE-OD.info')
#         self._load_code_info()
#         self._check_authorised_user()
# 
#     def _load_code_info(self):
#         self.code_info_tree = etree.parse(self.code_info_path)
#         self.code_name = self.code_info_tree.find('head').find('code_name').text
#         self.code_abbreviation = self.code_info_tree.find('head').find('code_abbreviation').text
#         self.code_license = self.code_info_tree.find('body').find('code_license').text
#         self.code_version = Version(self.code_info_tree.find('body').find('code_version').text)
#         self.code_install_requirements_path = self.code_info_tree.find('body').find('code_install_requirement').text
#         self.code_package = self.code_info_tree.find('body').find('code_package').text
#         self.code_git_link = self.code_info_tree.find('body').find('code_git_link').text
#         self._load_classifiers()
#         self._load_install_requirements()
# 
#     def _load_classifiers(self):
#         list_of_classifiers = ['classifier_audience', 'classifier_natural_language',
#                                'classifier_programming_language', 'classifier_topic']
#         self.classifiers = []
#         for classifier in list_of_classifiers:
#             self.classifiers.append(self.code_info_tree.find('body').find(classifier).text)
# 
#     def _load_install_requirements(self):
#         requirements_path = os.path.join(os.path.dirname(__file__), '..', self.code_install_requirements_path)
#         self.code_requirements = {}
#         with open(requirements_path) as requirements_file:
#             lines = requirements_file.readlines()
# 
#             for line in lines:
#                 line_content = re.split('==|<=|>=', line)
#                 self.code_requirements.update({line_content[0]: Version(line_content[1])})
# 
#     def _check_authorised_user(self):
#         access = AccessData(data_path_name=None)
#         if access.private_key is None:
#             self.authorization = False
#         else:
#             self.authorization = True
# 
#     def update_data(self, attribute, value=None):
#         if not isinstance(attribute, str):
#             raise TypeError('The <attribute> input is expected to be a str.')
#         if self.authorization:
#             if hasattr(self, attribute):
#                 if value is not None:
#                     setattr(self, attribute, value)
#                 self.code_info_tree.find('body').find(attribute).text = str(getattr(self, attribute))
#                 self.code_info_tree.write(self.code_info_path)
#                 print('Updates XML file by rewriting: ' + attribute + ' with: ' + str(getattr(self, attribute)))
#                 return True
#             else:
#                 raise AttributeError('The CodeInfo object has no attribute: ' + attribute)
#         else:
#             raise RenateAuthorizedUserError('You are not an authorized user to perform changes on Code information!')


from utility.manage import CodeInfo
from setuptools import setup, find_packages, Extension
    from Cython.Build import cythonize
import sys
import numpy
import os
import os.path as path
import multiprocessing


use_cython = True
force = False
profile = False

if "--skip-cython" in sys.argv:
    use_cython = False
    del sys.argv[sys.argv.index("--skip-cython")]


# Path: utility/manage.py
# class CodeInfo(object):
#     def __init__(self):
#         self.code_info_path = os.path.join(os.path.dirname(__file__), '..', 'RENATE-OD.info')
#         self._load_code_info()
#         self._check_authorised_user()
# 
#     def _load_code_info(self):
#         self.code_info_tree = etree.parse(self.code_info_path)
#         self.code_name = self.code_info_tree.find('head').find('code_name').text
#         self.code_abbreviation = self.code_info_tree.find('head').find('code_abbreviation').text
#         self.code_license = self.code_info_tree.find('body').find('code_license').text
#         self.code_version = Version(self.code_info_tree.find('body').find('code_version').text)
#         self.code_install_requirements_path = self.code_info_tree.find('body').find('code_install_requirement').text
#         self.code_package = self.code_info_tree.find('body').find('code_package').text
#         self.code_git_link = self.code_info_tree.find('body').find('code_git_link').text
#         self._load_classifiers()
#         self._load_install_requirements()
# 
#     def _load_classifiers(self):
#         list_of_classifiers = ['classifier_audience', 'classifier_natural_language',
#                                'classifier_programming_language', 'classifier_topic']
#         self.classifiers = []
#         for classifier in list_of_classifiers:
#             self.classifiers.append(self.code_info_tree.find('body').find(classifier).text)
# 
#     def _load_install_requirements(self):
#         requirements_path = os.path.join(os.path.dirname(__file__), '..', self.code_install_requirements_path)
#         self.code_requirements = {}
#         with open(requirements_path) as requirements_file:
#             lines = requirements_file.readlines()
# 
#             for line in lines:
#                 line_content = re.split('==|<=|>=', line)
#                 self.code_requirements.update({line_content[0]: Version(line_content[1])})
# 
#     def _check_authorised_user(self):
#         access = AccessData(data_path_name=None)
#         if access.private_key is None:
#             self.authorization = False
#         else:
#             self.authorization = True
# 
#     def update_data(self, attribute, value=None):
#         if not isinstance(attribute, str):
#             raise TypeError('The <attribute> input is expected to be a str.')
#         if self.authorization:
#             if hasattr(self, attribute):
#                 if value is not None:
#                     setattr(self, attribute, value)
#                 self.code_info_tree.find('body').find(attribute).text = str(getattr(self, attribute))
#                 self.code_info_tree.write(self.code_info_path)
#                 print('Updates XML file by rewriting: ' + attribute + ' with: ' + str(getattr(self, attribute)))
#                 return True
#             else:
#                 raise AttributeError('The CodeInfo object has no attribute: ' + attribute)
#         else:
#             raise RenateAuthorizedUserError('You are not an authorized user to perform changes on Code information!')


# Path: setup.py
from utility.manage import CodeInfo
from setuptools import setup, find_packages, Extension
    from Cython.Build import cythonize
import sys
import numpy
import os
import os.path as path
import multiprocessing



use_cython = True
force = False
profile = False

if "--skip-cython" in sys.argv:
    use_cython = False
    del sys.argv[sys.argv.index("--skip-cython")]


if "--force" in sys.argv: