Author: bugman
Date: Mon Sep 8 18:56:52 2014
New Revision: 25691
URL: http://svn.gna.org/viewcvs/relax?rev=25691&view=rev
Log:
Created a script for printing out relax 1.3 user functions.
Added:
trunk/test_suite/shared_data/user_functions/uf_list_1_3.py
Added: trunk/test_suite/shared_data/user_functions/uf_list_1_3.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/user_functions/uf_list_1_3.py?rev=25691&view=auto
==============================================================================
--- trunk/test_suite/shared_data/user_functions/uf_list_1_3.py (added)
+++ trunk/test_suite/shared_data/user_functions/uf_list_1_3.py Mon Sep 8
18:56:52 2014
@@ -0,0 +1,50 @@
+# Python module imports.
+from re import search
+
+# relax module imports.
+from prompt.interpreter import Interpreter
+
+
+# Initialise the interpreter!
+interpreter = Interpreter(self)
+
+# Get the names of the data structures.
+names = sorted(interpreter._locals.keys())
+
+# Alphabetically sort the names of the data structures.
+for name in names:
+ # Skip the name if it is in the blacklist.
+ blacklist = ['pi', 'script']
+ if name in blacklist:
+ continue
+
+ # Get the object.
+ object = interpreter._locals[name]
+
+ # Determine if the structure is user function containing class.
+ if hasattr(object, '__relax_help__'):
+ # Get the names of the data structures.
+ names2 = sorted(dir(object))
+
+ # Alphabetically sort the names of the data structures.
+ for name2 in names2:
+ # Skip names begining with an underscore.
+ if search('^_', name2):
+ continue
+
+ # Get the object.
+ object2 = getattr(object, name2)
+
+ # Skip the object if there is no docstring.
+ if not hasattr(object2, '__doc__') or not object2.__doc__:
+ continue
+
+ # Printout.
+ print(name + '.' + name2)
+
+ # Skip the object if there is no docstring.
+ if not hasattr(object, '__doc__') or not object.__doc__:
+ continue
+
+ # Print the name.
+ print(name)
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits