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


Python log_file.LogFile类代码示例

本文整理汇总了Python中goodcrypto.utils.log_file.LogFile的典型用法代码示例。如果您正苦于以下问题:Python LogFile类的具体用法?Python LogFile怎么用?Python LogFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: log_message

def log_message(message):
    ''' Log a message to the local log. '''

    global log

    if log is None:
        log = LogFile()

    log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:9,代码来源:import_key.py

示例2: log_message

def log_message(message):
    '''
        Log a message.

        >>> from syr.log import BASE_LOG_DIR
        >>> from syr.user import whoami
        >>> log_message('test')
        >>> os.path.exists(os.path.join(BASE_LOG_DIR, whoami(), 'goodcrypto.mail.message.utils.log'))
        True
    '''
    global _log

    if _log is None:
        _log = LogFile()

    _log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:16,代码来源:utils.py

示例3: log_message

    def log_message(self, message):
        ''' Log a message. '''

        if self.log is None:
            self.log = LogFile()

        self.log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-oce,代码行数:7,代码来源:gpg_plugin.py

示例4: __init__

    def __init__(self, email, encryption_name, keyserver, user_initiated_search):
        '''
            >>> # In honor of Werner Koch, developer of gpg.
            >>> email = '[email protected]'
            >>> crypto_name = 'GPG'
            >>> srk_class = SearchKeyserver(email, crypto_name, 'pgp.mit.edu', '[email protected]')
            >>> srk_class != None
            True
            >>> srk_class = SearchKeyserver(None, crypto_name, 'pgp.mit.edu', '[email protected]')
            >>> srk_class != None
            True
            >>> srk_class = SearchKeyserver(email, None, 'pgp.mit.edu', '[email protected]')
            >>> srk_class != None
            True
            >>> srk_class = SearchKeyserver(email, crypto_name, None, '[email protected]')
            >>> srk_class != None
            True
            >>> srk_class = SearchKeyserver(None, None, None, None)
            >>> srk_class != None
            True
        '''

        self.log = LogFile()
        self.email = email
        self.encryption_name = encryption_name
        self.keyserver = keyserver
        self.user_initiated_search = user_initiated_search
        self.key_plugin = None
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:28,代码来源:search_keyserver.py

示例5: log_message

def log_message(message):
    '''
        Log a message to the local log.

        >>> import os.path
        >>> from syr.log import BASE_LOG_DIR
        >>> from syr.user import whoami
        >>> log_message('test')
        >>> os.path.exists(os.path.join(BASE_LOG_DIR, whoami(), 'goodcrypto.mail.user_keys.log'))
        True
    '''

    global log

    if log is None:
        log = LogFile()

    log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:18,代码来源:user_keys.py

示例6: log_message

    def log_message(self, message):
        '''
            Record debugging messages.
        '''

        if self.log is None:
            self.log = LogFile('goodcrypto.mail.log')

        self.log.write(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:9,代码来源:__main__.py

示例7: log_message

    def log_message(self, message):
        '''
            Log the message to the local log.
        '''

        if self.log is None:
            self.log = LogFile()

        self.log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:9,代码来源:header_keys.py

示例8: __init__

    def __init__(self, crypto_message):
        '''
            >>> decrypt = Debundle(None)
            >>> decrypt != None
            True
        '''

        self.log = LogFile()
        self.crypto_message = crypto_message
        self.messages_sent = 0
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:10,代码来源:debundle.py

示例9: __init__

    def __init__(self):
        '''
            >>> header_keys = HeaderKeys()
            >>> header_keys != None
            True
        '''

        self.log = LogFile()

        self.recipient_to_notify = None
        self.new_key_imported = False
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:11,代码来源:header_keys.py

示例10: __init__

    def __init__(self, crypto_message):
        '''
            >>> encrypt = Encrypt(None)
            >>> encrypt != None
            True
        '''

        self._log = LogFile()
        self.crypto_message = crypto_message
        self.verification_code = None
        self.ready_to_protect_metadata = False
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:11,代码来源:encrypt.py

示例11: __init__

    def __init__(self, crypto_message):
        '''
            >>> decrypt = Decrypt(None)
            >>> decrypt != None
            True
        '''

        self.log = LogFile()
        self.crypto_message = crypto_message

        self.need_to_send_metadata_key = False
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:11,代码来源:decrypt.py

示例12: __init__

    def __init__(self, home_dir, auto_check_trustdb=False):
        '''
            Create a new GPGExec object.

            >>> gpg_exec = GPGExec('/var/local/projects/goodcrypto/server/data/oce/.gnupg')
            >>> gpg_exec != None
            True
        '''

        self.log = LogFile()

        self.gpg_home = home_dir

        self.result_code = gpg_constants.ERROR_RESULT
        self.gpg_output = None
        self.gpg_error = None

        self.set_up_conf()

        # --no-tty: Do not write anything to TTY
        # --homedir: home directory for gpg's keyring files
        # --verbose: give details if error
        # --ignore-time-conflict: Since different machines have different ideas of what time it is, we want to ignore time conflicts.
        # --ignore-valid-from: "valid-from" is just a different kind of time conflict.
        # --batch: We're always in batch mode.
        # --lock-once: Lock the databases the first time a lock is requested and do not release the lock until the process terminates.
        # --no-auto-key-locate: Don't look for keys outside our system
        # --no-auto-check-trustdb: Do not always update the trust db because it goes online
        # --always-trust: We don't have any trust infrastructure yet.
        # --utf8-strings: Assume all arguments are in UTF-8 format.
        # redirect stdout and stderr so we can exam the results as needed
        kwargs = dict(no_tty=True, verbose=True, homedir=self.gpg_home,
           ignore_time_conflict=True, ignore_valid_from=True, batch=True,
           no_auto_key_locate=True, lock_once=True, utf8_strings=True, _env=minimal_env())

        # gpg tries to go online when it updates the trustdb
        # so we don't want to check on every command
        if auto_check_trustdb:
            kwargs['auto_check_trustdb'] = True
            self.log_message('auto_check_trustdb')
        else:
            kwargs['no_auto_check_trustdb'] = True
            self.log_message('no_auto_check_trustdb')
            if (self.gpg_home is not None and
                os.path.exists(os.path.join(self.gpg_home, gpg_constants.TRUST_DB_FILENAME))):
                kwargs['always_trust'] = True
        self.gpg = sh.gpg.bake(**kwargs)

        # make sure no old job has left locked files
        self.clear_gpg_lock_files()
        self.clear_gpg_tmp_files()
开发者ID:goodcrypto,项目名称:goodcrypto-oce,代码行数:51,代码来源:gpg_exec.py

示例13: __init__

    def __init__(self, email_message):
        '''
            Unparsable messages are wrapped in a valid message.

            >>> from goodcrypto_tests.mail.message_utils import get_basic_email_message
            >>> good_message = get_basic_email_message()
            >>> validator = Validator(good_message)
            >>> validator != None
            True
        '''

        self.log = LogFile()
        self.email_message = email_message
        self.why = None
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:14,代码来源:validator.py

示例14: log_message

    def log_message(self, message):
        '''
            Log the message to the local log.

            >>> import os.path
            >>> from syr.log import BASE_LOG_DIR
            >>> from syr.user import whoami
            >>> CryptoMessage().log_message('test')
            >>> os.path.exists(os.path.join(BASE_LOG_DIR, whoami(), 'goodcrypto.mail.message.crypto_message.log'))
            True
        '''

        if self.log is None:
            self.log = LogFile()

        self.log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:16,代码来源:crypto_message.py

示例15: log_message

    def log_message(self, message):
        '''
            Record debugging messages.

            >>> import os.path
            >>> from syr.log import BASE_LOG_DIR
            >>> from syr.user import whoami
            >>> filter = Filter('[email protected]', ['[email protected]'], 'message')
            >>> filter.log_message('test')
            >>> os.path.exists(os.path.join(BASE_LOG_DIR, whoami(), 'goodcrypto.mail.message.filter.log'))
            True
        '''

        if self.log is None:
            self.log = LogFile()

        self.log.write_and_flush(message)
开发者ID:goodcrypto,项目名称:goodcrypto-mail,代码行数:17,代码来源:filter.py


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