Example #1
0
    def __init__(self,
                 template_dir=None,
                 template_filename=None,
                 template=None,
                 template_name=None,
                 subject_filename=None,
                 subject=None,
                 template_type=None,
                 ctx=None,
                 wantProperties=True,
                 wantSteps=False,
                 wantLogs=False):

        if template_name is not None:
            config.warnDeprecated(
                '0.9.1', "template_name is deprecated, use template_filename")
            template_filename = template_name
        MessageFormatterBase.__init__(self,
                                      template_dir=template_dir,
                                      template_filename=template_filename,
                                      template=template,
                                      subject_filename=subject_filename,
                                      subject=subject,
                                      template_type=template_type,
                                      ctx=ctx)
        self.wantProperties = wantProperties
        self.wantSteps = wantSteps
        self.wantLogs = wantLogs
Example #2
0
    def __init__(self, template_dir=None,
                 template_filename=None, template=None, template_name=None,
                 subject_filename=None, subject=None,
                 template_type=None, ctx=None,
                 wantProperties=True, wantSteps=False, wantLogs=False):

        if template_name is not None:
            config.warnDeprecated('0.9.1', "template_name is deprecated, use template_filename")
            template_filename = template_name

        self.body_template = self.getTemplate(template_filename, template_dir, template)
        self.subject_template = None
        if subject_filename or subject:
            self.subject_template = self.getTemplate(subject_filename, template_dir, subject)

        if template_type is not None:
            self.template_type = template_type

        if ctx is None:
            ctx = {}

        self.ctx = ctx
        self.wantProperties = wantProperties
        self.wantSteps = wantSteps
        self.wantLogs = wantLogs
Example #3
0
    def __init__(self, owner, slug,
                 branch=None,
                 pollInterval=10 * 60,
                 useTimestamps=True,
                 category=None,
                 project='',
                 pullrequest_filter=True,
                 encoding=_UNSPECIFIED,
                 pollAtLaunch=False
                 ):

        self.owner = owner
        self.slug = slug
        self.branch = branch
        super().__init__(name='/'.join([owner, slug]), pollInterval=pollInterval, pollAtLaunch=pollAtLaunch)
        if encoding != _UNSPECIFIED:
            config.warnDeprecated('2.6.0', 'encoding of BitbucketPullrequestPoller is deprecated.')

        if hasattr(pullrequest_filter, '__call__'):
            self.pullrequest_filter = pullrequest_filter
        else:
            self.pullrequest_filter = (lambda _: pullrequest_filter)

        self.lastChange = time.time()
        self.lastPoll = time.time()
        self.useTimestamps = useTimestamps
        self.category = category if callable(
            category) else bytes2unicode(category)
        self.project = bytes2unicode(project)
        self.initLock = defer.DeferredLock()
Example #4
0
 def checkConfig(self, serverUrl, user=None, password=None, auth=None, format_fn=None, **kwargs):
     if user is not None and auth is not None:
         config.error("Only one of user/password or auth must be given")
     if user is not None:
         config.warnDeprecated("0.9.1", "user/password is deprecated, use 'auth=(user, password)'")
     if (format_fn is not None) and not callable(format_fn):
         config.error("format_fn must be a function")
     HttpStatusPushBase.checkConfig(self, **kwargs)
Example #5
0
File: http.py Project: nvg24/lit
 def checkConfig(self, serverUrl, user=None, password=None, auth=None, format_fn=None, **kwargs):
     if user is not None and auth is not None:
         config.error("Only one of user/password or auth must be given")
     if user is not None:
         config.warnDeprecated("0.9.1", "user/password is deprecated, use 'auth=(user, password)'")
     if (format_fn is not None) and not callable(format_fn):
         config.error("format_fn must be a function")
     super().checkConfig(**kwargs)
Example #6
0
    def __init__(self, template_dir=None,
                 template_filename=None, template=None, template_name=None,
                 subject_filename=None, subject=None,
                 template_type=None, ctx=None,
                 wantProperties=True, wantSteps=False, wantLogs=False):

        if template_name is not None:
            config.warnDeprecated('0.9.1', "template_name is deprecated, use template_filename")
            template_filename = template_name
        MessageFormatterBase.__init__(self,
                                      template_dir=template_dir,
                                      template_filename=template_filename, template=template,
                                      subject_filename=subject_filename, subject=subject,
                                      template_type=template_type, ctx=ctx)
        self.wantProperties = wantProperties
        self.wantSteps = wantSteps
        self.wantLogs = wantLogs