当前位置: 首页>>代码示例>>Python>>正文


Python logger_setup.logging_setup函数代码示例

本文整理汇总了Python中pychron.core.helpers.logger_setup.logging_setup函数的典型用法代码示例。如果您正苦于以下问题:Python logging_setup函数的具体用法?Python logging_setup怎么用?Python logging_setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了logging_setup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

def run():
    import argparse
    import os

    paths.build(os.getenv('PYCHRON_ROOT'))

    logging_setup('furnace_firmware', use_archiver=False)
    parser = argparse.ArgumentParser(description='Run NMGRL Furnace Firmware')

    # parser.add_argument('--host',
    #                     type=str,
    #                     default='127.0.0.1',
    #                     help='host')

    parser.add_argument('--port',
                        type=int,
                        default=4567,
                        help='TCP port to listen')

    # parser.add_argument('--debug',
    #                     action='store_true',
    #                     default=False,
    #                     help='run in debug mode')

    fm = Firmware()
    fm.bootstrap(**vars(parser.parse_args()))
开发者ID:NMGRL,项目名称:pychron,代码行数:26,代码来源:firmware.py

示例2: main

    def main():
        from pychron.paths import paths
        paths.build('_dev')
        from pychron.core.helpers.logger_setup import logging_setup
        from pychron.experiment.automated_run.spec import AutomatedRunSpec
        logging_setup('dvcdb')
        from pychron.dvc.dvc_database import DVCDatabase
        from itertools import groupby
        db = DVCDatabase(kind='mysql', host='localhost', username='root', name='pychronmeta', password='Argon')
        db.connect()
        identifiers = ['63290', '63291']
        runs = [AutomatedRunSpec(identifier='63290', repository_identifier='Cather_McIntoshd')]
        cr = ConflictResolver()
        experiments = {}
        cr.available_ids = db.get_repository_identifiers()
        eas = db.get_associated_repositories(identifiers)
        for idn, exps in groupby(eas, key=lambda x: x[1]):
            experiments[idn] = [e[0] for e in exps]
        conflicts = []
        for ai in runs:
            identifier = ai.identifier
            es = experiments[identifier]
            if ai.repository_identifier not in es:
                conflicts.append((ai, es))
        if conflicts:
            cr.add_conflicts('Foo', conflicts)

        if cr.conflicts:

            info = cr.edit_traits(kind='livemodal')
            if info.result:
                cr.apply()
开发者ID:NMGRL,项目名称:pychron,代码行数:32,代码来源:conflict_resolver.py

示例3: main

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)
开发者ID:jirhiker,项目名称:pychron,代码行数:35,代码来源:pyview.py

示例4: main

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()
开发者ID:OSUPychron,项目名称:pychron,代码行数:34,代码来源:video_server_debug.py

示例5: main

def main():
    paths.build('_dev')

    global log
    if not log:
        logging_setup('heapy')
        log = True

    return run()
开发者ID:OSUPychron,项目名称:pychron,代码行数:9,代码来源:heapy_runner.py

示例6: initialize_version

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
开发者ID:UManPychron,项目名称:pychron,代码行数:54,代码来源:helpers.py

示例7: main

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)
开发者ID:jirhiker,项目名称:pychron,代码行数:21,代码来源:pyexperiment.py

示例8: main

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
开发者ID:jirhiker,项目名称:pychron,代码行数:39,代码来源:pychron_dev.py

示例9: Item

#                           Item('image', show_label=False,
#                             editor=ImageEditor())
#                           ),
#                         x=0.05,
#                         y=0.1,
#                         #386365
#                         width=1000,
#                         height=700,
#                         resizable=True,
#                         title=self.title
#                         )

if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup

    logging_setup('video')
    vm = VideoManager()

    # p = '/Users/fargo2/Desktop/laser_tray_50.tiff'

    # vm.process_image(p, crop=(0, 0, 250, 250))
    vm.start()
    vm.configure_traits()  # view='image_view')



# ================== EOF ========================
# def process_image_dir(self, root):
#        '''
#            @type root: C{str}
#            @param root:
开发者ID:OSUPychron,项目名称:pychron,代码行数:31,代码来源:video_manager.py

示例10: _test1_button_fired

        # p = '/Users/ross/Sandbox/pos_err/pos_err_200_0-002.jpg'
        p = '/Users/ross/Sandbox/poserror/pos_err_221_0-007.jpg'
        p = '/Users/ross/Sandbox/poserror/snapshot009.jpg'
        # p = '/Users/argonlab3/Pychron_co2/data/snapshots/pos_err_220_0--001.jpg'

        globalv.video_test_path = p
        globalv.video_test = True

    def _test1_button_fired(self):
        self._set_test_image()
        self._test1()


if __name__ == '__main__':

    logging_setup('mv', use_archiver=False, use_file=False)
    t = TestAutocenter()
    t.configure_traits(view=View(UItem('test1_button')))

# ============= EOF =============================================

# class TestMVManager(MachineVisionManager):
#     step = Button
#     test_image = Instance(MVImage, ())
#
#     def _step_fired(self):
#         self.step_signal.set()
#
#     def traits_view(self):
#         return View(Item('test'),
#                     Item('step'),
开发者ID:NMGRL,项目名称:pychron,代码行数:31,代码来源:test_mv_manager.py

示例11: set_qt

# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================
from __future__ import absolute_import
from __future__ import print_function
import yaml
from mako.template import Template
from traitsui.handler import Controller

from pychron.core.ui import set_qt

set_qt()

from pychron.core.helpers.logger_setup import logging_setup

logging_setup('dcreator')
# ============= enthought library imports =======================
from traits.api import HasTraits, Str
from traitsui.api import View, Item

# ============= standard library imports ========================
# ============= local library imports  ==========================


class DeviceModel(HasTraits):
    name = Str

    def make_from_file(self):
        tmp = self.get_template()

        p = '/Users/ross/Sandbox/device_creator.yaml'
开发者ID:NMGRL,项目名称:pychron,代码行数:31,代码来源:device_factory.py

示例12: delete_analysis

    # ===============================================================================
    # deleters
    # ===============================================================================
    @delete_one
    def delete_analysis(self, rid):
        return AnalysesTable, 'RID'

    # ===============================================================================
    # private
    # ===============================================================================
    def _get_fittype(self, value):
        return self._retrieve_item(FittypeTable, value, key='Label', )

    def _add_analysis_position(self, analysis, pi, po):
        a = AnalysisPositionTable(Hole=pi, PositionOrder=po)
        analysis.positions.append(a)


if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup

    logging_setup('ia')
    ia = MassSpecDatabaseAdapter()
    ia.connect()

    #    ia.selector_factory()
    # dbs = ia.selector
    # dbs.load_recent()
    # dbs.configure_traits()
# ==================EOF======================================================
开发者ID:NMGRL,项目名称:pychron,代码行数:30,代码来源:massspec_database_adapter.py

示例13: _get_temp_position

# ===============================================================================
#    _temp_position = None
#    def _get_temp_position(self):
#        return self._temp_position
#
#    def _set_temp_position(self, v):
#        self._temp_position = v
#
#    temp_position = property(fget=_get_temp_position,
#                           fset=_set_temp_position)


if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup

    logging_setup('stage_manager')
    name = 'diode'
    s = StageManager(
        name='{}stage'.format(name),
        configuration_dir_name=name,
        # parent = DummyParent(),
        window_width=945,
        window_height=545

    )
    #    from pychron.initializer import Initializer
    #
    #    i = Initializer()
    #    i.add_initialization(dict(name = 'stage_manager',
    #                              manager = s
    #                              ))
开发者ID:NMGRL,项目名称:pychron,代码行数:31,代码来源:stage_manager.py

示例14: setup_image

        loc.test_image = self.test_image

        dx, dy = loc.find(im, frame, dim * self.pxpermm)
#         print dx, dy
    def setup_image(self):
        frame = self.new_image_frame()
        im = self.new_image(frame)
        self.view_image(im)
        return im

def test1():
    from pychron.image.video import Video
    from pychron.globals import globalv
    globalv.video_test = True
    globalv.video_test_path = '/Users/ross/Sandbox/pos_err/snapshot007.jpg'
#    globalv.video_test_path = '/Users/ross/Sandbox/pos_err/pos_err_53002.jpg'
    globalv.video_test_path = '/Users/ross/Sandbox/pos_err/pos_err_221_0-005.jpg'

#    globalv.video_test_path = '/Users/ross/Sandbox/pos_err/diodefailsnapshot.jpg'
    video = Video()
    video.open()
    mv = MachineVisionManager(video=video)
    mv.configure_traits()


if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup
    logging_setup('mv')
    test()
#============= EOF =============================================
开发者ID:UManPychron,项目名称:pychron,代码行数:30,代码来源:test_mv_manager.py

示例15: logging_setup

TEST_PARSE_XLS = False
DEBUGGING = False

# automatically disable debugging if running on a travis ci linux box.
import sys

if sys.platform != 'darwin':
    DEBUGGING = False

DBNAME = 'loader.db'

if DEBUGGING:
    from pychron.core.helpers.logger_setup import logging_setup

    logging_setup('irrad_loader')


def get_data_dir():
    op = 'pychron/entry/tests/data'
    return mget_data_dir(op)
    # if not os.path.isdir(op):
    #     op = os.path.join('.', 'data')
    # return op


def db_factory():
    path = os.path.join(get_data_dir(), DBNAME)
    db = dvc_db_factory(path)
    # from pychron.database.adapters.isotope_adapter import IsotopeAdapter
    # from pychron.database.orms.isotope.util import Base
开发者ID:NMGRL,项目名称:pychron,代码行数:30,代码来源:irradiation_loader.py


注:本文中的pychron.core.helpers.logger_setup.logging_setup函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。