# Path: src/config.py
# DEFAULT_KEY = 'Falldog'
# 
# EXE_SRC_DIR = join(SRC_DIR, 'pyconcrete_exe')
# 
# EXT_SRC_DIR = join(SRC_DIR, 'pyconcrete_ext')
# 
# PY_SRC_DIR = join(SRC_DIR, 'pyconcrete')
# 
# SECRET_HEADER_PATH = join(EXT_SRC_DIR, 'secret_key.h')
# 
# SRC_DIR = join('src')
# 
# TEST_DIR = 'test'


import hashlib
import imp
import os
import subprocess
import sys
import sysconfig
        import unittest
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.command.install import install
from distutils.core import Command, Extension, setup
from distutils.dist import Distribution
from os.path import join
from src.config import DEFAULT_KEY, EXE_SRC_DIR, EXT_SRC_DIR, PY_SRC_DIR, SECRET_HEADER_PATH, SRC_DIR, TEST_DIR

    with open(SECRET_HEADER_PATH, 'w') as f:
        f.write(code)


def remove_secret_key_header():
    if os.path.exists(SECRET_HEADER_PATH):
        os.remove(SECRET_HEADER_PATH)


class ExeDistribution(Distribution):
    exe_modules = ()

    def has_exe_modules(self):
        return self.exe_modules and len(self.exe_modules) > 0


# ================================================= command ================================================= #


class CmdBase:
    def pre_process(self):
        self.manual_create_secrete_key_file = not os.path.exists(SECRET_HEADER_PATH)
        if self.manual_create_secrete_key_file:
            self.passphrase = os.getenv('PASSPHRASE')
            if not self.passphrase:
                self.passphrase = input(
                    "please input the passphrase \nfor encrypt your python script (enter for default) : \n"
                )
                if len(self.passphrase) == 0:

# Path: src/config.py
# DEFAULT_KEY = 'Falldog'
# 
# EXE_SRC_DIR = join(SRC_DIR, 'pyconcrete_exe')
# 
# EXT_SRC_DIR = join(SRC_DIR, 'pyconcrete_ext')
# 
# PY_SRC_DIR = join(SRC_DIR, 'pyconcrete')
# 
# SECRET_HEADER_PATH = join(EXT_SRC_DIR, 'secret_key.h')
# 
# SRC_DIR = join('src')
# 
# TEST_DIR = 'test'


# Path: setup.py
import hashlib
import imp
import os
import subprocess
import sys
import sysconfig
        import unittest
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.command.install import install
from distutils.core import Command, Extension, setup
from distutils.dist import Distribution
from os.path import join
from src.config import DEFAULT_KEY, EXE_SRC_DIR, EXT_SRC_DIR, PY_SRC_DIR, SECRET_HEADER_PATH, SRC_DIR, TEST_DIR


    with open(SECRET_HEADER_PATH, 'w') as f:
        f.write(code)


def remove_secret_key_header():
    if os.path.exists(SECRET_HEADER_PATH):
        os.remove(SECRET_HEADER_PATH)


class ExeDistribution(Distribution):
    exe_modules = ()

    def has_exe_modules(self):
        return self.exe_modules and len(self.exe_modules) > 0


# ================================================= command ================================================= #


class CmdBase:
    def pre_process(self):
        self.manual_create_secrete_key_file = not os.path.exists(SECRET_HEADER_PATH)
        if self.manual_create_secrete_key_file:
            self.passphrase = os.getenv('PASSPHRASE')
            if not self.passphrase:
                self.passphrase = input(
                    "please input the passphrase \nfor encrypt your python script (enter for default) : \n"
                )
                if len(self.passphrase) == 0:

                    self.passphrase = DEFAULT_KEY