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

Python pykolab.getLogger函数代码示例

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

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



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

示例1: __init__

from ConfigParser import RawConfigParser
import os
import sys
import time
from urlparse import urlparse

import components

import pykolab

from pykolab import utils
from pykolab.constants import *
from pykolab.translate import _

log = pykolab.getLogger('pykolab.setup')
conf = pykolab.getConf()

def __init__():
    components.register(
            'freebusy',
            execute,
            description=description(),
            after=['ldap']
        )

def description():
    return _("Setup Free/Busy.")

def execute(*args, **kw):
    if not os.path.isfile('/etc/kolab-freebusy/config.ini') and not os.path.isfile('/etc/kolab-freebusy/config.ini.sample'):
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:setup_freebusy.py


示例2: todo_from_ical

import datetime
import kolabformat
import icalendar
import pytz

import pykolab
from pykolab import constants
from pykolab.xml import Event
from pykolab.xml import utils as xmlutils
from pykolab.xml.event import InvalidEventDateError
from pykolab.translate import _

log = pykolab.getLogger('pykolab.xml_todo')

def todo_from_ical(string):
    return Todo(from_ical=string)

def todo_from_string(string):
    return Todo(from_string=string)

def todo_from_message(message):
    todo = None
    if message.is_multipart():
        for part in message.walk():
            if part.get_content_type() == "application/calendar+xml":
                payload = part.get_payload(decode=True)
                todo = todo_from_string(payload)

            # append attachment parts to Todo object
            elif todo and part.has_key('Content-ID'):
                todo._attachment_parts.append(part)
开发者ID:tpokorra,项目名称:pykolab,代码行数:31,代码来源:todo.py


示例3: Auth

from sqlalchemy.schema import Index
from sqlalchemy.schema import UniqueConstraint

sys.path.append('..')
sys.path.append('../..')

import pykolab

from pykolab.auth import Auth
from pykolab.constants import KOLAB_LIB_PATH
from pykolab import telemetry
from pykolab.translate import _

# TODO: Figure out how to make our logger do some syslogging as well.
log = pykolab.getLogger('pykolab.parse_telemetry')

# TODO: Removing the stdout handler would mean one can no longer test by
# means of manual execution in debug mode.
#log.remove_stdout_handler()

conf = pykolab.getConf()
conf.finalize_conf()

auth = Auth()

db = telemetry.init_db()

while True:
    try:
        log_file = conf.cli_args.pop(0)
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:kolab_parse_telemetry.py


示例4: __init__

from email.utils import formataddr
from email.utils import getaddresses

import modules

import pykolab

from pykolab.auth import Auth
from pykolab.conf import Conf
from pykolab.imap import IMAP
from pykolab.xml import event_from_ical
from pykolab.xml import event_from_string
from pykolab.xml import to_dt
from pykolab.translate import _

log = pykolab.getLogger('pykolab.wallace')
conf = pykolab.getConf()

mybasepath = '/var/spool/pykolab/wallace/resources/'

auth = None
imap = None

def __init__():
    modules.register('resources', execute, description=description())

def accept(filepath):
    new_filepath = os.path.join(
            mybasepath,
            'ACCEPT',
            os.path.basename(filepath)
开发者ID:detrout,项目名称:pykolab,代码行数:31,代码来源:module_resources.py


示例5: hasattr

import json
import httplib
import sys
from urlparse import urlparse

import pykolab

from pykolab import utils
from pykolab.translate import _

log = pykolab.getLogger('pykolab.wap_client')
conf = pykolab.getConf()

if not hasattr(conf, 'defaults'):
    conf.finalize_conf()

API_HOSTNAME = "localhost"
API_SCHEME = "http"
API_PORT = 80
API_BASE = "/kolab-webadmin/api/"

kolab_wap_url = conf.get('kolab_wap', 'api_url')

if not kolab_wap_url == None:
    result = urlparse(kolab_wap_url)
else:
    result = None

if hasattr(result, 'hostname'):
    API_HOSTNAME = result.hostname
开发者ID:detrout,项目名称:pykolab,代码行数:30,代码来源:__init__.py


示例6: KolabPlugins

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import logging
import os
import pdb
import sys
import traceback

import pykolab

from pykolab.translate import _

log = pykolab.getLogger('pykolab.plugins')
conf = pykolab.getConf()

class KolabPlugins(object):
    """
        Detects, loads and interfaces with plugins for different
        Kolab components.
    """
    def __init__(self):
        """
            Searches the plugin directory for plugins, and loads
            them into a list.
        """
        self.plugins = {}

        for plugin_path in [
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:__init__.py


示例7: KolabDynamicquota

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import pykolab

from pykolab.translate import _

conf = pykolab.getConf()
log = pykolab.getLogger('pykolab.plugins.dynamicquota')

class KolabDynamicquota(object):
    """
        Example plugin making quota adjustments given arbitrary conditions.
    """

    def __init__(self):
        pass

    def add_options(self, *args,  **kw):
        pass

    def set_user_folder_quota(self, *args, **kw):
        """
            The arguments passed to the 'set_user_folder_quota' hook:
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:__init__.py


示例8: KolabRoundcubedb

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

import os
import pykolab
import subprocess

from pykolab.translate import _

log = pykolab.getLogger('pykolab.plugins.roundcubedb')
conf = pykolab.getConf()

class KolabRoundcubedb(object):
    """
        Pykolab plugin to update Roundcube's database on Kolab users db changes
    """

    def __init__(self):
        pass

    def add_options(self, *args,  **kw):
        pass

    def user_delete(self, *args, **kw):
        """
开发者ID:tpokorra,项目名称:pykolab,代码行数:31,代码来源:__init__.py


示例9: SASLAuthDaemon

import grp
import os
import pwd
import shutil
import sys
import time
import traceback

import pykolab

from pykolab import utils
from pykolab.auth import Auth
from pykolab.constants import *
from pykolab.translate import _

log = pykolab.getLogger('saslauthd')
conf = pykolab.getConf()

class SASLAuthDaemon(object):
    def __init__(self):
        daemon_group = conf.add_cli_parser_option_group(_("Daemon Options"))

        daemon_group.add_option(
                "--fork",
                dest    = "fork_mode",
                action  = "store_true",
                default = False,
                help    = _("Fork to the background.")
            )

        daemon_group.add_option(
开发者ID:tpokorra,项目名称:pykolab,代码行数:31,代码来源:__init__.py


示例10:

    from sqlalchemy.orm import create_session

from sqlalchemy.schema import Index
from sqlalchemy.schema import UniqueConstraint

sys.path = ['..'] + sys.path

import pykolab

from pykolab import utils
from pykolab.auth import Auth
from pykolab.constants import *
from pykolab.translate import _

# TODO: Figure out how to make our logger do some syslogging as well.
log = pykolab.getLogger('pykolab.smtp_access_policy')

# TODO: Removing the stdout handler would mean one can no longer test by
# means of manual execution in debug mode.
log.remove_stdout_handler()

conf = pykolab.getConf()

#
# Caching routines using SQLAlchemy.
#
# If creating the cache fails, we continue without any caching, significantly
# increasing the load on LDAP.
#
cache_expire = 3600
try:
开发者ID:detrout,项目名称:pykolab,代码行数:31,代码来源:kolab_smtp_access_policy.py


示例11: Entry

except:
    from sqlalchemy.orm import relation as relationship

try:
    from sqlalchemy.orm import sessionmaker
except:
    from sqlalchemy.orm import create_session

import pykolab

from pykolab import utils
from pykolab.constants import KOLAB_LIB_PATH
from pykolab.translate import _

conf = pykolab.getConf()
log = pykolab.getLogger('pykolab.auth_cache')

metadata = MetaData()

db = None

##
## Classes
##

class Entry(object):
    def __init__(self, uniqueid, result_attr, last_change):
        self.uniqueid = uniqueid
        self.result_attribute = result_attr

        modifytimestamp_format = conf.get('ldap', 'modifytimestamp_format')
开发者ID:detrout,项目名称:pykolab,代码行数:31,代码来源:cache.py


示例12: Auth

# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import logging
import os
import time

import pykolab
import pykolab.base

from pykolab.translate import _

log = pykolab.getLogger('pykolab.auth')
conf = pykolab.getConf()

class Auth(pykolab.base.Base):
    """
        This is the Authentication and Authorization module for PyKolab.
    """

    def __init__(self, domain=None):
        """
            Initialize the authentication class.
        """
        pykolab.base.Base.__init__(self, domain=domain)

        self._auth = None
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:__init__.py


示例13: open

#sys.stderr = open('/dev/null', 'a')

name = 'kolab'
description = "Kolab Groupware Listener for UCS"

# The filter has to be composed to make sure only Kolab Groupware
# related objects are passed along to this listener module.
filter = '(|(objectClass=kolabInetOrgPerson)(objectClass=univentionMailSharedFolder))'
#attributes = [ '*' ]

import pykolab
from pykolab import constants
from pykolab import utils

log = pykolab.getLogger('pykolab.listener')
#log.remove_stdout_handler()
log.setLevel(logging.DEBUG)
log.debuglevel = 9

conf = pykolab.getConf()
conf.finalize_conf(fatal=False)
conf.debuglevel = 9

from pykolab.auth import Auth

def handler(*args, **kw):
    log.info("kolab.handler(args(%d): %r, kw: %r)" % (len(args), args, kw))

    auth = Auth()
    auth.connect()
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:listener.py


示例14: Cyrus

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import cyruslib
import sys
import time

from urlparse import urlparse

import pykolab

from pykolab.imap import IMAP
from pykolab.translate import _

log = pykolab.getLogger('pykolab.imap')
conf = pykolab.getConf()

class Cyrus(cyruslib.CYRUS):
    """
        Abstraction class for some common actions to do exclusively in Cyrus.

        For example, the following functions require the commands to be
        executed against the backend server if a murder is being used.

        - Setting quota
        - Renaming the top-level mailbox
        - Setting annotations

    """
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:cyrus.py


示例15: KolabdProcess

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import multiprocessing
import os
import time

import pykolab
from pykolab.auth import Auth
from pykolab.translate import _

log = pykolab.getLogger('pykolab.daemon')
conf = pykolab.getConf()

class KolabdProcess(multiprocessing.Process):
    def __init__(self, domain):
        self.domain = domain
        log.debug(_("Process created for domain %s") % (domain), level=8)
        multiprocessing.Process.__init__(
                self,
                target=self.synchronize,
                args=(domain,),
                name="Kolab(%s)" % domain
            )

    def synchronize(self, domain):
        log.debug(_("Synchronizing for domain %s") % (domain), level=8)
开发者ID:tpokorra,项目名称:pykolab,代码行数:31,代码来源:process.py


示例16: KolabDefaultfolders

#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

import pykolab

from pykolab.translate import _

log = pykolab.getLogger('pykolab.plugins.defaultfolders')
conf = pykolab.getConf()

class KolabDefaultfolders(object):
    """
        Example plugin to create a set of default folders.
    """

    def __init__(self):
        pass

    def add_options(self, *args,  **kw):
        pass

    def create_user_folders(self, *args, **kw):
        """
开发者ID:detrout,项目名称:pykolab,代码行数:31,代码来源:__init__.py


示例17: event_from_ical

from icalendar import vDatetime
from icalendar import vText
import kolabformat
import pytz
import time
import uuid

import pykolab
from pykolab import constants
from pykolab import utils
from pykolab.translate import _

from attendee import Attendee
from contact_reference import ContactReference

log = pykolab.getLogger('pykolab.xml_event')

def event_from_ical(string):
    return Event(from_ical=string)

def event_from_string(string):
    return Event(from_string=string)

class Event(object):
    status_map = {
            "TENTATIVE": kolabformat.StatusTentative,
            "CONFIRMED": kolabformat.StatusConfirmed,
            "CANCELLED": kolabformat.StatusCancelled,
        }

    def __init__(self, from_ical="", from_string=""):
开发者ID:detrout,项目名称:pykolab,代码行数:31,代码来源:event.py


示例18: Conf

import logging
import os
import sys

from optparse import OptionParser
from ConfigParser import SafeConfigParser

import pykolab

from pykolab.conf.defaults import Defaults

from pykolab.constants import *
from pykolab.translate import _

log = pykolab.getLogger('pykolab.conf')

class Conf(object):
    def __init__(self):
        """
            self.cli_args == Arguments passed on the CLI
            self.cli_keywords == Parser results (again, CLI)
            self.cli_parser == The actual Parser (from OptionParser)
            self.plugins == Our Kolab Plugins
        """

        self.cli_parser = None
        self.cli_args = None
        self.cli_keywords = None

        self.entitlement = None
开发者ID:detrout,项目名称:pykolab,代码行数:30,代码来源:__init__.py


示例19: __init__

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import commands

import pykolab

from pykolab.imap import IMAP
from pykolab.translate import _

log = pykolab.getLogger('pykolab.cli')
conf = pykolab.getConf()

def __init__():
    commands.register('undelete_mailbox', execute, description=description())

def cli_options():
    my_option_group = conf.add_cli_parser_option_group(_("CLI Options"))
    my_option_group.add_option( '--dry-run',
                                dest    = "dry_run",
                                action  = "store_true",
                                default = False,
                                help    = _("Do not actually execute, but state what would have been executed."))

def description(*args, **kw):
    return _("Recover mailboxes previously deleted.")
开发者ID:tpokorra,项目名称:pykolab,代码行数:31,代码来源:cmd_undelete_mailbox.py


示例20: KolabRecipientpolicy

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import pykolab

from pykolab import utils
from pykolab.translate import _

conf = pykolab.getConf()
log = pykolab.getLogger('pykolab.plugins.recipientpolicy')

class KolabRecipientpolicy(object):
    """
        Example plugin making quota adjustments given arbitrary conditions.
    """

    def __init__(self):
        pass

    def add_options(self, *args,  **kw):
        pass

    #def mail_domain_space_policy_check(self, kw={}, args=()):
        #(mail, alternative_mail, domain_name, domain_root_dn) = args
开发者ID:tpokorra,项目名称:pykolab,代码行数:30,代码来源:__init__.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python auth.Auth类代码示例发布时间:2022-05-25
下一篇:
Python pykolab.getConf函数代码示例发布时间: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