Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/packaging/debian/kernel.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@
./usr/local/mdsplus/tdi/treeshr/TreeFlushReset.fun
./usr/local/mdsplus/tdi/treeshr/TreeGetCurrentShot.fun
./usr/local/mdsplus/tdi/treeshr/TreeGetRecord.fun
./usr/local/mdsplus/tdi/treeshr/TreeHook.example
./usr/local/mdsplus/tdi/treeshr/TreeOpen.fun
./usr/local/mdsplus/tdi/treeshr/TreeOpenEdit.fun
./usr/local/mdsplus/tdi/treeshr/TreeOpenNew.fun
Expand All @@ -236,6 +235,7 @@
./usr/local/mdsplus/tdi/treeshr/TreeSetDbiItm.fun
./usr/local/mdsplus/tdi/treeshr/TreeSetDefault.fun
./usr/local/mdsplus/tdi/treeshr/TreeSetNciItm.fun
./usr/local/mdsplus/tdi/treeshr/TreeShrHook.py.example
./usr/local/mdsplus/tdi/treeshr/TreeTurnOff.fun
./usr/local/mdsplus/tdi/treeshr/TreeTurnOn.fun
./usr/local/mdsplus/tdi/treeshr/TreeWrite.fun
Expand Down
2 changes: 1 addition & 1 deletion deploy/packaging/redhat/kernel.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@
./usr/local/mdsplus/tdi/treeshr/TreeFlushReset.fun
./usr/local/mdsplus/tdi/treeshr/TreeGetCurrentShot.fun
./usr/local/mdsplus/tdi/treeshr/TreeGetRecord.fun
./usr/local/mdsplus/tdi/treeshr/TreeHook.example
./usr/local/mdsplus/tdi/treeshr/TreeOpen.fun
./usr/local/mdsplus/tdi/treeshr/TreeOpenEdit.fun
./usr/local/mdsplus/tdi/treeshr/TreeOpenNew.fun
Expand All @@ -268,6 +267,7 @@
./usr/local/mdsplus/tdi/treeshr/TreeSetDbiItm.fun
./usr/local/mdsplus/tdi/treeshr/TreeSetDefault.fun
./usr/local/mdsplus/tdi/treeshr/TreeSetNciItm.fun
./usr/local/mdsplus/tdi/treeshr/TreeShrHook.py.example
./usr/local/mdsplus/tdi/treeshr/TreeTurnOff.fun
./usr/local/mdsplus/tdi/treeshr/TreeTurnOn.fun
./usr/local/mdsplus/tdi/treeshr/TreeWrite.fun
Expand Down
19 changes: 0 additions & 19 deletions tdi/treeshr/TreeHook.example

This file was deleted.

57 changes: 57 additions & 0 deletions tdi/treeshr/TreeShrHook.py.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#


def TreeShrHook(args):
"""
This example TreeShrHook will print out the incomming dictionary (args)
for enabled hooks. To use:

copy this file to someplace in your MDS_PATH, removing the .example extension

cp /usr/local/mdsplus/tdi/treeshr/TreeShrHook.py.example /usr/site/tdi/TreeShrHook.py

define TreeHooks environment variable to a comma separated list of
hooks you want to enable

export TREE_HOOKS OpenTree,CloseTree

Then open a tree and see the calls logged on stdout:

jas@mfews05:~$ mdstcl
TCL> set tree RF/shot=-1
Dict(, "tree","RF", "type","OpenTree", "shot",-1)
Dict(, "tree","RF_FAST", "type","OpenTree", "shot",-1)
TCL> close
Dict(, "tree","RF", "type","CloseTree", "shot",-1)
Dict(, "tree","RF_FAST", "type","CloseTree", "shot",-1)
TCL> exit

NOTE: For local, distributed, and thick clients this routine runs in the user's context and
on the user's computer. It would have to be installed on all client computers to gather
useful information.

"""
print(args)