Difference between revisions of "Plugindirectory"

From PyMOLWiki
Jump to: navigation, search
(Python Code)
(Infobox script-repo, some corrections)
Line 1: Line 1:
 +
{{Infobox script-repo
 +
|type      = module
 +
|filename  = plugins/__init__.py
 +
|author    = [[User:Speleo3|Thomas Holder]]
 +
|license  = BSD
 +
}}
 +
 
== Introduction ==
 
== Introduction ==
  
 
This page describes how to set up a personal plugin directory, that will automatically install plugins found herein.  
 
This page describes how to set up a personal plugin directory, that will automatically install plugins found herein.  
 
It supports single python files as well as directories which contain a __init__.py file.
 
It supports single python files as well as directories which contain a __init__.py file.
 
This plugin is being used in the Pymol-script-repo project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].
 
  
 
== Adding Pymol-script-repo to PyMOL search path ==
 
== Adding Pymol-script-repo to PyMOL search path ==
You should have the '''Pymol-script-repo''' directory added to your PyMOL search path.
+
You should have the '''Pymol-script-repo''' directory added to your Python search path.
 
In '''Pymol-script-repo''', is located the folder '''plugins''', which holds the plugin to be automatically installed.
 
In '''Pymol-script-repo''', is located the folder '''plugins''', which holds the plugin to be automatically installed.
  
We need to import import folder '''Pymol-script-repo/plugins''' before the GUI launches. So insert '''import plugins''' into your [[pymolrc|$HOME/.pymolrc]] file:
+
We need to import module '''plugins''' (folder '''Pymol-script-repo/plugins''') before the GUI launches. So insert into your [[pymolrc|$HOME/.pymolrc]] file:
 +
 
 +
<syntaxhighlight lang="python">
 +
# eventually add ~/Pymol-script-repo to sys.path
 +
import sys, os
 +
sys.path.append(os.path.expanduser('~/Pymol-script-repo'))
 +
 
 +
# load the module
 +
import plugins
 +
</syntaxhighlight>
  
 
=== For windows users ===
 
=== For windows users ===
 
# Open notepad
 
# Open notepad
# Write (Remember forward slashes)
+
# Paste lines from above
import sys
+
# Save under: '''C:/Users/YOURNAME/pymolrc.pym''' (Set: "Save as type" to "All files")
sys.path.append('C:/Users/YOURNAME/Documents/Pymol-script-repo')
 
import plugins
 
Save under: '''C:/Users/YOURNAME/pymolrc.pym''' (Set: "Save as type" to "All files")
 
  
 
=== For Ubuntu/Mint users ===
 
=== For Ubuntu/Mint users ===
gedit ~/.pymolrc
+
# gedit ~/.pymolrc
Write
+
# Paste lines from above
import sys
+
# Save and exit
sys.path.append('/home/YOURNAME/Software/pymol/Pymol-script-repo')
 
import plugins
 
Save and exit
 
 
 
== Python Code ==
 
 
 
{{Template:PymolScriptRepoDownload|plugins/__init__.py}}
 
 
 
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]

Revision as of 05:12, 18 December 2011

Type Python Module
Download plugins/__init__.py
Author(s) Thomas Holder
License BSD
This code has been put under version control in the project Pymol-script-repo

Introduction

This page describes how to set up a personal plugin directory, that will automatically install plugins found herein. It supports single python files as well as directories which contain a __init__.py file.

Adding Pymol-script-repo to PyMOL search path

You should have the Pymol-script-repo directory added to your Python search path. In Pymol-script-repo, is located the folder plugins, which holds the plugin to be automatically installed.

We need to import module plugins (folder Pymol-script-repo/plugins) before the GUI launches. So insert into your $HOME/.pymolrc file:

# eventually add ~/Pymol-script-repo to sys.path
import sys, os
sys.path.append(os.path.expanduser('~/Pymol-script-repo'))

# load the module
import plugins

For windows users

  1. Open notepad
  2. Paste lines from above
  3. Save under: C:/Users/YOURNAME/pymolrc.pym (Set: "Save as type" to "All files")

For Ubuntu/Mint users

  1. gedit ~/.pymolrc
  2. Paste lines from above
  3. Save and exit