mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-04-22 03:50:28 +03:00
Better save file handling
By using the plugin_dir, we always save in the plugin's folder. This is useful when the plugin folder has another name (for example: EDMC_SpanshRouter) and works cross platform.
This commit is contained in:
parent
2080a40331
commit
5195c37d8b
8
load.py
8
load.py
@ -18,12 +18,8 @@ this.parent = None
|
||||
this.save_route_path = ""
|
||||
|
||||
|
||||
def plugin_start():
|
||||
if sys.platform == 'win32':
|
||||
this.save_route_path = os.path.expandvars(r'%LOCALAPPDATA%\EDMarketConnector\plugins\SpanshRouter\route.csv')
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
this.save_route_path = home + "/.local/share/EDMarketConnector/plugins/SpanshRouter/route.csv"
|
||||
def plugin_start(plugin_dir):
|
||||
this.save_route_path = os.path.join(plugin_dir, 'route.csv')
|
||||
|
||||
try:
|
||||
# Open the last saved route
|
||||
|
Loading…
x
Reference in New Issue
Block a user