• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python logger_setup.logging_setup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: r_mkdir

    r_mkdir(ldir)
    paths.log_dir = ldir
    paths.root = root


if __name__ == '__main__':

    root = os.path.dirname(__file__)
    from .helpers import add_eggs
    add_eggs(root)

    build_directories()
    from pychron.core.helpers.logger_setup import logging_setup
    from pychron.managers.remote_hardware_server_manager import RemoteHardwareServerManager

    logging_setup('server')
    s = RemoteHardwareServerManager()  # handler_klass=AppHandler)
    s.load()
    s.configure_traits()
    os._exit(0)

#    launch()
# ============= EOF ====================================
#
# def read_configuration():
#    '''
#         read the server initialization file in the initialization dir.
#
#         ex
#         [General]
#         servers= server_names
开发者ID:NMGRL,项目名称:pychron,代码行数:31,代码来源:remote_hardware_server.py


示例17: set_toolkit

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.processing.autoupdate_parser import AutoupdateParser
from test.database import isotope_manager_factory

ISOTOPE_MANAGER = isotope_manager_factory(name='pychrondata_minnabluff')
ISOTOPE_MANAGER.connect()

SKIP_BLANKS = False, 'skip blanks'
SKIP_SIGNALS = False, 'skip signals'
SKIP_FITS = False, 'skip fits'

logging_setup('arar_diff')


class MassSpecPychronIsotopeTestCase(object):
    def setUp(self):
        pass

    def get_expected_value(self, k):
        p = self.parser

        s = p.samples[self.sample_id]
        an = s.analyses[self.analysis_id]
        ev = getattr(an, k)

        sev = str(ev)
        if '.' in sev:
开发者ID:OSUPychron,项目名称:pychron,代码行数:30,代码来源:arar_diff.py


示例18: set_toolkit

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.paths import paths

paths.build('_unittest')
#build_directories(paths)

from pychron.core.helpers.logger_setup import logging_setup

logging_setup('packager')

from test.database import isotope_manager_factory
from pychron.processing.vcs_data.packager import Packager



import unittest


class ArArAgeCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.isotope_man = isotope_manager_factory(name='pychrondata_minnabluff')
        cls.isotope_man.db.connect()
        man = cls.isotope_man
        db = man.db
        with db.session_ctx():
            ans, tc = db.get_sample_analyses(['AF-72', ], ['Minna Bluff'])
            cls.analyses=man.make_analyses(ans)
开发者ID:jirhiker,项目名称:pychron,代码行数:31,代码来源:vcs_packager.py


示例19: klass

#             klass = VideoStageManager
#         else:
#             klass = StageManager
#
#         args['parent'] = self
#         sm = klass(**args)
#         return sm
#     def _power_calibration_manager_default(self):
#         return PowerCalibrationManager(
#                                        parent=self,
#                                        db=self.get_power_calibration_database(),
#                                        application=self.application
#                                        )


if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup
    logging_setup('calib')
    lm = LaserManager(name='FusionsDiode')
    lm.set_laser_power(10)
#    from pychron.lasers.power.power_calibration_manager import PowerCalibrationManager, PowerCalibrationObject
#
#    pc=PowerCalibrationObject()
#    pc.coefficients=[0.84,-13.76]
#
#    pm=PowerCalibrationManager(parent=lm)
#    pm._dump_calibration(pc)

#    lm.set_laser_power(10)
#============= EOF ====================================
开发者ID:jirhiker,项目名称:pychron,代码行数:30,代码来源:laser_manager.py


示例20: traits_view

        return b

#============= views ===================================
    def traits_view(self):
        v = View(
                 Item('control', show_label=False, style='custom'),
#                 VGroup(
#                        Item('laser_amps', format_str = '%0.2f', style = 'readonly'),
#                        Item('laser_temperature', format_str = '%0.2f', style = 'readonly'),
#                        Item('laser_power', format_str = '%0.2f', style = 'readonly'),
#                        Item('laser_voltage', format_str = '%0.2f', style = 'readonly'),
#                        ),
#                    handler = self.handler_klass,
                    width=500,
                    height=500,
                    resizable=True
                 )
        return v



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

    logging_setup('vue_metrix')
    v = VueMetrixManager()
    v.control.bootstrap()
    v.configure_traits()

#============= EOF ====================================
开发者ID:UManPychron,项目名称:pychron,代码行数:30,代码来源:vue_metrix_manager.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python strtools.to_bool函数代码示例发布时间:2022-05-25
下一篇:
Python formatting.floatfmt函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap