diff --git a/.gitignore b/.gitignore index 98657ce..5b38aca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ lib/ *.zip .tcn-cache/ *.db +test.config.ini +output/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/README.md b/README.md index a89a6a2..9495400 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,20 @@ user_expiry_s: `3600` number of seconds to keep user API results from twitch bef vodlist_expiry_s: `600` number of seconds to keep list of user's vods with tagged users from twitch API before expiring. Can be long, but if a new public vod goes up, it won't be picked up until this expires +### CLI Parameters + +- **-c \** | **--conf_file \** + - Accepts a filepath for a config file to use instead of the default `config.ini` found next to the program +- **-o \** | **--output_file \{datetime.today().strftime('%Y-%m-%d')}
Depth: {depth}, Connections: {len(users)}", + heading=f"Twitch Collab Network: {','.join(config.primary_channelnames)}" + f"
{datetime.today().strftime('%Y-%m-%d')}" + f"
Depth: {depth}, Connections: {len(users)}", select_menu=False, filter_menu=True, neighborhood_highlight=True) net.from_nx(G) options = '{"nodes": {"borderWidth": 5}}' @@ -118,9 +158,17 @@ async def twitch_run(): net.set_options(options) net.set_template_dir(os.path.join(cwd, 'templates'), 'template.html') - net.write_html(name="output.html", notebook=False, local=True, open_browser=False) + + output_dir = os.path.dirname(OUTPUT_FILE) + if not os.path.exists(output_dir): + os.makedirs(output_dir) + net.write_html(name=OUTPUT_FILE, notebook=False, local=True, open_browser=False) + + if not os.path.exists(os.path.join(output_dir, 'lib')) and os.path.exists('lib'): + shutil.copytree("lib", os.path.join(output_dir, "lib")) logger.info("Completed in {:.2f} seconds".format(time_since(start_time=start_time))) + logger.info(f"Output: {os.path.abspath(OUTPUT_FILE)}") if twitch_utils.cache: twitch_utils.cache.expire()