Compare commits
2 Commits
9b61c1b3c7
...
6e64eadc27
Author | SHA1 | Date |
---|---|---|
JoYo | 6e64eadc27 | |
JoYo | 1884f8df7b |
|
@ -8,6 +8,6 @@ RUN apt-get update && apt-get install -y \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
COPY ./banana/ /app/banana/
|
COPY ./banana/ /app/banana/
|
||||||
COPY pyproject.toml /app/
|
COPY setup.py /app/
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
RUN pip3 install --no-deps .
|
RUN pip3 install --no-deps .
|
||||||
|
|
12
README.mdown
12
README.mdown
|
@ -1,9 +1,19 @@
|
||||||
# Elder Scrolls Online Commadline Addon Manager
|
# Elder Scrolls Online Commadline Addon Manager
|
||||||
|
|
||||||
Elder Scrolls Online addon manager and a Tamriel Trade Centre price table updater
|
Elder Scrolls Online addon manager and a Tamriel Trade Centre price table updater.
|
||||||
|
|
||||||
[MIT License](LICENSE)
|
[MIT License](LICENSE)
|
||||||
|
|
||||||
|
It is recommended that you back up your ESO live profile before using `banana` in case you want to revert back.
|
||||||
|
|
||||||
|
On Windows, press `Windows Key + e` to open a file explorer and enter the following path in the address bar:
|
||||||
|
|
||||||
|
```
|
||||||
|
%HOME%\Documents\Elder Scrolls Online\
|
||||||
|
```
|
||||||
|
|
||||||
|
Make a copy of the `live` folder and rename it to something meaningful like `old` or `backup`.
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,7 +3,13 @@ from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def new(path: Path):
|
def new(path: Path):
|
||||||
config = {"addons": ["https://www.esoui.com/downloads/info7-LibAddonMenu.html"]}
|
config = {
|
||||||
|
"addons": [
|
||||||
|
"https://www.esoui.com/downloads/info7-LibAddonMenu.html",
|
||||||
|
"https://www.esoui.com/downloads/info1245-TamrielTradeCentre.html",
|
||||||
|
"https://www.esoui.com/downloads/info1146-LibCustomMenu.html",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
with path.open("w") as file_open:
|
with path.open("w") as file_open:
|
||||||
config = yaml.dump(config, file_open, default_flow_style=False)
|
config = yaml.dump(config, file_open, default_flow_style=False)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
from argparse import ArgumentParser
|
|
||||||
import logging
|
|
||||||
import requests
|
import requests
|
||||||
|
import re
|
||||||
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from . import config
|
from . import config
|
||||||
|
|
||||||
|
@ -44,7 +45,29 @@ def periodical_script():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config.valid(config_current)
|
config.valid(config_current)
|
||||||
except AssertionError:
|
except (AssertionError, AttributeError):
|
||||||
config.new(config_path)
|
config.new(config_path)
|
||||||
config_current = config.load(config_path)
|
config_current = config.load(config_path)
|
||||||
logging.info(f'addons list created at "{config_path}"')
|
logging.info(f'addons list created at "{config_path}"')
|
||||||
|
|
||||||
|
esoui_prefix = re.compile("https://www.esoui.com/downloads/info[0-9]+\-")
|
||||||
|
addon_names = list()
|
||||||
|
|
||||||
|
for url in config_current.get("addons"):
|
||||||
|
addon = esoui_prefix.split(url)[1]
|
||||||
|
addon = addon.split(".html")[0]
|
||||||
|
addon_names.append(addon)
|
||||||
|
|
||||||
|
logging.info(addon_names)
|
||||||
|
|
||||||
|
version_html = re.compile('<div\s+id="version">Version:\s+[^<]+')
|
||||||
|
version_split = re.compile('<div\s+id="version">Version:\s+')
|
||||||
|
addon_versions = list()
|
||||||
|
|
||||||
|
for url in config_current.get("addons"):
|
||||||
|
response = requests.get(url)
|
||||||
|
version_line = version_html.search(response.text)
|
||||||
|
version = version_split.split(version_line.group(0))[1]
|
||||||
|
addon_versions.append(version)
|
||||||
|
|
||||||
|
logging.info(addon_versions)
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="eso-banana",
|
||||||
|
version="0.0.1",
|
||||||
|
packages=["banana"],
|
||||||
|
entry_points={
|
||||||
|
"console_scripts": ["eso-banana-script = banana:scripts.periodical_script"],
|
||||||
|
},
|
||||||
|
python_requires=">3",
|
||||||
|
install_requires=["requests", "PyYAML"],
|
||||||
|
)
|
Loading…
Reference in New Issue