move keys.py and options.py to the data directory

This commit is contained in:
Abigail 2019-11-02 16:56:03 -04:00
parent af3f341c27
commit 824af34cbf
3 changed files with 24 additions and 26 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ cty.json
cty.zip cty.zip
botenv/ botenv/
data/
######################################################### #########################################################

View File

@ -1,31 +1,24 @@
# A quick installation script for discord bots. # A quick installation script for painless discord bots.
# # v1.1.0
# Copyright (c) 2019 0x5c # Copyright (c) 2019 0x5c
# Released under the terms of the MIT license. # Released under the terms of the MIT license.
# # Part of:
# https://github.com/0x5c/discord.py-quickinstall # https://github.com/0x5c/quick-bot-no-pain
#### Setup ####
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
## Variables ## ### Variables ###
# Those are the defaults; they can be over-ridden if specified # Those are the defaults; they can be over-ridden if specified
# at en environment level or as 'make' arguments. # at en environment level or as 'make' arguments.
BOTENV ?= botenv BOTENV ?= botenv
PY3DOT ?= 7 PYTHON_BIN ?= python3.7
PIP_OUTPUT ?= q PIP_OUTPUT ?= -q
# Define some rules as phony ### Support targets ###
.PHONY: help install clean onlyenv
#### Targets ####
## Support targets ##
.PHONY: help
help: help:
@echo "" @echo ""
@echo "\033[97m>>>>>> Default dummy target <<<<<<" @echo "\033[97m>>>>>> Default dummy target <<<<<<"
@ -35,16 +28,17 @@ help:
@echo "\033[0m" @echo "\033[0m"
## Actual install/setup targets ## ### Actual install/setup targets ###
# Main install target # Main install target
.PHONY: install
install: $(BOTENV)/req_done options.py keys.py install: $(BOTENV)/req_done options.py keys.py
# Virual environment setup # Virual environment setup
$(BOTENV)/success: $(BOTENV)/success:
ifneq ("$(wildcard ./$(BOTENV).)",) ifneq ("$(wildcard ./$(BOTENV).)",)
@echo "\033[94m--> Creating the virtual environment...\033[0m" @echo "\033[94m--> Creating the virtual environment...\033[0m"
@python3.$(PY3DOT) -m venv $(BOTENV) @$(PYTHON_BIN) -m venv $(BOTENV)
@touch $(BOTENV)/success @touch $(BOTENV)/success
endif endif
@ -52,17 +46,19 @@ endif
$(BOTENV)/req_done: requirements.txt $(BOTENV)/success $(BOTENV)/req_done: requirements.txt $(BOTENV)/success
@echo "\033[34;1m--> Installing the dependencies...\033[0m" @echo "\033[34;1m--> Installing the dependencies...\033[0m"
@. $(BOTENV)/bin/activate; \ @. $(BOTENV)/bin/activate; \
pip install -${PIP_OUTPUT} -U pip setuptools wheel; \ pip install ${PIP_OUTPUT} -U pip setuptools wheel; \
pip install -${PIP_OUTPUT} -U -r requirements.txt pip install ${PIP_OUTPUT} -U -r requirements.txt
@touch $(BOTENV)/req_done @touch $(BOTENV)/req_done
@mkdir ./data
# Copying templates # Copying templates
options.py keys.py: options.py keys.py:
@echo "\033[34;1m--> Copying template files...\033[0m" @echo "\033[34;1m--> Copying template files...\033[0m"
@cp -nv ./templates/template_$@ ./$@ @cp -nv ./templates/template_$@ ./data/$@
@touch ./$@ @touch ./data/$@
# Deletes the python cache and the virtual environment # Deletes the python cache and the virtual environment
.PHONY: clean
clean: clean:
@echo "\033[34;1m--> Removing python cache files...\033[0m" @echo "\033[34;1m--> Removing python cache files...\033[0m"
rm -rf __pycache__ rm -rf __pycache__
@ -70,8 +66,9 @@ clean:
rm -rf $(BOTENV) rm -rf $(BOTENV)
## Dev targets ## ### Dev targets ###
## Weird dev targets ## ### Special targets ###
.PHONY: onlyenv
onlyenv: $(BOTENV)/success onlyenv: $(BOTENV)/success

View File

@ -15,8 +15,8 @@ from discord.ext import commands, tasks
import info import info
import options as opt from data import options as opt
import keys from data import keys as keys
# --- Settings --- # --- Settings ---