Changeset 7c105e8 in sasview
- Timestamp:
- May 2, 2017 8:32:16 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- c6bdb3b
- Parents:
- ed03b99
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
run.py
red03b99 r7c105e8 139 139 sys.path.append(build_path) 140 140 141 set_git_tag() 141 142 # print "\n".join(sys.path) 143 144 def set_git_tag(): 145 try: 146 import subprocess 147 import os 148 import platform 149 FNULL = open(os.devnull, 'w') 150 if platform.system() == "Windows": 151 args = ['git', 'describe', '--tags'] 152 else: 153 args = ['git describe --tags'] 154 git_revision = subprocess.check_output(args, stderr=FNULL, shell=True) 155 import sas.sasview 156 sas.sasview.__build__ = str(git_revision).strip() 157 except subprocess.CalledProcessError as cpe: 158 logger.warning("Error while determining build number\n Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output)) 142 159 143 160 -
src/sas/sasview/__init__.py
r914ba0a r7c105e8 1 1 __version__ = "4.1" 2 2 __build__ = "GIT_COMMIT" 3 4 import logging5 logger = logging.getLogger(__name__)6 7 try:8 import subprocess9 import os10 import platform11 FNULL = open(os.devnull, 'w')12 if platform.system() == "Windows":13 args = ['git', 'describe', '--tags']14 else:15 args = ['git describe --tags']16 git_revision = subprocess.check_output(args,17 stderr=FNULL,18 shell=True)19 __build__ = str(git_revision).strip()20 except subprocess.CalledProcessError as cpe:21 logger.warning("Error while determining build number\n Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output)) -
src/sas/sasview/sasview.py
r914ba0a r7c105e8 16 16 import sys 17 17 import traceback 18 19 from sas.sasview.logger_config import SetupLogger 18 import logging 20 19 21 20 reload(sys) 22 21 sys.setdefaultencoding("iso-8859-1") 23 24 logger = SetupLogger(__name__).config_production()25 # Log the start of the session26 logger.info(" --- SasView session started ---")27 # Log the python version28 logger.info("Python: %s" % sys.version)29 30 22 31 23 PLUGIN_MODEL_DIR = 'plugin_models' … … 39 31 """ 40 32 """ 33 logger = logging.getLogger(__name__) 34 41 35 from sas.sasgui.guiframe.gui_manager import SasViewApp 42 36 self.gui = SasViewApp(0) … … 119 113 120 114 def setup_logging(): 121 log_file = os.path.join(os.path.expanduser("~"), 'sasview.log') 122 logging.basicConfig(level=logging.INFO, 123 format='%(asctime)s %(levelname)s %(message)s', 124 filename=log_file, 125 ) 126 logging.captureWarnings(True) 127 128 stderr_logger = logging.getLogger('STDERR') 129 sl = StreamToLogger(stderr_logger, logging.ERROR) 130 sys.stderr = sl 131 115 from sas.logger_config import SetupLogger 116 117 logger = SetupLogger(__name__).config_production() 132 118 # Log the start of the session 133 logging.info(" --- SasView session started ---") 134 119 logger.info(" --- SasView session started ---") 135 120 # Log the python version 136 logging.info("Python: %s" % sys.version) 121 logger.info("Python: %s" % sys.version) 122 return logger 137 123 138 124 … … 143 129 # probably not be, but this can make things a little easier when upgrading to a 144 130 # new version of wx. 131 logger = logging.getLogger(__name__) 145 132 WX_ENV_VAR = "SASVIEW_WX_VERSION" 146 133 if WX_ENV_VAR in os.environ: … … 200 187 201 188 def run_cli(): 189 setup_logging() 202 190 setup_mpl() 203 191 if len(sys.argv) == 1:
Note: See TracChangeset
for help on using the changeset viewer.