Skip to content

Instantly share code, notes, and snippets.

@derekbrokeit
Created January 15, 2013 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekbrokeit/1b84b2ad3503395f1041 to your computer and use it in GitHub Desktop.
Save derekbrokeit/1b84b2ad3503395f1041 to your computer and use it in GitHub Desktop.
Set mono as default for pymol. Pymol stereo can still be run with `pymol -S`
diff --git a/modules/pymol/__init__.py b/modules/pymol/__init__.py
index 3b95856..a28970a 100644
--- a/modules/pymol/__init__.py
+++ b/modules/pymol/__init__.py
@@ -163,6 +163,12 @@ if pymol_launch != 3: # if this isn't a dry run
# or via execfile(".../pymol/__init__.py",...) from main
if not hasattr(__main__,"pymol_argv"):
+ try:
+ # check if explicitly stereo
+ idx_explicit_stereo = sys.argv.index("-S")
+ except ValueError:
+ # force mono
+ sys.argv += ["-M"]
__main__.pymol_argv = sys.argv
pymol_launch = -1 # non-threaded launch import flag
@@ -530,6 +536,12 @@ if pymol_launch != 3: # if this isn't a dry run
args = pymol_argv+["-K"] # keep PyMOL thread alive
else:
args = list(args)
+ try:
+ # check if explicitly stereo
+ idx_explicit_stereo = args.index("-S")
+ except ValueError:
+ # force mono
+ args += ["-M"]
if pymol_launch == 2: # spawn thread -- 'import pymol'
global glutThreadObject
cmd.reaper = threading.currentThread()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment