mailr28176 - /trunk/user_functions/sys_info.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on April 02, 2016 - 13:40:
Author: tlinnet
Date: Sat Apr  2 13:40:03 2016
New Revision: 28176

URL: http://svn.gna.org/viewcvs/relax?rev=28176&view=rev
Log:
Adding the new user function: system.cd(path).

This is to change the current working dirextory.

Modified:
    trunk/user_functions/sys_info.py

Modified: trunk/user_functions/sys_info.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/sys_info.py?rev=28176&r1=28175&r2=28176&view=diff
==============================================================================
--- trunk/user_functions/sys_info.py    (original)
+++ trunk/user_functions/sys_info.py    Sat Apr  2 13:40:03 2016
@@ -22,8 +22,13 @@
 # Module docstring.
 """The sys_info user function definitions."""
 
+# Python module imports.
+from os import sep
+
 # relax module imports.
+from graphics import WIZARD_OXYGEN_PATH
 from info import print_sys_info
+from lib.system import cd
 from lib.timing import print_time
 from user_functions.data import Uf_info; uf_info = Uf_info()
 from user_functions.objects import Desc_container
@@ -34,6 +39,30 @@
 uf_class.title = "Class containing the OS system related functions."
 uf_class.menu_text = "&system"
 uf_class.gui_icon = "oxygen.actions.help-about"
+
+
+# The cd user function.
+uf = uf_info.add_uf('system.cd')
+uf.title = "Change the current working directory to the specified path."
+uf.title_short = "Change current working directory."
+uf.display = True
+uf.add_keyarg(
+    name = "path",
+    py_type = "str",
+    desc_short = "path",
+    desc = "The path to the new current working directory."
+)
+# Description.
+uf.desc.append(Desc_container())
+uf.desc[-1].add_paragraph("The equivalent of python module os.chdir(path).  
Change the current working directory to the specified path.")
+uf.desc[-1].add_paragraph("To change the current working directory, type:")
+uf.desc[-1].add_prompt("relax> system.cd(\"/path/to/dir\")")
+uf.backend = cd
+uf.menu_text = "&cd"
+uf.gui_icon = "oxygen.places.folder-favorites"
+uf.wizard_size = (700, 400)
+uf.wizard_image = WIZARD_OXYGEN_PATH + 'places' + sep + 
'folder-favorites.png'
+uf.wizard_apply_button = False
 
 
 # The sys_info user function.




Related Messages


Powered by MHonArc, Updated Sat Apr 02 14:00:07 2016