Esempio n. 1
0
 def __init__(self, baseurl):
     self.baseurl = baseurl.rstrip('/')
     self.basehost = urlparse(baseurl).netloc
     self.sync_comments = (config.checkwatches.sync_comments
                           and (ISupportsCommentPushing.providedBy(self)
                                or ISupportsCommentImport.providedBy(self)
                                or ISupportsBackLinking.providedBy(self)))
Esempio n. 2
0
 def __init__(self, baseurl):
     self.baseurl = baseurl.rstrip('/')
     self.basehost = urlparse(baseurl).netloc
     self.sync_comments = (
         config.checkwatches.sync_comments and (
             ISupportsCommentPushing.providedBy(self) or
             ISupportsCommentImport.providedBy(self) or
             ISupportsBackLinking.providedBy(self)))
Esempio n. 3
0
    def __init__(self, parent, external_bugtracker, remote_bug,
                 bug_watch_ids, unmodified_remote_ids, server_time):
        self.initFromParent(parent)
        self.external_bugtracker = external_bugtracker
        self.bug_tracker_url = external_bugtracker.baseurl
        self.remote_bug = remote_bug
        self.bug_watch_ids = bug_watch_ids
        self.unmodified_remote_ids = unmodified_remote_ids

        self.error_type_messages = {
            BugWatchActivityStatus.INVALID_BUG_ID:
                ("Invalid bug %(bug_id)r on %(base_url)s "
                 "(local bugs: %(local_ids)s)."),
            BugWatchActivityStatus.BUG_NOT_FOUND:
                ("Didn't find bug %(bug_id)r on %(base_url)s "
                 "(local bugs: %(local_ids)s)."),
            BugWatchActivityStatus.PRIVATE_REMOTE_BUG:
                ("Remote bug %(bug_id)r on %(base_url)s is private "
                 "(local bugs: %(local_ids)s)."),
            }
        self.error_type_message_default = (
            "remote bug: %(bug_id)r; "
            "base url: %(base_url)s; "
            "local bugs: %(local_ids)s"
            )

        # Whether we can import and / or push comments is determined
        # on a per-bugtracker-type level.
        self.can_import_comments = (
            ISupportsCommentImport.providedBy(external_bugtracker) and
            external_bugtracker.sync_comments)
        self.can_push_comments = (
            ISupportsCommentPushing.providedBy(external_bugtracker) and
            external_bugtracker.sync_comments)
        self.can_back_link = (
            ISupportsBackLinking.providedBy(external_bugtracker) and
            external_bugtracker.sync_comments)

        if self.can_import_comments and server_time is None:
            self.can_import_comments = False
            self.warning(
                "Comment importing supported, but server time can't be "
                "trusted. No comments will be imported.")
    def __init__(self, parent, external_bugtracker, remote_bug, bug_watch_ids, unmodified_remote_ids, server_time):
        self.initFromParent(parent)
        self.external_bugtracker = external_bugtracker
        self.bug_tracker_url = external_bugtracker.baseurl
        self.remote_bug = remote_bug
        self.bug_watch_ids = bug_watch_ids
        self.unmodified_remote_ids = unmodified_remote_ids

        self.error_type_messages = {
            BugWatchActivityStatus.INVALID_BUG_ID: (
                "Invalid bug %(bug_id)r on %(base_url)s " "(local bugs: %(local_ids)s)."
            ),
            BugWatchActivityStatus.BUG_NOT_FOUND: (
                "Didn't find bug %(bug_id)r on %(base_url)s " "(local bugs: %(local_ids)s)."
            ),
            BugWatchActivityStatus.PRIVATE_REMOTE_BUG: (
                "Remote bug %(bug_id)r on %(base_url)s is private " "(local bugs: %(local_ids)s)."
            ),
        }
        self.error_type_message_default = (
            "remote bug: %(bug_id)r; " "base url: %(base_url)s; " "local bugs: %(local_ids)s"
        )

        # Whether we can import and / or push comments is determined
        # on a per-bugtracker-type level.
        self.can_import_comments = (
            ISupportsCommentImport.providedBy(external_bugtracker) and external_bugtracker.sync_comments
        )
        self.can_push_comments = (
            ISupportsCommentPushing.providedBy(external_bugtracker) and external_bugtracker.sync_comments
        )
        self.can_back_link = ISupportsBackLinking.providedBy(external_bugtracker) and external_bugtracker.sync_comments

        if self.can_import_comments and server_time is None:
            self.can_import_comments = False
            self.warning(
                "Comment importing supported, but server time can't be " "trusted. No comments will be imported."
            )