Author: bugman Date: Tue Jun 24 11:09:39 2014 New Revision: 24269 URL: http://svn.gna.org/viewcvs/relax?rev=24269&view=rev Log: Merged revisions 24251,24257,24263 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r24251 | bugman | 2014-06-23 16:36:47 +0200 (Mon, 23 Jun 2014) | 6 lines Improved how the relax installation path is determined in the status object. If the path cannot be found, the current working directory is then checked if it is where relax is installed. This is needed when importing modules outside of relax. ........ r24257 | bugman | 2014-06-23 20:12:02 +0200 (Mon, 23 Jun 2014) | 7 lines Hack to permanently eliminate the ^[[?1034h escape code being produced on Linux systems. This is produced by importing the readline module. The escape code will be sent to STDOUT every time relax is executed, so it will be present in all log files. The problem is the TERM environmental variable being set to 'xterm'. The hack simply sets TERM to an empty string. ........ r24263 | bugman | 2014-06-24 09:46:24 +0200 (Tue, 24 Jun 2014) | 6 lines More hacks for permanently eliminating the ^[[?1034h escape code being produced on Linux systems. This is a nasty feature of the GNU readline library. It is now also turned off in the dep_check module, suppressing ^[[?1034h in Python scripts which import only parts of relax. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/dep_check.py branches/frame_order_cleanup/relax.py branches/frame_order_cleanup/status.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jun 24 11:09:39 2014 @@ -1 +1 @@ -/trunk:1-24045,24047-24058,24138 +/trunk:1-24268 Modified: branches/frame_order_cleanup/dep_check.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/dep_check.py?rev=24269&r1=24268&r2=24269&view=diff ============================================================================== --- branches/frame_order_cleanup/dep_check.py (original) +++ branches/frame_order_cleanup/dep_check.py Tue Jun 24 11:09:39 2014 @@ -81,8 +81,11 @@ except ImportError: epydoc_module = False -# Readline module. -try: +# Readline module (avoiding the damned ^[[?1034h escape code on Linux systems). +try: + import os + if os.environ['TERM'] == 'xterm': + os.environ['TERM'] = '' import readline readline_module = True except ImportError: Modified: branches/frame_order_cleanup/relax.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/relax.py?rev=24269&r1=24268&r2=24269&view=diff ============================================================================== --- branches/frame_order_cleanup/relax.py (original) +++ branches/frame_order_cleanup/relax.py Tue Jun 24 11:09:39 2014 @@ -35,6 +35,10 @@ # Dependency checks. import dep_check + +# Eliminate the ^[[?1034h escape code being produced on Linux systems by the import of the readline module. +import os +os.environ['TERM'] = '' # Set up the Python 2 and 3 work-arounds. import lib.compat Modified: branches/frame_order_cleanup/status.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/status.py?rev=24269&r1=24268&r2=24269&view=diff ============================================================================== --- branches/frame_order_cleanup/status.py (original) +++ branches/frame_order_cleanup/status.py Tue Jun 24 11:09:39 2014 @@ -24,7 +24,7 @@ """Module containing the status singleton object.""" # Python module imports. -from os import F_OK, access +from os import F_OK, access, getcwd from os.path import sep import platform from re import search @@ -94,6 +94,10 @@ # Return the Mac Resources folder path. return mac_path + # Maybe the current directory? + if access(getcwd() + sep + file_to_find, F_OK): + return getcwd() + # Return the first entry of sys.path as a fallback. return sys.path[0]