diff --git a/.gitignore b/.gitignore index 95cd414..ed376b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ _* -.venv \ No newline at end of file +.venv +swisseph \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b92f0c4..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "swisseph"] - path = swisseph - url = https://github.com/aloistr/swisseph.git diff --git a/astrolobot.py b/astrolobot.py index fbfec31..fd28170 100644 --- a/astrolobot.py +++ b/astrolobot.py @@ -2,13 +2,31 @@ import swisseph as swe from datetime import datetime import webbrowser from urllib.parse import quote_plus +from urllib.request import urlretrieve from threading import Thread -from os import chdir +from os import makedirs,path import http.server import asyncio import twitchio import json +def download_files(): + if not path.exists(script_path()+'swisseph/ephe/'): + makedirs(script_path()+'swisseph/ephe/') + #if not path.exists(script_path()+'swisseph/ephe/sefstars.txt'): + # print('downloading sefstars.txt') + # urlretrieve('https://github.com/aloistr/swisseph/raw/refs/heads/master/ephe/sefstars.txt',script_path()+'swisseph/ephe/sefstars.txt') + if not path.exists(script_path()+'swisseph/ephe/seas_18.se1'): + print('downloading seas_18.se1') + urlretrieve('https://github.com/aloistr/swisseph/raw/refs/heads/master/ephe/seas_18.se1',script_path()+'swisseph/ephe/seas_18.se1') + #if not path.exists(script_path()+'swisseph/ephe/semo_18.se1'): + # print('downloadingh semo_18.se1') + # urlretrieve('https://github.com/aloistr/swisseph/raw/refs/heads/master/ephe/semo_18.se1',script_path()+'swisseph/ephe/semo_18.se1') + #if not path.exists(script_path()+'swisseph/ephe/sepl_18.se1'): + # print('downloading sepl_18.se1') + # urlretrieve('https://github.com/aloistr/swisseph/raw/refs/heads/master/ephe/sepl_18.se1',script_path()+'swisseph/ephe/sepl_18.se1') + print('swiss ephemeris files ready') + def get_planet_info(): # make sure location is set in THIS thread swe.set_ephe_path(script_path()+'swisseph/ephe/') @@ -149,6 +167,8 @@ def script_load(settings): pip.main(['install','-qqq','pyswisseph','twitchio','twitchio[starlette]']) obspython.obs_data_set_bool(settings,'pip_done',True) + download_files() + obs_settings=settings def script_unload():