Skip to content

Commit

Permalink
Fallback to previous directory if user already has plugins rc file
Browse files Browse the repository at this point in the history
  • Loading branch information
jrom99 authored Mar 27, 2024
1 parent 3dc6c22 commit e6c6a70
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modules/pymol/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ def user_data_dir(appname, *args, **kwargs):
return f"~/.local/share/{appname}"

# variables
data_dir = os.path.expanduser(user_data_dir("pymol"))
if not os.path.exists(data_dir):
def _get_pymolplugins_rc_path():
f1 = os.path.expanduser("~/.pymolpluginsrc.py")
if os.path.exists(f1):
return f1

data_dir = os.path.expanduser(user_data_dir("pymol"))
os.makedirs(data_dir, exist_ok=True)
PYMOLPLUGINSRC = os.path.join(data_dir, 'pymolpluginsrc.py')
return os.path.join(data_dir, 'pymolpluginsrc.py')

PYMOLPLUGINSRC = _get_pymolplugins_rc_path()

preferences = {
'verbose': False,
Expand Down

0 comments on commit e6c6a70

Please sign in to comment.