Fix some errors and create folder for module

This commit is contained in:
Antonio J. Delgado 2021-03-23 12:23:06 +02:00
parent 1df842ac4a
commit b518f6986a
4 changed files with 7 additions and 6 deletions

View file

@ -86,7 +86,8 @@ destination_path="${DEPLOYMENT_PATH}/${PROJECT_CODENAME}"
mkdir -p "${DEPLOYMENT_PATH}" mkdir -p "${DEPLOYMENT_PATH}"
script_path=$(dirname "${0}") script_path=$(dirname "${0}")
cp "${script_path}/skeleton" "${destination_path}" -rfp cp "${script_path}/skeleton" "${destination_path}" -rfp
mv "${destination_path}/project_codename.py" "${destination_path}/${PROJECT_CODENAME}.py" mv "${destination_path}/project_codename" "${destination_path}/${PROJECT_CODENAME}"
mv "${destination_path}/${PROJECT_CODENAME}/project_codename.py" "${destination_path}/${PROJECT_CODENAME}/${PROJECT_CODENAME}.py"
while read -r file while read -r file
do do
sed -i "s/__project_codename__/${PROJECT_CODENAME}/g" "${file}" sed -i "s/__project_codename__/${PROJECT_CODENAME}/g" "${file}"

View file

@ -14,7 +14,7 @@ from logging.handlers import SysLogHandler
class __project_codename__: class __project_codename__:
def _init_(self, debug_level, log_file): def __init__(self, debug_level, log_file):
''' Initial function called when object is created ''' ''' Initial function called when object is created '''
self.config = dict() self.config = dict()
self.config['debug_level'] = debug_level self.config['debug_level'] = debug_level
@ -44,7 +44,7 @@ class __project_codename__:
log_file = os.path.join(log_folder, "__project_codename__.log") log_file = os.path.join(log_folder, "__project_codename__.log")
if not os.path.exists(os.path.dirname(log_file)): if not os.path.exists(os.path.dirname(log_file)):
os.path.mkdir(os.path.dirname(log_file)) os.mkdir(os.path.dirname(log_file))
filehandler = logging.handlers.RotatingFileHandler(log_file, maxBytes=102400000) filehandler = logging.handlers.RotatingFileHandler(log_file, maxBytes=102400000)
# create formatter # create formatter

View file

@ -1,9 +1,9 @@
[metadata] [metadata]
name = %project_codename% name = __project_codename__
version = %version% version = __version__
[options] [options]
packages = %project_codename% packages = __project_codename__
install_requires = install_requires =
requests requests
importlib; python_version == "3.6" importlib; python_version == "3.6"