Skip to content

Commit

Permalink
@jrom99 Fallback to previous directory if user already has installed…
Browse files Browse the repository at this point in the history
… plugins there
  • Loading branch information
jrom99 authored Mar 27, 2024
1 parent e6c6a70 commit ed80c60
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/pymol/plugins/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ def get_default_user_plugin_path():
User plugin directory defaults to $XDG_DATA_HOME/startup on Linux and to
%APPDATA%\pymol\startup on windows.
'''
dirname = "startup"
if 'APPDATA' in os.environ:
return os.path.join(os.environ['APPDATA'], 'pymol', 'startup')
return os.path.expanduser(os.path.join(user_data_dir("pymol"), "startup"))
return os.path.join(os.environ['APPDATA'], 'pymol', dirname)

dir1, dir2 = "~/.pymol", user_data_dir("pymol")
d1 = os.path.expanduser(os.path.join(dir1, dirname))
d2 = os.path.expanduser(os.path.join(dir2, dirname))
return d1 if os.path.exists(d1) else d2


def is_writable(dirname):
'''
Expand Down

0 comments on commit ed80c60

Please sign in to comment.