├── docs ├── .nojekyll ├── objects.inv ├── _static │ ├── up.png │ ├── down.png │ ├── file.png │ ├── minus.png │ ├── plus.png │ ├── comment.png │ ├── up-pressed.png │ ├── ajax-loader.gif │ ├── down-pressed.png │ ├── comment-bright.png │ ├── comment-close.png │ ├── pygments.css │ ├── classic.css │ ├── sidebar.js │ ├── doctools.js │ ├── underscore.js │ ├── basic.css │ ├── searchtools.js │ └── websupport.js ├── _sources │ ├── modules.rst.txt │ ├── module_manager.ui.rst.txt │ ├── module_manager.utils.rst.txt │ ├── module_manager.install.rst.txt │ ├── module_manager.constants.rst.txt │ ├── module_manager.rst.txt │ └── index.rst.txt ├── _images │ └── module-manager-example.png ├── .buildinfo ├── searchindex.js ├── module_manager.constants.html ├── search.html ├── module_manager.ui.html ├── module_manager.install.html ├── modules.html ├── py-modindex.html ├── index.html ├── module_manager.html ├── genindex.html └── module_manager.utils.html ├── .gitignore ├── icons └── MM_icon.png ├── scripts ├── userSetup.py └── module_manager │ ├── constants.py │ ├── install.py │ ├── __init__.py │ ├── utils.py │ └── ui.py ├── module-manager.mod ├── LICENSE ├── README.md └── module-manager.mel /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *idea 2 | *.py[cod] 3 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/objects.inv -------------------------------------------------------------------------------- /icons/MM_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/icons/MM_icon.png -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/up.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | module_manager 2 | ============== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | module_manager 8 | -------------------------------------------------------------------------------- /docs/_images/module-manager-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertjoosten/maya-module-manager/HEAD/docs/_images/module-manager-example.png -------------------------------------------------------------------------------- /docs/_sources/module_manager.ui.rst.txt: -------------------------------------------------------------------------------- 1 | module\_manager\.ui module 2 | ========================== 3 | 4 | .. automodule:: module_manager.ui 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_sources/module_manager.utils.rst.txt: -------------------------------------------------------------------------------- 1 | module\_manager\.utils module 2 | ============================= 3 | 4 | .. automodule:: module_manager.utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /scripts/userSetup.py: -------------------------------------------------------------------------------- 1 | from maya import cmds 2 | 3 | 4 | def main(): 5 | from module_manager import install 6 | install.shelf() 7 | 8 | 9 | if not cmds.about(batch=True): 10 | cmds.evalDeferred(main) 11 | -------------------------------------------------------------------------------- /docs/_sources/module_manager.install.rst.txt: -------------------------------------------------------------------------------- 1 | module\_manager\.install module 2 | =============================== 3 | 4 | .. automodule:: module_manager.install 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_sources/module_manager.constants.rst.txt: -------------------------------------------------------------------------------- 1 | module\_manager\.constants module 2 | ================================= 3 | 4 | .. automodule:: module_manager.constants 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: a3e2b783865283f28235d2257b9e4276 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /module-manager.mod: -------------------------------------------------------------------------------- 1 | + MAYAVERSION:2017 module-manager 1.0.1 2 | + MAYAVERSION:2018 module-manager 1.0.1 3 | + MAYAVERSION:2019 module-manager 1.0.1 4 | + MAYAVERSION:2020 module-manager 1.0.1 5 | + MAYAVERSION:2022 module-manager 1.0.1 -------------------------------------------------------------------------------- /scripts/module_manager/constants.py: -------------------------------------------------------------------------------- 1 | from maya import cmds 2 | 3 | 4 | MODULE_ARGUMENTS = [ 5 | "MAYAVERSION", 6 | "PLATFORM", 7 | "LOCALE", 8 | ] 9 | MAYA_ARGUMENTS = { 10 | "MAYAVERSION": cmds.about(version=True), 11 | "PLATFORM": cmds.about(operatingSystem=True), 12 | "LOCALE": cmds.about(uiLanguage=True), 13 | } 14 | -------------------------------------------------------------------------------- /docs/_sources/module_manager.rst.txt: -------------------------------------------------------------------------------- 1 | module\_manager package 2 | ======================= 3 | 4 | .. automodule:: module_manager 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | Submodules 10 | ---------- 11 | 12 | .. toctree:: 13 | 14 | module_manager.constants 15 | module_manager.install 16 | module_manager.ui 17 | module_manager.utils 18 | 19 | -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. module_manager documentation master file, created by 2 | sphinx-quickstart on Sat Jun 05 09:46:59 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to module_manager's documentation! 7 | ========================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: Contents: 12 | 13 | 14 | 15 | Indices and tables 16 | ================== 17 | 18 | * :ref:`genindex` 19 | * :ref:`modindex` 20 | * :ref:`search` 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Robert Joosten 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # maya-module-manager 2 | Module manager for Maya. 3 | 4 | ## Installation 5 | * Extract the content of the .rar file anywhere on disk. 6 | * Drag the module-manager.mel file in Maya to permanently install the script. 7 | 8 | ## Usage 9 |

10 | 11 | Modules can be (de)activated by toggling the checkbox **[2]**. The user is also presented with other information regarding the module, its version, the maya version, platform and language. By default the manager will only show you modules that are compatible with the version of Maya you are running, by toggling the `show all` checkbox all modules associated with the file can be edited. Press the folder to open the module file with the associated application. This will make it possible to easily edit the file manually if need be **[4]**. 12 | 13 | The file itself can be managed directly by pressing the folder button next to the module filename **[1]**. Doing this will open up the file in the associated application. It is also possible to dive directly into the module code itself by pressing the folder button **[3]**. This will open up the folder of the module content in your browser. 14 | 15 | This manager edits the module files on disk, it is possible that the user won't have permissions to edit the module files. If this is the case the module will still be displayed but the widget is disabled preventing the user from editing the file **[5]**. 16 | -------------------------------------------------------------------------------- /scripts/module_manager/install.py: -------------------------------------------------------------------------------- 1 | from maya import cmds 2 | from maya import mel 3 | 4 | 5 | ROOT_PACKAGE = __name__.rsplit(".", 1)[0] 6 | SHELF_NAME = "MiscTools" 7 | SHELF_TOOL = { 8 | "label": "module-manager", 9 | "command": "import {0}.ui; {0}.ui.show()".format(ROOT_PACKAGE), 10 | "annotation": "Manage maya modules", 11 | "image1": "MM_icon.png", 12 | "sourceType": "python" 13 | } 14 | 15 | 16 | def shelf(): 17 | """ 18 | Add a new shelf in Maya with the tools that is provided in the SHELF_TOOL 19 | variable. If the tab exists it will be checked to see if the button is 20 | already added. If this is the case the previous button will be deleted and 21 | a new one will be created in its place. 22 | """ 23 | # get top shelf 24 | shelf_container = mel.eval("$tmpVar=$gShelfTopLevel") 25 | shelves = cmds.tabLayout(shelf_container, query=True, childArray=True) 26 | 27 | # create shelf 28 | if SHELF_NAME not in shelves: 29 | cmds.shelfLayout(SHELF_NAME, parent=shelf_container) 30 | 31 | # get existing members 32 | names = cmds.shelfLayout(SHELF_NAME, query=True, childArray=True) or [] 33 | labels = [cmds.shelfButton(n, query=True, label=True) for n in names] 34 | 35 | # delete existing button 36 | if SHELF_TOOL.get("label") in labels: 37 | index = labels.index(SHELF_TOOL["label"]) 38 | cmds.deleteUI(names[index]) 39 | 40 | # add button 41 | cmds.shelfButton(style="iconOnly", parent=SHELF_NAME, **SHELF_TOOL) 42 | -------------------------------------------------------------------------------- /scripts/module_manager/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module manager for Maya. 3 | 4 | Installation 5 | ============ 6 | * Extract the content of the .rar file anywhere on disk. 7 | * Drag the module-manager.mel file in Maya to permanently install the script. 8 | 9 | Usage 10 | ===== 11 | 12 | .. figure:: /_images/module-manager-example.png 13 | :align: center 14 | 15 | Modules can be (de)activated by toggling the checkbox **[2]**. The user is 16 | also presented with other information regarding the module, its version, the 17 | maya version, platform and language. By default the manager will only show you 18 | modules that are compatible with the version of Maya you are running, by 19 | toggling the `show all` checkbox all modules associated with the file can be 20 | edited. Press the folder to open the module file with the associated 21 | application. This will make it possible to easily edit the file manually if 22 | need be **[4]**. 23 | 24 | The file itself can be managed directly by pressing the folder button next to 25 | the module filename **[1]**. Doing this will open up the file in the 26 | associated application. It is also possible to dive directly into the module 27 | code itself by pressing the folder button **[3]**. This will open up the 28 | folder of the module content in your browser. 29 | 30 | This manager edits the module files on disk, it is possible that the user 31 | won't have permissions to edit the module files. If this is the case the 32 | module will still be displayed but the widget is disabled preventing the user 33 | from editing the file **[5]**. 34 | """ -------------------------------------------------------------------------------- /docs/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["index","module_manager","module_manager.constants","module_manager.install","module_manager.ui","module_manager.utils","modules"],envversion:52,filenames:["index.rst","module_manager.rst","module_manager.constants.rst","module_manager.install.rst","module_manager.ui.rst","module_manager.utils.rst","modules.rst"],objects:{"":{module_manager:[1,0,0,"-"]},"module_manager.install":{shelf:[3,1,1,""]},"module_manager.ui":{show:[4,1,1,""]},"module_manager.utils":{divider:[5,1,1,""],filter_module_file:[5,1,1,""],get_icon_path:[5,1,1,""],get_main_window:[5,1,1,""],get_module_file_paths:[5,1,1,""],get_module_paths:[5,1,1,""],parse_module_line:[5,1,1,""],read_module_file:[5,1,1,""],update_module_file:[5,1,1,""]},module_manager:{constants:[2,0,0,"-"],install:[3,0,0,"-"],ui:[4,0,0,"-"],utils:[5,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":[1,3,5],"default":1,"new":3,"return":5,Doing:1,The:1,abov:5,activ:1,add:3,added:3,addit:5,all:[1,5],alreadi:3,also:1,anywher:1,applic:1,associ:1,base:5,belong:5,bool:5,browser:1,button:[1,3],can:[1,5],cannot:5,check:[3,5],checkbox:1,code:1,compat:1,constant:[1,6],content:[1,5],creat:3,data:5,defin:5,delet:3,dict:5,directli:1,disabl:1,disk:1,displai:1,dive:1,divid:5,doe:5,drag:1,each:5,easili:1,edit:1,either:5,exist:3,extract:1,file:[1,5],file_nam:5,file_path:5,filenam:1,filter_module_fil:5,folder:1,found:5,from:1,gener:5,get:5,get_icon_path:5,get_main_window:5,get_module_file_path:5,get_module_path:5,have:1,icon:5,index:0,inform:[1,5],instal:6,its:[1,3,5],itself:1,languag:1,line:5,list:5,main:5,make:1,manag:1,manual:1,match:5,maya:[1,3,5],mean:5,mel:1,modul:[0,1,6],name:5,need:[1,5],next:1,none:5,obtain:5,one:[3,5],onli:1,open:1,other:1,packag:6,page:0,paramet:5,parent:5,pars:5,parse_module_lin:5,path:5,perman:1,permiss:1,place:3,platform:1,possibl:1,present:1,press:1,prevent:1,previou:3,process:5,provid:[3,5],qframe:5,qmainwindow:5,qtwidget:5,qwidget:5,rais:5,rar:1,read:5,read_module_fil:5,regard:1,run:1,runtimeerror:5,script:1,search:0,see:[3,5],shelf:3,shelf_tool:3,show:[1,4],start:5,state:5,still:1,str:5,submodul:6,tab:3,thi:[1,3,5],toggl:1,tool:3,type:5,updat:5,update_module_fil:5,usag:6,user:1,util:[1,6],variabl:[3,5],version:1,when:5,which:5,widget:1,window:5,won:1,xbmlangpath:5,you:1,your:1},titles:["Welcome to module_manager\u2019s documentation!","module_manager package","module_manager.constants module","module_manager.install module","module_manager.ui module","module_manager.utils module","module_manager"],titleterms:{constant:2,document:0,indic:0,instal:[1,3],modul:[2,3,4,5],module_manag:[0,1,2,3,4,5,6],packag:1,submodul:1,tabl:0,usag:1,util:5,welcom:0}}) -------------------------------------------------------------------------------- /docs/module_manager.constants.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager.constants module — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager.constants module

48 |
49 | 50 | 51 |
52 |
53 |
54 | 75 |
76 |
77 | 89 | 93 | 94 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | Search — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 48 | 49 |
50 |
51 |
52 |
53 | 54 |

Search

55 |
56 | 57 |

58 | Please activate JavaScript to enable the search 59 | functionality. 60 |

61 |
62 |

63 | From here you can search these documents. Enter your search 64 | words into the box below and click "search". Note that the search 65 | function will automatically search for all of the words. Pages 66 | containing fewer words won't appear in the result list. 67 |

68 |
69 | 70 | 71 | 72 |
73 | 74 |
75 | 76 |
77 | 78 |
79 |
80 |
81 | 85 |
86 |
87 | 99 | 103 | 104 | -------------------------------------------------------------------------------- /docs/module_manager.ui.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager.ui module — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager.ui module

48 |
49 |
50 | module_manager.ui.show()
51 |
52 | 53 |
54 | 55 | 56 |
57 |
58 |
59 | 80 |
81 |
82 | 94 | 98 | 99 | -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/module_manager.install.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager.install module — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager.install module

48 |
49 |
50 | module_manager.install.shelf()
51 |

Add a new shelf in Maya with the tools that is provided in the SHELF_TOOL 52 | variable. If the tab exists it will be checked to see if the button is 53 | already added. If this is the case the previous button will be deleted and 54 | a new one will be created in its place.

55 |
56 | 57 |
58 | 59 | 60 |
61 |
62 |
63 | 84 |
85 |
86 | 98 | 102 | 103 | -------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager

48 | 64 |
65 | 66 | 67 |
68 |
69 |
70 | 91 |
92 |
93 | 105 | 109 | 110 | -------------------------------------------------------------------------------- /docs/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | Python Module Index — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 43 | 44 |
45 |
46 |
47 |
48 | 49 | 50 |

Python Module Index

51 | 52 |
53 | m 54 |
55 | 56 | 57 | 58 | 60 | 61 | 63 | 66 | 67 | 68 | 71 | 72 | 73 | 76 | 77 | 78 | 81 | 82 | 83 | 86 |
 
59 | m
64 | module_manager 65 |
    69 | module_manager.constants 70 |
    74 | module_manager.install 75 |
    79 | module_manager.ui 80 |
    84 | module_manager.utils 85 |
87 | 88 | 89 |
90 |
91 |
92 | 106 |
107 |
108 | 120 | 124 | 125 | -------------------------------------------------------------------------------- /docs/_static/classic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * classic.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- classic theme. 6 | * 7 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #133f52; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li, div.body blockquote { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | code { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning code { 241 | background: #efc2c2; 242 | } 243 | 244 | .note code { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } 257 | 258 | div.code-block-caption { 259 | color: #efefef; 260 | background-color: #1c4e63; 261 | } -------------------------------------------------------------------------------- /docs/_static/sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * sidebar.js 3 | * ~~~~~~~~~~ 4 | * 5 | * This script makes the Sphinx sidebar collapsible. 6 | * 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton 9 | * used to collapse and expand the sidebar. 10 | * 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden 12 | * and the width of the sidebar and the margin-left of the document 13 | * are decreased. When the sidebar is expanded the opposite happens. 14 | * This script saves a per-browser/per-session cookie used to 15 | * remember the position of the sidebar among the pages. 16 | * Once the browser is closed the cookie is deleted and the position 17 | * reset to the default (expanded). 18 | * 19 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 20 | * :license: BSD, see LICENSE for details. 21 | * 22 | */ 23 | 24 | $(function() { 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | // global elements used by the functions. 34 | // the 'sidebarbutton' element is defined as global after its 35 | // creation, in the add_sidebar_button function 36 | var bodywrapper = $('.bodywrapper'); 37 | var sidebar = $('.sphinxsidebar'); 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); 39 | 40 | // for some reason, the document has no sidebar; do not run into errors 41 | if (!sidebar.length) return; 42 | 43 | // original margin-left of the bodywrapper and width of the sidebar 44 | // with the sidebar expanded 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); 46 | var ssb_width_expanded = sidebar.width(); 47 | 48 | // margin-left of the bodywrapper and width of the sidebar 49 | // with the sidebar collapsed 50 | var bw_margin_collapsed = '.8em'; 51 | var ssb_width_collapsed = '.8em'; 52 | 53 | // colors used by the current theme 54 | var dark_color = $('.related').css('background-color'); 55 | var light_color = $('.document').css('background-color'); 56 | 57 | function sidebar_is_collapsed() { 58 | return sidebarwrapper.is(':not(:visible)'); 59 | } 60 | 61 | function toggle_sidebar() { 62 | if (sidebar_is_collapsed()) 63 | expand_sidebar(); 64 | else 65 | collapse_sidebar(); 66 | } 67 | 68 | function collapse_sidebar() { 69 | sidebarwrapper.hide(); 70 | sidebar.css('width', ssb_width_collapsed); 71 | bodywrapper.css('margin-left', bw_margin_collapsed); 72 | sidebarbutton.css({ 73 | 'margin-left': '0', 74 | 'height': bodywrapper.height() 75 | }); 76 | sidebarbutton.find('span').text('»'); 77 | sidebarbutton.attr('title', _('Expand sidebar')); 78 | document.cookie = 'sidebar=collapsed'; 79 | } 80 | 81 | function expand_sidebar() { 82 | bodywrapper.css('margin-left', bw_margin_expanded); 83 | sidebar.css('width', ssb_width_expanded); 84 | sidebarwrapper.show(); 85 | sidebarbutton.css({ 86 | 'margin-left': ssb_width_expanded-12, 87 | 'height': bodywrapper.height() 88 | }); 89 | sidebarbutton.find('span').text('«'); 90 | sidebarbutton.attr('title', _('Collapse sidebar')); 91 | document.cookie = 'sidebar=expanded'; 92 | } 93 | 94 | function add_sidebar_button() { 95 | sidebarwrapper.css({ 96 | 'float': 'left', 97 | 'margin-right': '0', 98 | 'width': ssb_width_expanded - 28 99 | }); 100 | // create the button 101 | sidebar.append( 102 | '
«
' 103 | ); 104 | var sidebarbutton = $('#sidebarbutton'); 105 | light_color = sidebarbutton.css('background-color'); 106 | // find the height of the viewport to center the '<<' in the page 107 | var viewport_height; 108 | if (window.innerHeight) 109 | viewport_height = window.innerHeight; 110 | else 111 | viewport_height = $(window).height(); 112 | sidebarbutton.find('span').css({ 113 | 'display': 'block', 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 115 | }); 116 | 117 | sidebarbutton.click(toggle_sidebar); 118 | sidebarbutton.attr('title', _('Collapse sidebar')); 119 | sidebarbutton.css({ 120 | 'color': '#FFFFFF', 121 | 'border-left': '1px solid ' + dark_color, 122 | 'font-size': '1.2em', 123 | 'cursor': 'pointer', 124 | 'height': bodywrapper.height(), 125 | 'padding-top': '1px', 126 | 'margin-left': ssb_width_expanded - 12 127 | }); 128 | 129 | sidebarbutton.hover( 130 | function () { 131 | $(this).css('background-color', dark_color); 132 | }, 133 | function () { 134 | $(this).css('background-color', light_color); 135 | } 136 | ); 137 | } 138 | 139 | function set_position_from_cookie() { 140 | if (!document.cookie) 141 | return; 142 | var items = document.cookie.split(';'); 143 | for(var k=0; k 4 | 5 | 6 | 7 | 8 | module_manager package — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager package

48 |

Module manager for Maya.

49 |
50 |

Installation

51 |
    52 |
  • Extract the content of the .rar file anywhere on disk.
  • 53 |
  • Drag the module-manager.mel file in Maya to permanently install the script.
  • 54 |
55 |
56 |
57 |

Usage

58 |
59 | _images/module-manager-example.png 60 |
61 |

Modules can be (de)activated by toggling the checkbox [2]. The user is 62 | also presented with other information regarding the module, its version, the 63 | maya version, platform and language. By default the manager will only show you 64 | modules that are compatible with the version of Maya you are running, by 65 | toggling the show all checkbox all modules associated with the file can be 66 | edited. Press the folder to open the module file with the associated 67 | application. This will make it possible to easily edit the file manually if 68 | need be [4].

69 |

The file itself can be managed directly by pressing the folder button next to 70 | the module filename [1]. Doing this will open up the file in the 71 | associated application. It is also possible to dive directly into the module 72 | code itself by pressing the folder button [3]. This will open up the 73 | folder of the module content in your browser.

74 |

This manager edits the module files on disk, it is possible that the user 75 | won’t have permissions to edit the module files. If this is the case the 76 | module will still be displayed but the widget is disabled preventing the user 77 | from editing the file [5].

78 |
79 | 90 |
91 | 92 | 93 |
94 |
95 |
96 | 127 |
128 |
129 | 141 | 145 | 146 | -------------------------------------------------------------------------------- /docs/module_manager.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager package — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager package

48 |

Module manager for Maya.

49 |
50 |

Installation

51 |
    52 |
  • Extract the content of the .rar file anywhere on disk.
  • 53 |
  • Drag the module-manager.mel file in Maya to permanently install the script.
  • 54 |
55 |
56 |
57 |

Usage

58 |
59 | _images/module-manager-example.png 60 |
61 |

Modules can be (de)activated by toggling the checkbox [2]. The user is 62 | also presented with other information regarding the module, its version, the 63 | maya version, platform and language. By default the manager will only show you 64 | modules that are compatible with the version of Maya you are running, by 65 | toggling the show all checkbox all modules associated with the file can be 66 | edited. Press the folder to open the module file with the associated 67 | application. This will make it possible to easily edit the file manually if 68 | need be [4].

69 |

The file itself can be managed directly by pressing the folder button next to 70 | the module filename [1]. Doing this will open up the file in the 71 | associated application. It is also possible to dive directly into the module 72 | code itself by pressing the folder button [3]. This will open up the 73 | folder of the module content in your browser.

74 |

This manager edits the module files on disk, it is possible that the user 75 | won’t have permissions to edit the module files. If this is the case the 76 | module will still be displayed but the widget is disabled preventing the user 77 | from editing the file [5].

78 |
79 | 90 |
91 | 92 | 93 |
94 |
95 |
96 | 127 |
128 |
129 | 141 | 145 | 146 | -------------------------------------------------------------------------------- /docs/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | Index — module_manager '' documentation 10 | 11 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 41 | 42 |
43 |
44 |
45 |
46 | 47 | 48 |

Index

49 | 50 |
51 | D 52 | | F 53 | | G 54 | | M 55 | | P 56 | | R 57 | | S 58 | | U 59 | 60 |
61 |

D

62 | 63 | 67 |
68 | 69 |

F

70 | 71 | 75 |
76 | 77 |

G

78 | 79 | 85 | 91 |
92 | 93 |

M

94 | 95 | 101 | 109 |
110 | 111 |

P

112 | 113 | 117 |
118 | 119 |

R

120 | 121 | 125 |
126 | 127 |

S

128 | 129 | 133 | 137 |
138 | 139 |

U

140 | 141 | 145 |
146 | 147 | 148 | 149 |
150 |
151 |
152 | 169 |
170 |
171 | 183 | 187 | 188 | -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | 128 | }, 129 | 130 | /** 131 | * i18n support 132 | */ 133 | TRANSLATIONS : {}, 134 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 135 | LOCALE : 'unknown', 136 | 137 | // gettext and ngettext don't access this so that the functions 138 | // can safely bound to a different name (_ = Documentation.gettext) 139 | gettext : function(string) { 140 | var translated = Documentation.TRANSLATIONS[string]; 141 | if (typeof translated == 'undefined') 142 | return string; 143 | return (typeof translated == 'string') ? translated : translated[0]; 144 | }, 145 | 146 | ngettext : function(singular, plural, n) { 147 | var translated = Documentation.TRANSLATIONS[singular]; 148 | if (typeof translated == 'undefined') 149 | return (n == 1) ? singular : plural; 150 | return translated[Documentation.PLURALEXPR(n)]; 151 | }, 152 | 153 | addTranslations : function(catalog) { 154 | for (var key in catalog.messages) 155 | this.TRANSLATIONS[key] = catalog.messages[key]; 156 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 157 | this.LOCALE = catalog.locale; 158 | }, 159 | 160 | /** 161 | * add context elements like header anchor links 162 | */ 163 | addContextElements : function() { 164 | $('div[id] > :header:first').each(function() { 165 | $('\u00B6'). 166 | attr('href', '#' + this.id). 167 | attr('title', _('Permalink to this headline')). 168 | appendTo(this); 169 | }); 170 | $('dt[id]').each(function() { 171 | $('\u00B6'). 172 | attr('href', '#' + this.id). 173 | attr('title', _('Permalink to this definition')). 174 | appendTo(this); 175 | }); 176 | }, 177 | 178 | /** 179 | * workaround a firefox stupidity 180 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 181 | */ 182 | fixFirefoxAnchorBug : function() { 183 | if (document.location.hash) 184 | window.setTimeout(function() { 185 | document.location.href += ''; 186 | }, 10); 187 | }, 188 | 189 | /** 190 | * highlight the search words provided in the url in the text 191 | */ 192 | highlightSearchWords : function() { 193 | var params = $.getQueryParameters(); 194 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 195 | if (terms.length) { 196 | var body = $('div.body'); 197 | if (!body.length) { 198 | body = $('body'); 199 | } 200 | window.setTimeout(function() { 201 | $.each(terms, function() { 202 | body.highlightText(this.toLowerCase(), 'highlighted'); 203 | }); 204 | }, 10); 205 | $('') 207 | .appendTo($('#searchbox')); 208 | } 209 | }, 210 | 211 | /** 212 | * init the domain index toggle buttons 213 | */ 214 | initIndexTable : function() { 215 | var togglers = $('img.toggler').click(function() { 216 | var src = $(this).attr('src'); 217 | var idnum = $(this).attr('id').substr(7); 218 | $('tr.cg-' + idnum).toggle(); 219 | if (src.substr(-9) == 'minus.png') 220 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 221 | else 222 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 223 | }).css('display', ''); 224 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 225 | togglers.click(); 226 | } 227 | }, 228 | 229 | /** 230 | * helper function to hide the search marks again 231 | */ 232 | hideSearchWords : function() { 233 | $('#searchbox .highlight-link').fadeOut(300); 234 | $('span.highlighted').removeClass('highlighted'); 235 | }, 236 | 237 | /** 238 | * make the url absolute 239 | */ 240 | makeURL : function(relativeURL) { 241 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 242 | }, 243 | 244 | /** 245 | * get the current relative url 246 | */ 247 | getCurrentURL : function() { 248 | var path = document.location.pathname; 249 | var parts = path.split(/\//); 250 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 251 | if (this == '..') 252 | parts.pop(); 253 | }); 254 | var url = parts.join('/'); 255 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 256 | }, 257 | 258 | initOnKeyListeners: function() { 259 | $(document).keyup(function(event) { 260 | var activeElementType = document.activeElement.tagName; 261 | // don't navigate when in search box or textarea 262 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 263 | switch (event.keyCode) { 264 | case 37: // left 265 | var prevHref = $('link[rel="prev"]').prop('href'); 266 | if (prevHref) { 267 | window.location.href = prevHref; 268 | return false; 269 | } 270 | case 39: // right 271 | var nextHref = $('link[rel="next"]').prop('href'); 272 | if (nextHref) { 273 | window.location.href = nextHref; 274 | return false; 275 | } 276 | } 277 | } 278 | }); 279 | } 280 | }; 281 | 282 | // quick alias for translations 283 | _ = Documentation.gettext; 284 | 285 | $(document).ready(function() { 286 | Documentation.init(); 287 | }); -------------------------------------------------------------------------------- /docs/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /scripts/module_manager/ui.py: -------------------------------------------------------------------------------- 1 | import os 2 | import webbrowser 3 | from functools import partial 4 | from PySide2 import QtWidgets, QtGui, QtCore 5 | 6 | from module_manager import utils 7 | from module_manager.constants import MAYA_ARGUMENTS 8 | 9 | 10 | FONT = QtGui.QFont() 11 | FONT.setFamily("Consolas") 12 | BOLT_FONT = QtGui.QFont() 13 | BOLT_FONT.setFamily("Consolas") 14 | BOLT_FONT.setWeight(100) 15 | 16 | ICON_PATH = utils.get_icon_path("MM_icon.png") 17 | FILE_ICON_PATH = ":/fileOpen.png" 18 | ORANGE_STYLESHEET = "color: orange; text-align: left" 19 | 20 | 21 | class MayaModuleDetailArgument(QtWidgets.QWidget): 22 | def __init__(self, parent, key, value): 23 | super(MayaModuleDetailArgument, self).__init__(parent) 24 | 25 | # create layout 26 | layout = QtWidgets.QHBoxLayout(self) 27 | layout.setContentsMargins(0, 0, 0, 0) 28 | layout.setSpacing(3) 29 | 30 | # create key 31 | label = QtWidgets.QLabel(self) 32 | label.setFont(BOLT_FONT) 33 | label.setText(key) 34 | layout.addWidget(label) 35 | 36 | # create value 37 | label = QtWidgets.QLabel(self) 38 | label.setFont(FONT) 39 | label.setText(value) 40 | layout.addWidget(label) 41 | 42 | 43 | class MayaModuleDetail(QtWidgets.QWidget): 44 | enabled_changed = QtCore.Signal(bool, dict) 45 | 46 | def __init__(self, parent, data): 47 | super(MayaModuleDetail, self).__init__(parent) 48 | 49 | # variables 50 | self._data = data 51 | self._path = self.get_path() 52 | scale_factor = self.logicalDpiX() / 96.0 53 | 54 | # create layout 55 | layout = QtWidgets.QHBoxLayout(self) 56 | layout.setContentsMargins(7, 0, 7, 0) 57 | layout.setSpacing(3) 58 | 59 | # create enabled 60 | enabled_state = data.get("ENABLED") == "+" 61 | 62 | enabled = QtWidgets.QCheckBox(self) 63 | enabled.setChecked(enabled_state) 64 | enabled.setFont(BOLT_FONT) 65 | enabled.setText(data.get("NAME")) 66 | enabled.stateChanged.connect(self._emit_enabled_changed) 67 | enabled.setToolTip("Enable/Disable module") 68 | layout.addWidget(enabled) 69 | 70 | # create version 71 | version = QtWidgets.QLabel(self) 72 | version.setFont(FONT) 73 | version.setText(data.get("VERSION")) 74 | version.setFixedWidth(85 * scale_factor) 75 | layout.addWidget(version) 76 | 77 | # create maya version 78 | maya_version = MayaModuleDetailArgument(self, "Maya Version:", data.get("MAYAVERSION", "-")) 79 | layout.addWidget(maya_version) 80 | 81 | # create platform 82 | platform = MayaModuleDetailArgument(self, "Platform:", data.get("PLATFORM", "-")) 83 | layout.addWidget(platform) 84 | 85 | # create language 86 | language = MayaModuleDetailArgument(self, "Locale:", data.get("LOCALE", "-")) 87 | layout.addWidget(language) 88 | 89 | # create path 90 | browser = QtWidgets.QPushButton(self) 91 | browser.setEnabled(True if self.path else False) 92 | browser.setFlat(True) 93 | browser.setIcon(QtGui.QIcon(FILE_ICON_PATH)) 94 | browser.setFixedSize(QtCore.QSize(18 * scale_factor, 18 * scale_factor)) 95 | browser.released.connect(partial(webbrowser.open, self.path)) 96 | browser.setToolTip("Open module content path with associated browser") 97 | layout.addWidget(browser) 98 | 99 | def _emit_enabled_changed(self, state): 100 | """ 101 | :param bool state: 102 | """ 103 | data = self.data.copy() 104 | self.enabled_changed.emit(state, data) 105 | 106 | # ------------------------------------------------------------------------ 107 | 108 | @property 109 | def data(self): 110 | """ 111 | :return: Data 112 | :rtype: dict 113 | """ 114 | return self._data 115 | 116 | @property 117 | def path(self): 118 | """ 119 | :return: Path 120 | :rtype: str 121 | """ 122 | return self._path 123 | 124 | def get_path(self): 125 | """ 126 | :return: Path to module 127 | :rtype: str 128 | """ 129 | # get path 130 | path = self.data.get("PATH") 131 | 132 | # if the path is not an absolute path, use the parents path variable 133 | # to append the relative path to. 134 | if not os.path.isabs(path): 135 | path = os.path.join(os.path.dirname(self.parent().path), path) 136 | path = os.path.abspath(path) 137 | 138 | # open path 139 | return os.path.normpath(path) 140 | 141 | # ------------------------------------------------------------------------ 142 | 143 | def is_compatible(self): 144 | """ 145 | Validate the data against the current version of Maya ran, the 146 | platform it's ran on and it's language. 147 | 148 | :return: Validation state 149 | :rtype: bool 150 | """ 151 | # validate data against current version of maya, the platform its ran 152 | for key, value in MAYA_ARGUMENTS.items(): 153 | if key not in self.data: 154 | continue 155 | 156 | if self.data.get(key) != value: 157 | return False 158 | 159 | return True 160 | 161 | 162 | class MayaModuleFileHeader(QtWidgets.QWidget): 163 | show_all_changed = QtCore.Signal(bool) 164 | 165 | def __init__(self, parent, path, show_all): 166 | super(MayaModuleFileHeader, self).__init__(parent) 167 | scale_factor = self.logicalDpiX() / 96.0 168 | 169 | # create layout 170 | layout = QtWidgets.QHBoxLayout(self) 171 | layout.setContentsMargins(0, 0, 0, 0) 172 | layout.setSpacing(3) 173 | 174 | # create path 175 | browser = QtWidgets.QPushButton(self) 176 | browser.setFlat(True) 177 | browser.setIcon(QtGui.QIcon(FILE_ICON_PATH)) 178 | browser.setFixedSize(QtCore.QSize(18 * scale_factor, 18 * scale_factor)) 179 | browser.released.connect(partial(webbrowser.open, path)) 180 | browser.setToolTip("Open module file with associated application") 181 | layout.addWidget(browser) 182 | 183 | # create text 184 | button = QtWidgets.QPushButton(self) 185 | button.setFlat(True) 186 | button.setFont(BOLT_FONT) 187 | button.setText(os.path.basename(path)) 188 | button.setStyleSheet(ORANGE_STYLESHEET) 189 | button.setToolTip(path) 190 | button.released.connect(self.toggle_check_box) 191 | layout.addWidget(button) 192 | 193 | # create checkbox 194 | self._check_box = QtWidgets.QCheckBox(self) 195 | self._check_box.setFixedWidth(80 * scale_factor) 196 | self._check_box.setFont(FONT) 197 | self._check_box.setText("show all") 198 | self._check_box.setChecked(show_all) 199 | self._check_box.stateChanged.connect(self.show_all_changed.emit) 200 | layout.addWidget(self._check_box) 201 | 202 | # ------------------------------------------------------------------------ 203 | 204 | def toggle_check_box(self): 205 | """ 206 | Toggle the checked state of the checkbox. 207 | """ 208 | state = self._check_box.isChecked() 209 | self._check_box.setChecked(not state) 210 | 211 | 212 | class MayaModuleFile(QtWidgets.QFrame): 213 | def __init__(self, parent, path): 214 | super(MayaModuleFile, self).__init__(parent) 215 | 216 | # variables 217 | show_all = False 218 | self._path = path 219 | 220 | # set outline 221 | self.setFrameShape(QtWidgets.QFrame.Box) 222 | self.setFrameShadow(QtWidgets.QFrame.Sunken) 223 | 224 | # create layout 225 | layout = QtWidgets.QVBoxLayout(self) 226 | layout.setContentsMargins(3, 3, 3, 3) 227 | layout.setSpacing(3) 228 | 229 | # create header 230 | header = MayaModuleFileHeader(self, path, show_all=show_all) 231 | header.show_all_changed.connect(self.manage_module_details) 232 | layout.addWidget(header) 233 | 234 | # create divider 235 | divider = utils.divider(self) 236 | layout.addWidget(divider) 237 | 238 | # check permissions 239 | if not os.access(path, os.W_OK): 240 | self.setEnabled(False) 241 | 242 | # add module details 243 | self.add_module_details() 244 | self.manage_module_details(show_all) 245 | 246 | # ------------------------------------------------------------------------ 247 | 248 | @property 249 | def path(self): 250 | """ 251 | :return: Path 252 | :rtype: str 253 | """ 254 | return self._path 255 | 256 | # ------------------------------------------------------------------------ 257 | 258 | def manage_module_details(self, state): 259 | """ 260 | Loop all widgets and either display all or filter the ones that are 261 | capable with the version of Maya that is ran. 262 | 263 | :param bool state: 264 | """ 265 | for i in range(self.layout().count()): 266 | widget = self.layout().itemAt(i).widget() 267 | if not isinstance(widget, MayaModuleDetail): 268 | continue 269 | 270 | visible = True if state else widget.is_compatible() 271 | widget.setVisible(visible) 272 | 273 | def add_module_details(self): 274 | """ 275 | Populate the widget with module data widgets, one for each module data 276 | line found in the module file. 277 | """ 278 | for data in utils.filter_module_file(self.path): 279 | mod = MayaModuleDetail(self, data) 280 | mod.enabled_changed.connect(self.update_module_file) 281 | self.layout().addWidget(mod) 282 | 283 | # ------------------------------------------------------------------------ 284 | 285 | def update_module_file(self, state, data): 286 | """ 287 | :param bool state: 288 | :param dict data: 289 | """ 290 | utils.update_module_file(self.path, state, data) 291 | 292 | 293 | # ---------------------------------------------------------------------------- 294 | 295 | 296 | class MayaModuleManager(QtWidgets.QWidget): 297 | def __init__(self, parent): 298 | super(MayaModuleManager, self).__init__(parent) 299 | scale_factor = self.logicalDpiX() / 96.0 300 | 301 | # set ui 302 | self.setParent(parent) 303 | self.setWindowFlags(QtCore.Qt.Window) 304 | self.setWindowTitle("Maya Module Manager") 305 | self.setWindowIcon(QtGui.QIcon(ICON_PATH)) 306 | self.resize(700 * scale_factor, 400 * scale_factor) 307 | 308 | # create container layout 309 | container = QtWidgets.QVBoxLayout(self) 310 | container.setContentsMargins(0, 0, 0, 0) 311 | container.setSpacing(3) 312 | 313 | # create scroll widget 314 | widget = QtWidgets.QWidget(self) 315 | self._layout = QtWidgets.QVBoxLayout(widget) 316 | self._layout.setContentsMargins(3, 3, 3, 3) 317 | self._layout.setSpacing(3) 318 | 319 | scroll = QtWidgets.QScrollArea(self) 320 | scroll.setFocusPolicy(QtCore.Qt.NoFocus) 321 | scroll.setWidgetResizable(True) 322 | scroll.setWidget(widget) 323 | container.addWidget(scroll) 324 | 325 | # add modules 326 | self.add_modules() 327 | 328 | # ------------------------------------------------------------------------ 329 | 330 | def add_modules(self): 331 | """ 332 | Populate the widget with module file widgets, one for each module file 333 | found. 334 | """ 335 | for path in utils.get_module_file_paths(): 336 | mod = MayaModuleFile(self, path) 337 | self._layout.addWidget(mod) 338 | 339 | 340 | def show(): 341 | parent = utils.get_main_window() 342 | window = MayaModuleManager(parent) 343 | window.show() 344 | -------------------------------------------------------------------------------- /module-manager.mel: -------------------------------------------------------------------------------- 1 | // *************************************************************************** 2 | // INSTALL MODULE 3 | // *************************************************************************** 4 | // 5 | // DESCRIPTION: 6 | // Add the module which is located in the same directory as the .mel file 7 | // into the first available MAYA_MODULE_PATH directory. It doesn't matter 8 | // where on disk the module lives as the script will make sure the path in 9 | // the .mod file links to the correct place. There are some basic sanity 10 | // checks in place to make sure the script doesn't error out. This includes 11 | // Maya version compatibility with the module. Permissions of the directories 12 | // files have to be written to and incorrectly formatted module files. 13 | // 14 | // REQUIRES: 15 | // - Template .mod file ( replace regular file path with ) 16 | // - Maya module ( scripts/icons/plug-ins etc directories ) 17 | // 18 | // USAGE: 19 | // source ; 20 | // 21 | // AUTHORS: 22 | // Robert Joosten - rwm.joosten@gmail.com 23 | // 24 | // LICENSE: 25 | // MIT 26 | // 27 | // VERSIONS: 28 | // 1.0.0 - Aug 23, 2018 - Initial Release. 29 | // 1.0.1 - Sep 17, 2018 - Allow for use in paths that contain a space. 30 | // 1.0.2 - Oct 03, 2018 - Fix path error installing on UNIX. 31 | // 1.0.3 - Jun 04, 2021 - Python 2/3 compatibility 32 | // 33 | // *************************************************************************** 34 | 35 | 36 | proc string[] getModulePathsFromEnvironment() 37 | { 38 | // get all of the paths in the MAYA_MODULE_PATH variable and split them 39 | // into a string array. 40 | string $paths[]; 41 | string $separator = (`about -nt`) ? ";" : ":"; 42 | tokenize(getenv("MAYA_MODULE_PATH"), $separator, $paths); 43 | 44 | return $paths; 45 | } 46 | 47 | // *************************************************************************** 48 | 49 | 50 | proc string findModuleFileInPath(string $path) 51 | { 52 | // get the first module file found in the directory. 53 | string $files[] = `getFileList -folder $path -filespec "*.mod"`; 54 | return $files[0]; 55 | } 56 | 57 | 58 | proc string findModuleFileInModulePath(string $moduleFile, string $modulePaths[]) 59 | { 60 | // loop module paths 61 | for( $path in $modulePaths ) 62 | { 63 | // find moduleFile in path 64 | string $files[] = `getFileList -folder $path -filespec $moduleFile`; 65 | if ($files[0] != "") 66 | return $path; 67 | } 68 | 69 | // declare empty output 70 | string $empty; 71 | return $empty; 72 | } 73 | 74 | 75 | // *************************************************************************** 76 | 77 | 78 | proc string[] readModuleFile(string $path) 79 | { 80 | // read the module file and return each line as a string part of a string 81 | // array. 82 | string $lines[]; 83 | 84 | $fileId = `fopen $path "r"`; 85 | string $data = `fread $fileId $data`; 86 | tokenize($data, "\n", $lines); 87 | 88 | return $lines; 89 | } 90 | 91 | 92 | // *************************************************************************** 93 | 94 | 95 | proc string getConditionValue(string $line) 96 | { 97 | // get the condition value by splitting the string on the : character and 98 | // returning the second section of the partition. 99 | string $partitions[]; 100 | tokenize($line, ":", $partitions); 101 | 102 | return $partitions[1]; 103 | } 104 | 105 | 106 | // *************************************************************************** 107 | 108 | 109 | proc string[] parseModuleLine(string $line) 110 | { 111 | // declare output variable 112 | string $output[]; 113 | 114 | // declare default output 115 | string $mayaVersion; 116 | string $language; 117 | string $platform; 118 | 119 | // make sure its a module line by checking if the line starts with a + 120 | // or -. 121 | if (startsWith($line, "+") == 0 && startsWith($line, "-") == 0) 122 | return $output; 123 | 124 | // get partitions 125 | string $partitions[]; 126 | tokenize($line, " ", $partitions); 127 | 128 | // get partitions length 129 | $length = size($partitions); 130 | 131 | // loop partitions in reverse 132 | for( $i=1; $i<$length+1; ++$i ) 133 | { 134 | // get reverse index 135 | int $index = $length - $i; 136 | string $part = $partitions[$index]; 137 | 138 | // extract conditions 139 | if (startsWith($part, "MAYAVERSION") == 1) 140 | { 141 | $mayaVersion = getConditionValue($part); 142 | stringArrayRemoveAtIndex($index, $partitions); 143 | } 144 | else if (startsWith($part, "LANGUAGE") == 1) 145 | { 146 | $language = getConditionValue($part); 147 | stringArrayRemoveAtIndex($index, $partitions); 148 | } 149 | else if (startsWith($part, "PLATFORM") == 1) 150 | { 151 | $platform = getConditionValue($part); 152 | stringArrayRemoveAtIndex($index, $partitions); 153 | } 154 | } 155 | 156 | // set output 157 | $output[0] = $partitions[0]; 158 | $output[1] = $partitions[1]; 159 | $output[2] = $partitions[2]; 160 | $output[3] = $partitions[3]; 161 | $output[4] = $mayaVersion; 162 | $output[5] = $language; 163 | $output[6] = $platform; 164 | 165 | return $output; 166 | } 167 | 168 | 169 | // *************************************************************************** 170 | 171 | 172 | proc string[] findModuleMatch(string $lines[]) 173 | { 174 | // get maya data 175 | string $mayaVersion = `about -version`; 176 | string $language = `about -uiLanguage`; 177 | string $platform = `about -operatingSystem`; 178 | 179 | // process module to see if its suitable for the current version of Maya. 180 | for($line in $lines) 181 | { 182 | // get line data 183 | string $lineData[] = parseModuleLine($line); 184 | 185 | // validate line data 186 | if ($lineData[0] == "") 187 | continue; 188 | 189 | // validate maya version 190 | if ($lineData[4] != "" && $lineData[4] != $mayaVersion) 191 | continue; 192 | 193 | // validate language 194 | if ($lineData[5] != "" && $lineData[5] != $language) 195 | continue; 196 | 197 | // validate platform 198 | if ($lineData[6] != "" && $lineData[6] != $platform) 199 | continue; 200 | 201 | // return match 202 | return $lineData; 203 | } 204 | 205 | // declare empty output 206 | string $empty[]; 207 | return $empty; 208 | } 209 | 210 | 211 | // *************************************************************************** 212 | 213 | 214 | proc loadModuleExtended(string $moduleFile, string $path) 215 | { 216 | // get separator 217 | string $separator = "/"; 218 | 219 | // load module 220 | loadModule -load $moduleFile; 221 | 222 | // add scripts path to system path, for some reason after loading the 223 | // module we are still not able to import the scripts even though the 224 | // path is available in the MAYA_SCRIPT_PATH. 225 | string $scriptPath = $path + $separator + "scripts"; 226 | python("import sys; sys.path.append('" + $scriptPath + "')"); 227 | 228 | // see if a userSetup.py is present in the script folder. If this is the 229 | // case execute that file. 230 | string $userSetup = $scriptPath + $separator + "userSetup.py"; 231 | if (`filetest -e $userSetup` == 1) 232 | python("import six; import __main__; six.exec_(open('" + $userSetup + "').read(), __main__.__dict__ )"); 233 | } 234 | 235 | 236 | // *************************************************************************** 237 | 238 | 239 | global proc installModule() 240 | { 241 | // get path from mel file 242 | string $melWhatIs = `whatIs "installModule"`; 243 | string $melWhatIsPath = `match ": (.*)" $melWhatIs`; 244 | 245 | int $melSize = `size $melWhatIsPath`; 246 | string $melPath = `substring $melWhatIsPath 3 ($melSize-3)`; 247 | string $path = dirname($melPath); 248 | 249 | // get separator 250 | string $separator = "/"; 251 | 252 | // find installed module 253 | string $modules[] = `moduleInfo -listModules`; 254 | 255 | // get module paths from the environment and choose the first one if this 256 | // variable is not overwritten the .mod file will be written to this path. 257 | string $modulePaths[] = getModulePathsFromEnvironment(); 258 | string $modulePathDefault; 259 | 260 | // find module in current directory 261 | string $moduleFileBase = findModuleFileInPath($path); 262 | 263 | // validate module 264 | if ($moduleFileBase == "") 265 | error("\nNo template module file found in " + $path); 266 | 267 | // find full module path 268 | string $moduleFile = $path + $separator + $moduleFileBase; 269 | 270 | // read module content 271 | string $moduleContent[] = readModuleFile($moduleFile); 272 | 273 | // find module match 274 | string $moduleMatch[] = findModuleMatch($moduleContent); 275 | string $moduleName = $moduleMatch[1]; 276 | string $moduleVersion = $moduleMatch[2]; 277 | 278 | // validate module content 279 | if ($moduleName == "") 280 | error("\nNo valid module information found matching the current version/language/platform of Maya in " + $moduleFile); 281 | 282 | // check if module already exists 283 | if (stringArrayContains($moduleName, $modules) == 1) 284 | { 285 | string $moduleVersionExisting = `moduleInfo -moduleName $moduleName -version`; 286 | string $existingPath = `moduleInfo -moduleName $moduleName -path`; 287 | 288 | if ($moduleVersion == $moduleVersionExisting && $path ==$existingPath) 289 | { 290 | print("The " + $moduleName + " module, version " + $moduleVersion + " at " + $path + " is already installed!"); 291 | return; 292 | } 293 | 294 | // find existing module path 295 | $modulePathDefault = findModuleFileInModulePath($moduleFileBase, $modulePaths); 296 | } 297 | 298 | // get existing module path to the front of the list 299 | if ($modulePathDefault != "") 300 | { 301 | int $index = stringArrayFind($modulePathDefault, 0, $modulePaths); 302 | stringArrayRemoveAtIndex($index, $modulePaths); 303 | stringArrayInsertAtIndex(0, $modulePaths, $modulePathDefault); 304 | } 305 | 306 | // loop module paths 307 | for($modulePath in $modulePaths) 308 | { 309 | // only allow default path to be written if it exists 310 | if ($modulePathDefault != "" && $modulePathDefault != $modulePath) 311 | continue; 312 | 313 | // create dir in case it doesn't exist 314 | sysFile -makeDir $modulePath; 315 | 316 | // construct module path 317 | string $outputPath = $modulePath + $separator + $moduleFileBase; 318 | 319 | // write module file 320 | $fileId = `fopen $outputPath "w"`; 321 | 322 | // if the default path exists error if the file cannot be written 323 | // this means the module has been installed by hand in a directory 324 | // that is not writable without administrator permissions. The error 325 | // will ask the user to copy the script by hand. 326 | if ($fileId == 0 && $modulePathDefault == $modulePath) 327 | error("\nThe " + $moduleName + " module, version " + $moduleVersion + " could not be updated as the current path it is installed in is not writable.\nPlease overwrite the " + $moduleFileBase + " file in " + $modulePath + "."); 328 | else if ($fileId == 0) 329 | continue; 330 | 331 | // write lines 332 | print("Content:\n"); 333 | for($line in $moduleContent){ 334 | string $processedLine = `substitute "" $line $path`; 335 | print(" " + $processedLine + "\n"); 336 | fprint $fileId ($processedLine + "\n"); 337 | } 338 | 339 | // print output 340 | print("Output:\n"); 341 | print(" " + $outputPath + "\n"); 342 | 343 | // close output path 344 | fclose $fileId; 345 | 346 | // load module 347 | loadModuleExtended($outputPath, $path); 348 | return; 349 | } 350 | 351 | // throw error as module has not been installed 352 | error("\nThe " + $moduleName + " module, version " + $moduleVersion + " could not be installed as non of the module paths were writable."); 353 | } 354 | 355 | // process 356 | installModule(); 357 | -------------------------------------------------------------------------------- /docs/module_manager.utils.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | module_manager.utils module — module_manager '' documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |
47 |

module_manager.utils module

48 |
49 |
50 | module_manager.utils.divider(parent)
51 |
52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
Parameters:parent (QtWidgets.QWidget) –
Return type:QtWidgets.QFrame
61 |
62 | 63 |
64 |
65 | module_manager.utils.filter_module_file(file_path)
66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
Parameters:file_path (str) –
Returns:Module data
Return type:generator
78 |
79 | 80 |
81 |
82 | module_manager.utils.get_icon_path(file_name)
83 |

Get an icon path based on file name. All paths in the XBMLANGPATH variable 84 | processed to see if the provided icon can be found.

85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
Parameters:file_name (str) –
Returns:Icon path
Return type:str/None
97 |
98 | 99 |
100 |
101 | module_manager.utils.get_main_window()
102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
Returns:Maya main window
Return type:QtWidgets.QMainWindow/None
Raises:RuntimeError – When the main window cannot be obtained.
114 |
115 | 116 |
117 |
118 | module_manager.utils.get_module_file_paths()
119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 |
Returns:Maya module files
Return type:list[str]
129 |
130 | 131 |
132 |
133 | module_manager.utils.get_module_paths()
134 |
135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
Returns:Maya module paths
Return type:list[str]
144 |
145 | 146 |
147 |
148 | module_manager.utils.parse_module_line(line)
149 |

Parse the line of a module, the line needs to start with either a + or a - 150 | if this is not the case it means it is additional information that belongs 151 | to the module which is defined in the lines above this one. If that is the 152 | case None is returned.

153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 |
Parameters:line (str) –
Returns:Module data
Return type:dict/None
165 |
166 | 167 |
168 |
169 | module_manager.utils.read_module_file(file_path)
170 |
171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 |
Parameters:file_path (str) –
Returns:Module content
Return type:list
182 |
183 | 184 |
185 |
186 | module_manager.utils.update_module_file(file_path, state, data)
187 |

Update state of module, the module file gets read and the each line will 188 | be checked if it matches up with the data provided. If it does, that is 189 | the line that needs its state updated.

190 | 191 | 192 | 193 | 194 | 200 | 201 | 202 |
Parameters:
    195 |
  • file_path (str) –
  • 196 |
  • state (bool) –
  • 197 |
  • data (dict) –
  • 198 |
199 |
203 |
204 | 205 |
206 | 207 | 208 |
209 |
210 |
211 | 232 |
233 |
234 | 246 | 250 | 251 | -------------------------------------------------------------------------------- /docs/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox input[type="text"] { 85 | width: 170px; 86 | } 87 | 88 | img { 89 | border: 0; 90 | max-width: 100%; 91 | } 92 | 93 | /* -- search page ----------------------------------------------------------- */ 94 | 95 | ul.search { 96 | margin: 10px 0 0 20px; 97 | padding: 0; 98 | } 99 | 100 | ul.search li { 101 | padding: 5px 0 5px 20px; 102 | background-image: url(file.png); 103 | background-repeat: no-repeat; 104 | background-position: 0 7px; 105 | } 106 | 107 | ul.search li a { 108 | font-weight: bold; 109 | } 110 | 111 | ul.search li div.context { 112 | color: #888; 113 | margin: 2px 0 0 30px; 114 | text-align: left; 115 | } 116 | 117 | ul.keywordmatches li.goodmatch a { 118 | font-weight: bold; 119 | } 120 | 121 | /* -- index page ------------------------------------------------------------ */ 122 | 123 | table.contentstable { 124 | width: 90%; 125 | margin-left: auto; 126 | margin-right: auto; 127 | } 128 | 129 | table.contentstable p.biglink { 130 | line-height: 150%; 131 | } 132 | 133 | a.biglink { 134 | font-size: 1.3em; 135 | } 136 | 137 | span.linkdescr { 138 | font-style: italic; 139 | padding-top: 5px; 140 | font-size: 90%; 141 | } 142 | 143 | /* -- general index --------------------------------------------------------- */ 144 | 145 | table.indextable { 146 | width: 100%; 147 | } 148 | 149 | table.indextable td { 150 | text-align: left; 151 | vertical-align: top; 152 | } 153 | 154 | table.indextable ul { 155 | margin-top: 0; 156 | margin-bottom: 0; 157 | list-style-type: none; 158 | } 159 | 160 | table.indextable > tbody > tr > td > ul { 161 | padding-left: 0em; 162 | } 163 | 164 | table.indextable tr.pcap { 165 | height: 10px; 166 | } 167 | 168 | table.indextable tr.cap { 169 | margin-top: 10px; 170 | background-color: #f2f2f2; 171 | } 172 | 173 | img.toggler { 174 | margin-right: 3px; 175 | margin-top: 3px; 176 | cursor: pointer; 177 | } 178 | 179 | div.modindex-jumpbox { 180 | border-top: 1px solid #ddd; 181 | border-bottom: 1px solid #ddd; 182 | margin: 1em 0 1em 0; 183 | padding: 0.4em; 184 | } 185 | 186 | div.genindex-jumpbox { 187 | border-top: 1px solid #ddd; 188 | border-bottom: 1px solid #ddd; 189 | margin: 1em 0 1em 0; 190 | padding: 0.4em; 191 | } 192 | 193 | /* -- domain module index --------------------------------------------------- */ 194 | 195 | table.modindextable td { 196 | padding: 2px; 197 | border-collapse: collapse; 198 | } 199 | 200 | /* -- general body styles --------------------------------------------------- */ 201 | 202 | div.body p, div.body dd, div.body li, div.body blockquote { 203 | -moz-hyphens: auto; 204 | -ms-hyphens: auto; 205 | -webkit-hyphens: auto; 206 | hyphens: auto; 207 | } 208 | 209 | a.headerlink { 210 | visibility: hidden; 211 | } 212 | 213 | h1:hover > a.headerlink, 214 | h2:hover > a.headerlink, 215 | h3:hover > a.headerlink, 216 | h4:hover > a.headerlink, 217 | h5:hover > a.headerlink, 218 | h6:hover > a.headerlink, 219 | dt:hover > a.headerlink, 220 | caption:hover > a.headerlink, 221 | p.caption:hover > a.headerlink, 222 | div.code-block-caption:hover > a.headerlink { 223 | visibility: visible; 224 | } 225 | 226 | div.body p.caption { 227 | text-align: inherit; 228 | } 229 | 230 | div.body td { 231 | text-align: left; 232 | } 233 | 234 | .first { 235 | margin-top: 0 !important; 236 | } 237 | 238 | p.rubric { 239 | margin-top: 30px; 240 | font-weight: bold; 241 | } 242 | 243 | img.align-left, .figure.align-left, object.align-left { 244 | clear: left; 245 | float: left; 246 | margin-right: 1em; 247 | } 248 | 249 | img.align-right, .figure.align-right, object.align-right { 250 | clear: right; 251 | float: right; 252 | margin-left: 1em; 253 | } 254 | 255 | img.align-center, .figure.align-center, object.align-center { 256 | display: block; 257 | margin-left: auto; 258 | margin-right: auto; 259 | } 260 | 261 | .align-left { 262 | text-align: left; 263 | } 264 | 265 | .align-center { 266 | text-align: center; 267 | } 268 | 269 | .align-right { 270 | text-align: right; 271 | } 272 | 273 | /* -- sidebars -------------------------------------------------------------- */ 274 | 275 | div.sidebar { 276 | margin: 0 0 0.5em 1em; 277 | border: 1px solid #ddb; 278 | padding: 7px 7px 0 7px; 279 | background-color: #ffe; 280 | width: 40%; 281 | float: right; 282 | } 283 | 284 | p.sidebar-title { 285 | font-weight: bold; 286 | } 287 | 288 | /* -- topics ---------------------------------------------------------------- */ 289 | 290 | div.topic { 291 | border: 1px solid #ccc; 292 | padding: 7px 7px 0 7px; 293 | margin: 10px 0 10px 0; 294 | } 295 | 296 | p.topic-title { 297 | font-size: 1.1em; 298 | font-weight: bold; 299 | margin-top: 10px; 300 | } 301 | 302 | /* -- admonitions ----------------------------------------------------------- */ 303 | 304 | div.admonition { 305 | margin-top: 10px; 306 | margin-bottom: 10px; 307 | padding: 7px; 308 | } 309 | 310 | div.admonition dt { 311 | font-weight: bold; 312 | } 313 | 314 | div.admonition dl { 315 | margin-bottom: 0; 316 | } 317 | 318 | p.admonition-title { 319 | margin: 0px 10px 5px 0px; 320 | font-weight: bold; 321 | } 322 | 323 | div.body p.centered { 324 | text-align: center; 325 | margin-top: 25px; 326 | } 327 | 328 | /* -- tables ---------------------------------------------------------------- */ 329 | 330 | table.docutils { 331 | border: 0; 332 | border-collapse: collapse; 333 | } 334 | 335 | table caption span.caption-number { 336 | font-style: italic; 337 | } 338 | 339 | table caption span.caption-text { 340 | } 341 | 342 | table.docutils td, table.docutils th { 343 | padding: 1px 8px 1px 5px; 344 | border-top: 0; 345 | border-left: 0; 346 | border-right: 0; 347 | border-bottom: 1px solid #aaa; 348 | } 349 | 350 | table.footnote td, table.footnote th { 351 | border: 0 !important; 352 | } 353 | 354 | th { 355 | text-align: left; 356 | padding-right: 5px; 357 | } 358 | 359 | table.citation { 360 | border-left: solid 1px gray; 361 | margin-left: 1px; 362 | } 363 | 364 | table.citation td { 365 | border-bottom: none; 366 | } 367 | 368 | /* -- figures --------------------------------------------------------------- */ 369 | 370 | div.figure { 371 | margin: 0.5em; 372 | padding: 0.5em; 373 | } 374 | 375 | div.figure p.caption { 376 | padding: 0.3em; 377 | } 378 | 379 | div.figure p.caption span.caption-number { 380 | font-style: italic; 381 | } 382 | 383 | div.figure p.caption span.caption-text { 384 | } 385 | 386 | /* -- field list styles ----------------------------------------------------- */ 387 | 388 | table.field-list td, table.field-list th { 389 | border: 0 !important; 390 | } 391 | 392 | .field-list ul { 393 | margin: 0; 394 | padding-left: 1em; 395 | } 396 | 397 | .field-list p { 398 | margin: 0; 399 | } 400 | 401 | .field-name { 402 | -moz-hyphens: manual; 403 | -ms-hyphens: manual; 404 | -webkit-hyphens: manual; 405 | hyphens: manual; 406 | } 407 | 408 | /* -- other body styles ----------------------------------------------------- */ 409 | 410 | ol.arabic { 411 | list-style: decimal; 412 | } 413 | 414 | ol.loweralpha { 415 | list-style: lower-alpha; 416 | } 417 | 418 | ol.upperalpha { 419 | list-style: upper-alpha; 420 | } 421 | 422 | ol.lowerroman { 423 | list-style: lower-roman; 424 | } 425 | 426 | ol.upperroman { 427 | list-style: upper-roman; 428 | } 429 | 430 | dl { 431 | margin-bottom: 15px; 432 | } 433 | 434 | dd p { 435 | margin-top: 0px; 436 | } 437 | 438 | dd ul, dd table { 439 | margin-bottom: 10px; 440 | } 441 | 442 | dd { 443 | margin-top: 3px; 444 | margin-bottom: 10px; 445 | margin-left: 30px; 446 | } 447 | 448 | dt:target, .highlighted { 449 | background-color: #fbe54e; 450 | } 451 | 452 | dl.glossary dt { 453 | font-weight: bold; 454 | font-size: 1.1em; 455 | } 456 | 457 | .optional { 458 | font-size: 1.3em; 459 | } 460 | 461 | .sig-paren { 462 | font-size: larger; 463 | } 464 | 465 | .versionmodified { 466 | font-style: italic; 467 | } 468 | 469 | .system-message { 470 | background-color: #fda; 471 | padding: 5px; 472 | border: 3px solid red; 473 | } 474 | 475 | .footnote:target { 476 | background-color: #ffa; 477 | } 478 | 479 | .line-block { 480 | display: block; 481 | margin-top: 1em; 482 | margin-bottom: 1em; 483 | } 484 | 485 | .line-block .line-block { 486 | margin-top: 0; 487 | margin-bottom: 0; 488 | margin-left: 1.5em; 489 | } 490 | 491 | .guilabel, .menuselection { 492 | font-family: sans-serif; 493 | } 494 | 495 | .accelerator { 496 | text-decoration: underline; 497 | } 498 | 499 | .classifier { 500 | font-style: oblique; 501 | } 502 | 503 | abbr, acronym { 504 | border-bottom: dotted 1px; 505 | cursor: help; 506 | } 507 | 508 | /* -- code displays --------------------------------------------------------- */ 509 | 510 | pre { 511 | overflow: auto; 512 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 513 | } 514 | 515 | span.pre { 516 | -moz-hyphens: none; 517 | -ms-hyphens: none; 518 | -webkit-hyphens: none; 519 | hyphens: none; 520 | } 521 | 522 | td.linenos pre { 523 | padding: 5px 0px; 524 | border: 0; 525 | background-color: transparent; 526 | color: #aaa; 527 | } 528 | 529 | table.highlighttable { 530 | margin-left: 0.5em; 531 | } 532 | 533 | table.highlighttable td { 534 | padding: 0 0.5em 0 0.5em; 535 | } 536 | 537 | div.code-block-caption { 538 | padding: 2px 5px; 539 | font-size: small; 540 | } 541 | 542 | div.code-block-caption code { 543 | background-color: transparent; 544 | } 545 | 546 | div.code-block-caption + div > div.highlight > pre { 547 | margin-top: 0; 548 | } 549 | 550 | div.code-block-caption span.caption-number { 551 | padding: 0.1em 0.3em; 552 | font-style: italic; 553 | } 554 | 555 | div.code-block-caption span.caption-text { 556 | } 557 | 558 | div.literal-block-wrapper { 559 | padding: 1em 1em 0; 560 | } 561 | 562 | div.literal-block-wrapper div.highlight { 563 | margin: 0; 564 | } 565 | 566 | code.descname { 567 | background-color: transparent; 568 | font-weight: bold; 569 | font-size: 1.2em; 570 | } 571 | 572 | code.descclassname { 573 | background-color: transparent; 574 | } 575 | 576 | code.xref, a code { 577 | background-color: transparent; 578 | font-weight: bold; 579 | } 580 | 581 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 582 | background-color: transparent; 583 | } 584 | 585 | .viewcode-link { 586 | float: right; 587 | } 588 | 589 | .viewcode-back { 590 | float: right; 591 | font-family: sans-serif; 592 | } 593 | 594 | div.viewcode-block:target { 595 | margin: -1px -10px; 596 | padding: 0 10px; 597 | } 598 | 599 | /* -- math display ---------------------------------------------------------- */ 600 | 601 | img.math { 602 | vertical-align: middle; 603 | } 604 | 605 | div.body div.math p { 606 | text-align: center; 607 | } 608 | 609 | span.eqno { 610 | float: right; 611 | } 612 | 613 | span.eqno a.headerlink { 614 | position: relative; 615 | left: 0px; 616 | z-index: 1; 617 | } 618 | 619 | div.math:hover a.headerlink { 620 | visibility: visible; 621 | } 622 | 623 | /* -- printout stylesheet --------------------------------------------------- */ 624 | 625 | @media print { 626 | div.document, 627 | div.documentwrapper, 628 | div.bodywrapper { 629 | margin: 0 !important; 630 | width: 100%; 631 | } 632 | 633 | div.sphinxsidebar, 634 | div.related, 635 | div.footer, 636 | #top-link { 637 | display: none; 638 | } 639 | } -------------------------------------------------------------------------------- /docs/_static/searchtools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * searchtools.js_t 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for the full-text search. 6 | * 7 | * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | 13 | /* Non-minified version JS is _stemmer.js if file is provided */ 14 | /** 15 | * Porter Stemmer 16 | */ 17 | var Stemmer = function() { 18 | 19 | var step2list = { 20 | ational: 'ate', 21 | tional: 'tion', 22 | enci: 'ence', 23 | anci: 'ance', 24 | izer: 'ize', 25 | bli: 'ble', 26 | alli: 'al', 27 | entli: 'ent', 28 | eli: 'e', 29 | ousli: 'ous', 30 | ization: 'ize', 31 | ation: 'ate', 32 | ator: 'ate', 33 | alism: 'al', 34 | iveness: 'ive', 35 | fulness: 'ful', 36 | ousness: 'ous', 37 | aliti: 'al', 38 | iviti: 'ive', 39 | biliti: 'ble', 40 | logi: 'log' 41 | }; 42 | 43 | var step3list = { 44 | icate: 'ic', 45 | ative: '', 46 | alize: 'al', 47 | iciti: 'ic', 48 | ical: 'ic', 49 | ful: '', 50 | ness: '' 51 | }; 52 | 53 | var c = "[^aeiou]"; // consonant 54 | var v = "[aeiouy]"; // vowel 55 | var C = c + "[^aeiouy]*"; // consonant sequence 56 | var V = v + "[aeiou]*"; // vowel sequence 57 | 58 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 59 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 60 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 61 | var s_v = "^(" + C + ")?" + v; // vowel in stem 62 | 63 | this.stemWord = function (w) { 64 | var stem; 65 | var suffix; 66 | var firstch; 67 | var origword = w; 68 | 69 | if (w.length < 3) 70 | return w; 71 | 72 | var re; 73 | var re2; 74 | var re3; 75 | var re4; 76 | 77 | firstch = w.substr(0,1); 78 | if (firstch == "y") 79 | w = firstch.toUpperCase() + w.substr(1); 80 | 81 | // Step 1a 82 | re = /^(.+?)(ss|i)es$/; 83 | re2 = /^(.+?)([^s])s$/; 84 | 85 | if (re.test(w)) 86 | w = w.replace(re,"$1$2"); 87 | else if (re2.test(w)) 88 | w = w.replace(re2,"$1$2"); 89 | 90 | // Step 1b 91 | re = /^(.+?)eed$/; 92 | re2 = /^(.+?)(ed|ing)$/; 93 | if (re.test(w)) { 94 | var fp = re.exec(w); 95 | re = new RegExp(mgr0); 96 | if (re.test(fp[1])) { 97 | re = /.$/; 98 | w = w.replace(re,""); 99 | } 100 | } 101 | else if (re2.test(w)) { 102 | var fp = re2.exec(w); 103 | stem = fp[1]; 104 | re2 = new RegExp(s_v); 105 | if (re2.test(stem)) { 106 | w = stem; 107 | re2 = /(at|bl|iz)$/; 108 | re3 = new RegExp("([^aeiouylsz])\\1$"); 109 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 110 | if (re2.test(w)) 111 | w = w + "e"; 112 | else if (re3.test(w)) { 113 | re = /.$/; 114 | w = w.replace(re,""); 115 | } 116 | else if (re4.test(w)) 117 | w = w + "e"; 118 | } 119 | } 120 | 121 | // Step 1c 122 | re = /^(.+?)y$/; 123 | if (re.test(w)) { 124 | var fp = re.exec(w); 125 | stem = fp[1]; 126 | re = new RegExp(s_v); 127 | if (re.test(stem)) 128 | w = stem + "i"; 129 | } 130 | 131 | // Step 2 132 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 133 | if (re.test(w)) { 134 | var fp = re.exec(w); 135 | stem = fp[1]; 136 | suffix = fp[2]; 137 | re = new RegExp(mgr0); 138 | if (re.test(stem)) 139 | w = stem + step2list[suffix]; 140 | } 141 | 142 | // Step 3 143 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 144 | if (re.test(w)) { 145 | var fp = re.exec(w); 146 | stem = fp[1]; 147 | suffix = fp[2]; 148 | re = new RegExp(mgr0); 149 | if (re.test(stem)) 150 | w = stem + step3list[suffix]; 151 | } 152 | 153 | // Step 4 154 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 155 | re2 = /^(.+?)(s|t)(ion)$/; 156 | if (re.test(w)) { 157 | var fp = re.exec(w); 158 | stem = fp[1]; 159 | re = new RegExp(mgr1); 160 | if (re.test(stem)) 161 | w = stem; 162 | } 163 | else if (re2.test(w)) { 164 | var fp = re2.exec(w); 165 | stem = fp[1] + fp[2]; 166 | re2 = new RegExp(mgr1); 167 | if (re2.test(stem)) 168 | w = stem; 169 | } 170 | 171 | // Step 5 172 | re = /^(.+?)e$/; 173 | if (re.test(w)) { 174 | var fp = re.exec(w); 175 | stem = fp[1]; 176 | re = new RegExp(mgr1); 177 | re2 = new RegExp(meq1); 178 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 179 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 180 | w = stem; 181 | } 182 | re = /ll$/; 183 | re2 = new RegExp(mgr1); 184 | if (re.test(w) && re2.test(w)) { 185 | re = /.$/; 186 | w = w.replace(re,""); 187 | } 188 | 189 | // and turn initial Y back to y 190 | if (firstch == "y") 191 | w = firstch.toLowerCase() + w.substr(1); 192 | return w; 193 | } 194 | } 195 | 196 | 197 | 198 | /** 199 | * Simple result scoring code. 200 | */ 201 | var Scorer = { 202 | // Implement the following function to further tweak the score for each result 203 | // The function takes a result array [filename, title, anchor, descr, score] 204 | // and returns the new score. 205 | /* 206 | score: function(result) { 207 | return result[4]; 208 | }, 209 | */ 210 | 211 | // query matches the full name of an object 212 | objNameMatch: 11, 213 | // or matches in the last dotted part of the object name 214 | objPartialMatch: 6, 215 | // Additive scores depending on the priority of the object 216 | objPrio: {0: 15, // used to be importantResults 217 | 1: 5, // used to be objectResults 218 | 2: -5}, // used to be unimportantResults 219 | // Used when the priority is not in the mapping. 220 | objPrioDefault: 0, 221 | 222 | // query found in title 223 | title: 15, 224 | // query found in terms 225 | term: 5 226 | }; 227 | 228 | 229 | 230 | 231 | 232 | var splitChars = (function() { 233 | var result = {}; 234 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 235 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 236 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 237 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 238 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 239 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 240 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 241 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 242 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 243 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 244 | var i, j, start, end; 245 | for (i = 0; i < singles.length; i++) { 246 | result[singles[i]] = true; 247 | } 248 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 249 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 250 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 251 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 252 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 253 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 254 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 255 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 256 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 257 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 258 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 259 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 260 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 261 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 262 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 263 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 264 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 265 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 266 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 267 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 268 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 269 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 270 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 271 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 272 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 273 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 274 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 275 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 276 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 277 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 278 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 279 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 280 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 281 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 282 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 283 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 284 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 285 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 286 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 287 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 288 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 289 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 290 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 291 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 292 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 293 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 294 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 295 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 296 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 297 | for (i = 0; i < ranges.length; i++) { 298 | start = ranges[i][0]; 299 | end = ranges[i][1]; 300 | for (j = start; j <= end; j++) { 301 | result[j] = true; 302 | } 303 | } 304 | return result; 305 | })(); 306 | 307 | function splitQuery(query) { 308 | var result = []; 309 | var start = -1; 310 | for (var i = 0; i < query.length; i++) { 311 | if (splitChars[query.charCodeAt(i)]) { 312 | if (start !== -1) { 313 | result.push(query.slice(start, i)); 314 | start = -1; 315 | } 316 | } else if (start === -1) { 317 | start = i; 318 | } 319 | } 320 | if (start !== -1) { 321 | result.push(query.slice(start)); 322 | } 323 | return result; 324 | } 325 | 326 | 327 | 328 | 329 | /** 330 | * Search Module 331 | */ 332 | var Search = { 333 | 334 | _index : null, 335 | _queued_query : null, 336 | _pulse_status : -1, 337 | 338 | init : function() { 339 | var params = $.getQueryParameters(); 340 | if (params.q) { 341 | var query = params.q[0]; 342 | $('input[name="q"]')[0].value = query; 343 | this.performSearch(query); 344 | } 345 | }, 346 | 347 | loadIndex : function(url) { 348 | $.ajax({type: "GET", url: url, data: null, 349 | dataType: "script", cache: true, 350 | complete: function(jqxhr, textstatus) { 351 | if (textstatus != "success") { 352 | document.getElementById("searchindexloader").src = url; 353 | } 354 | }}); 355 | }, 356 | 357 | setIndex : function(index) { 358 | var q; 359 | this._index = index; 360 | if ((q = this._queued_query) !== null) { 361 | this._queued_query = null; 362 | Search.query(q); 363 | } 364 | }, 365 | 366 | hasIndex : function() { 367 | return this._index !== null; 368 | }, 369 | 370 | deferQuery : function(query) { 371 | this._queued_query = query; 372 | }, 373 | 374 | stopPulse : function() { 375 | this._pulse_status = 0; 376 | }, 377 | 378 | startPulse : function() { 379 | if (this._pulse_status >= 0) 380 | return; 381 | function pulse() { 382 | var i; 383 | Search._pulse_status = (Search._pulse_status + 1) % 4; 384 | var dotString = ''; 385 | for (i = 0; i < Search._pulse_status; i++) 386 | dotString += '.'; 387 | Search.dots.text(dotString); 388 | if (Search._pulse_status > -1) 389 | window.setTimeout(pulse, 500); 390 | } 391 | pulse(); 392 | }, 393 | 394 | /** 395 | * perform a search for something (or wait until index is loaded) 396 | */ 397 | performSearch : function(query) { 398 | // create the required interface elements 399 | this.out = $('#search-results'); 400 | this.title = $('

' + _('Searching') + '

').appendTo(this.out); 401 | this.dots = $('').appendTo(this.title); 402 | this.status = $('

').appendTo(this.out); 403 | this.output = $('