def main(): ''' entry point ''' # from pychron.envisage.pychron_run import launch from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories, paths # build directories build_directories(paths) # # from pychron.core.helpers.paths import hidden_dir # path = os.path.join(hidden_dir, 'version_info') # a = VersionInfoDisplay(local_path=path, # src_path=os.path.join(SRC_DIR, # 'version_info.txt')) # a.check() logging_setup('pychron', level='DEBUG') # =============================================================================== # test flag # set if you want to execute tests after startup # explicitly set the flag here once. mode is a readonly property # =============================================================================== # from pychron.globals import globalv # globalv._test = False # launch() # os._exit(0) from pychron.image.video_server import VideoServer s = VideoServer() s.configure_traits()
def main(): ''' entry point ''' from pychron.envisage.pychron_run import launch from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories, paths # import application # from pychron.applications.pyexperiment import PyExperiment as app from pychron.applications.pyview import PyView as app # build directories build_directories(paths) # from pychron.core.helpers.paths import hidden_dir # path = os.path.join(hidden_dir, 'version_info') # a = VersionInfoDisplay(local_path=path, # src_path=os.path.join(SRC_DIR, # 'version_info.txt')) # a.check() logging_setup('pychron', level='DEBUG') #=============================================================================== # test flag # set if you want to execute tests after startup # explicitly set the flag here once. mode is a readonly property #=============================================================================== from pychron.globals import globalv globalv._test = False globalv.debug = DEBUG launch(app) os._exit(0)
def initialize_version(appname, debug): root = os.path.dirname(__file__) if not debug: add_eggs(root) else: build_sys_path() # from pychron.environment.util import get_environment # env = get_environment(appname) from pychron.envisage.user_login import get_user args = get_user() if args is None: return False else: user, env = args if not env: return False set_application_home(appname, env) from pychron.paths import paths logger.debug('using Pychron environment: {}'.format(env)) paths.build(env) from configparser import ConfigParser, NoSectionError cp = ConfigParser() pref_path = os.path.join(ETSConfig.application_home, 'preferences.ini') cp.read(pref_path) try: cp.set('pychron.general', 'environment', env) except NoSectionError: cp.add_section('pychron.general') cp.set('pychron.general', 'environment', env) root = os.path.dirname(pref_path) if not os.path.isdir(root): os.mkdir(root) with open(pref_path, 'w') as wfile: cp.write(wfile) # build globals build_globals(user, debug) from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories # build directories build_directories() paths.write_defaults() # setup logging. set a basename for log files and logging level logging_setup('pychron', level='DEBUG') from pychron.core.helpers.exception_helper import set_exception_handler set_exception_handler() return env
def setup(): """ entry point """ from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories, paths # import application # from pychron.applications.pydiode import PyDiode as app from pychron.applications.pyexperiment import PyExperiment as app # build directories build_directories(paths) # # from pychron.core.helpers.paths import hidden_dir # path = os.path.join(hidden_dir, 'version_info') # a = VersionInfoDisplay(local_path=path, # src_path=os.path.join(SRC_DIR, # 'version_info.txt')) # a.check() logging_setup('pychron', level='DEBUG') # #=============================================================================== # # test flag # # set if you want to execute tests after startup # # explicitly set the flag here once. mode is a readonly property # #=============================================================================== # from pychron.globals import globalv # globalv._test = False # globalv.debug = DEBUG return app
def initialize_version(appname, debug): root = os.path.dirname(__file__) if not debug: add_eggs(root) else: build_sys_path() # can now use pychron. from pychron.paths import paths # paths.bundle_root = root # if '-' in setup_ver: # setup_ver = setup_ver.split('-')[0] from pychron.envisage.user_login import get_user user = get_user() if not user: logger.info('user login failed') os._exit(0) if appname.startswith('py'): appname = appname[2:] pref_path = os.path.join(paths.base, '.enthought', 'pychron.{}.application.{}'.format(appname, user), 'preferences.ini') from ConfigParser import ConfigParser cp = ConfigParser() cp.read(pref_path) try: proot = cp.get('pychron.general', 'root_dir') except BaseException: proot = '/Users/ross/Pychron' paths.build(proot) # build globals build_globals(debug) from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories # build directories build_directories() # setup logging. set a basename for log files and logging level logging_setup('pychron', level='DEBUG') return user
def main(): """ entry point """ from pychron.envisage.pychron_run import launch from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories, paths # build directories build_directories(paths) # from pychron.core.helpers.paths import hidden_dir # path = os.path.join(hidden_dir, 'version_info') # a = VersionInfoDisplay(local_path=path, # src_path=os.path.join(SRC_DIR, # 'version_info.txt')) # a.check() logging_setup('pychron', level='DEBUG') from pychron.applications.pyexperiment import PyExperiment as app launch(app)
def main(): """ entry point """ from pychron.envisage.pychron_run import launch from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories, paths # import application from pychron.applications.pyexperiment import PyExperiment as app # from pychron.applications.pyvalve import PyValve as app # build directories build_directories(paths) # from pychron.core.helpers.paths import hidden_dir # path = os.path.join(hidden_dir, 'version_info') # a = VersionInfoDisplay(local_path=path, # src_path=os.path.join(SRC_DIR, # 'version_info.txt')) # a.check() logging_setup('pychron', level='DEBUG') # #=============================================================================== # # test flag # # set if you want to execute tests after startup # # explicitly set the flag here once. mode is a readonly property # #=============================================================================== # from pychron.globals import globalv # globalv._test = False # globalv.debug = DEBUG # from guppy import hpy # app.hp = hp = hpy() try: launch(app) except RuntimeError: pass
import time from uncertainties import ufloat from pychron.core.ui import set_toolkit set_toolkit('qt4') from pychron.paths import paths, build_directories paths.build('_unittest') build_directories(paths) from pychron.core.helpers.logger_setup import logging_setup logging_setup('peak_hop') from threading import Thread from pychron.experiment.utilities.mass_spec_database_importer import MassSpecDatabaseImporter from pychron.processing.arar_age import ArArAge from pychron.spectrometer.ion_optics.ion_optics_manager import IonOpticsManager from pychron.spectrometer.thermo.manager.argus import ArgusSpectrometerManager from pychron.experiment.automated_run.automated_run import AutomatedRun from pychron.experiment.automated_run.spec import AutomatedRunSpec import unittest #HOPS = [('Ar40:H1:10, Ar39:AX, Ar36:CDD', 5, 1), # #('Ar40:L2, Ar39:CDD', 5, 1) # #('Ar38:CDD', 5, 1) # ('Ar37:CDD', 5, 1)
from __future__ import absolute_import import time from pychron.core.ui import set_toolkit set_toolkit('qt4') from pychron.paths import paths, build_directories paths.build('_unittest') build_directories(paths) from pychron.core.helpers.logger_setup import logging_setup from threading import Thread from pychron.processing.arar_age import ArArAge from pychron.spectrometer.ion_optics.ion_optics_manager import IonOpticsManager from pychron.spectrometer.thermo.manager.argus import ArgusSpectrometerManager from pychron.experiment.automated_run.automated_run import AutomatedRun from pychron.experiment.automated_run.spec import AutomatedRunSpec import unittest logging_setup('peak_hop') from pychron.experiment.datahub import Datahub #HOPS = [('Ar40:H1:10, Ar39:AX, Ar36:CDD', 5, 1), # #('Ar40:L2, Ar39:CDD', 5, 1) # #('Ar38:CDD', 5, 1) # ('Ar37:CDD', 5, 1) #]
root = os.path.dirname(pref_path) if not os.path.isdir(root): os.mkdir(root) with open(pref_path, 'w') as wfile: cp.write(wfile) # build globals build_globals(debug) from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories # build directories build_directories() paths.write_defaults() # setup logging. set a basename for log files and logging level logging_setup('pychron', level='DEBUG') from pychron.core.helpers.exception_helper import set_exception_handler, report_issues set_exception_handler() report_issues() return user def build_sys_path(): """ need to launch from terminal
root = os.path.dirname(pref_path) if not os.path.isdir(root): os.mkdir(root) with open(pref_path, "w") as wfile: cp.write(wfile) # build globals build_globals(debug) from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories # build directories build_directories() paths.write_defaults() # setup logging. set a basename for log files and logging level logging_setup("pychron", level="DEBUG") from pychron.core.helpers.exception_helper import set_exception_handler, report_issues set_exception_handler() report_issues() return user def build_sys_path(): """
def initialize_version(appname, debug): root = os.path.dirname(__file__) if not debug: add_eggs(root) else: build_sys_path() # from pychron.environment.util import get_environment # env = get_environment(appname) from pychron.envisage.user_login import get_user args = get_user() if args is None: return False else: user, env = args # if not env: # logger.info('no environment available') # from pyface.directory_dialog import DirectoryDialog # # information(None, 'An "environment" directory is not set in Preferences/General. Please select a valid ' # 'directory') # dlg = DirectoryDialog(action='open', default_directory=os.path.expanduser('~')) # result = dlg.open() # if result == OK: # env = str(dlg.path) # from pychron.environment.util import set_environment # set_environment(appname, env) # else: if not env: return False set_application_home(appname, env) from pychron.paths import paths logger.debug('using Pychron environment: {}'.format(env)) paths.build(env) from configparser import ConfigParser, NoSectionError cp = ConfigParser() pref_path = os.path.join(ETSConfig.application_home, 'preferences.ini') cp.read(pref_path) try: cp.set('pychron.general', 'environment', env) except NoSectionError: cp.add_section('pychron.general') cp.set('pychron.general', 'environment', env) root = os.path.dirname(pref_path) if not os.path.isdir(root): os.mkdir(root) with open(pref_path, 'w') as wfile: cp.write(wfile) # build globals build_globals(user, debug) from pychron.core.helpers.logger_setup import logging_setup from pychron.paths import build_directories # build directories build_directories() paths.write_defaults() # setup logging. set a basename for log files and logging level logging_setup('pychron', level='DEBUG') from pychron.core.helpers.exception_helper import set_exception_handler set_exception_handler() return env