home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- from utils import valid_lp_url, bugnumber_to_url
- from lphelper import LateBindingProperty
- from lpconstants import BASEURL
-
- class LPBugInfo(object):
-
- def __init__(self, nr, url, status, importance, summary, package = None, all_tasks = False):
- if not nr:
- raise AssertionError, "'LPBugInfo' needs at least the bugnumber as an argument"
- self._LPBugInfo__bugnumber = int(nr)
- self._LPBugInfo__url = url
- self._LPBugInfo__status = status
- self._LPBugInfo__importance = importance
- self._LPBugInfo__summary = summary
- self._LPBugInfo__sourcepackage = package
- self._LPBugInfo__all_tasks = all_tasks
-
-
- def bugnumber(self):
- return int(self._LPBugInfo__bugnumber)
-
- bugnumber = property(bugnumber)
-
- def url(self):
- if not self._LPBugInfo__url:
- pass
- return bugnumber_to_url(self.bugnumber)
-
- url = property(url)
-
- def status(self):
- if not self._LPBugInfo__status:
- pass
- return 'unknown'
-
- status = property(status)
-
- def importance(self):
- if not self._LPBugInfo__importance:
- pass
- return 'unknown'
-
- importance = property(importance)
-
- def summary(self):
- if not self._LPBugInfo__summary:
- pass
- return 'unknown'
-
- summary = property(summary)
-
- def sourcepackage(self):
- if not self._LPBugInfo__sourcepackage:
- pass
- return ''
-
- sourcepackage = property(sourcepackage)
-
- def __int__(self):
- return self.bugnumber
-
-
- def __repr__(self):
- return '<BugInfo %s>' % self.bugnumber
-
-
- def __str__(self):
- return '[Bug %s %s: %s/%s]' % (self.bugnumber, self.sourcepackage, self.status, self.importance)
-
-
- def __hash__(self):
- if not self._LPBugInfo__all_tasks:
- return self.bugnumber
- return super(LPBugInfo, self).__hash__()
-
-
- def __eq__(self, other):
- return hash(self) == hash(other)
-
-
-
- class Bug(object):
-
- def __init__(self, bug = None, url = None, connection = None):
- if not [](_[1]) == 1:
- raise AssertionError, 'Bug needs one argument, either <bug> or <url>'
- if not connection:
- raise AssertionError, 'Connection object needed'
- (self._Bug__bugnumber, self._Bug__url, self._Bug__status, self._Bug__importance, self._Bug__sourcepackage, self._Bug__summary) = [
- None] * 6
- self._Bug__connection = connection
- self._Bug__saved_hash = None
- if bug:
- if isinstance(bug, int):
- self._Bug__bugnumber = bug
- self._Bug__url = bugnumber_to_url(self._Bug__bugnumber)
- elif isinstance(bug, LPBugInfo):
- self._Bug__bugnumber = int(bug)
- self._Bug__url = bug.url
- self._Bug__status = bug.status
- self._Bug__importance = bug.importance
- self._Bug__sourcepackage = bug.sourcepackage
- self._Bug__summary = bug.summary
- self._Bug__saved_hash = hash(bug)
- elif not None:
- raise AssertionError, 'type of bugnumber must be INT or STRING or bugnumber must be an instance of BugInfo, %s' % bug
- [] if isinstance(bug, str) else [](_[1]) == 1
- elif url:
- self._Bug__url = valid_lp_url(url, BASEURL.BUG)
- if not self._Bug__url:
- raise AssertionError, 'Invalid launchpad url %s' % url
- self._Bug__bugnumber = int(self._Bug__url.split('/')[-1])
-
-
-
- def __int__(self):
- return int(self.bugnumber)
-
-
- def __repr__(self):
- return '<Bug %s>' % self.bugnumber
-
-
- def __str__(self):
- if not self.sourcepackage:
- pass
- return '[Bug %s %s: %s/%s]' % (self.bugnumber, '', self.status, self.importance)
-
-
- def __hash__(self):
- if self._Bug__saved_hash is not None:
- return self._Bug__saved_hash
- return super(Bug, self).__hash__()
-
-
- def __eq__(self, other):
- return hash(self) == hash(other)
-
-
- def get_url(self):
- return self._Bug__url
-
- url = property(get_url, doc = 'returns url of a bug report')
-
- def get_bugnumber(self):
- return self._Bug__bugnumber
-
- bugnumber = property(get_bugnumber, doc = 'returns bugnumber of a bug report')
-
- def get_reporter(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- reporter = LateBindingProperty(get_reporter, doc = 'returns reporter of a bugreport')
-
- def get_date(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- date_reported = date = LateBindingProperty(get_date, doc = 'returns date of a bugreport')
-
- def get_text(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- text = LateBindingProperty(get_text, doc = 'returns raw text of a bugreport (.description & .comments.text)')
-
- def get_activity(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- activity = LateBindingProperty(get_activity, doc = 'parses the activity log')
-
- def get_duplicates(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- duplicates = LateBindingProperty(get_duplicates, doc = 'returns a set of duplicates')
-
- def get_description_raw(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- description_raw = LateBindingProperty(get_description_raw, doc = 'returns description in raw format')
-
- def get_title(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_title(self, title):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- summary = title = LateBindingProperty(get_title, set_title, doc = 'returns title of a bugreport')
-
- def get_description(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_description(self, description):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- description = LateBindingProperty(get_description, set_description, doc = 'description of a bugreport')
-
- def get_tags(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- tags = LateBindingProperty(get_tags, doc = 'tags of a bugreport')
-
- def get_nickname(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_nickname(self, nickname):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- nickname = LateBindingProperty(get_nickname, set_nickname, doc = 'nickname of a bugreport')
-
- def get_infotable(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- infotable = LateBindingProperty(get_infotable, doc = 'returns the infotable of a bugreport')
-
- def get_info(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- info = LateBindingProperty(get_info, doc = 'returns the infotable of a bugreport')
-
- def get_target(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_target(self, target):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- target = LateBindingProperty(get_target, set_target, doc = 'returns target of a bugreport')
-
- def get_importance(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_importance(self, importance):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- importance = LateBindingProperty(get_importance, set_importance, doc = 'returns importance of a bugreport')
-
- def get_status(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_status(self, status):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- status = LateBindingProperty(get_status, set_status, doc = 'returns status of a bugreport')
-
- def get_milestone(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_milestone(self, milestone):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- milestone = LateBindingProperty(get_milestone, set_milestone, doc = 'returns milestone of a bugreport')
-
- def get_assignee(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_assignee(self, lplogin):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- assignee = LateBindingProperty(get_assignee, set_assignee, doc = 'returns assignee of a bugreport')
-
- def get_sourcepackage(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_sourcepackage(self, target):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- sourcepackage = LateBindingProperty(get_sourcepackage, set_sourcepackage, doc = 'sourcepackage of a bugreport')
-
- def get_affects(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- affects = LateBindingProperty(get_affects, doc = 'affected product of a bugreport')
-
- def get_duplicates(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- duplicates = LateBindingProperty(get_duplicates, doc = 'returns duplicates of a bugreport')
-
- def get_duplicate(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_duplicate(self, bugnumber):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- duplicate_of = LateBindingProperty(get_duplicate, set_duplicate, doc = 'mark this bug as duplicate of another')
-
- def get_security(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_security(self, value):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- security = LateBindingProperty(get_security, set_security, doc = 'returns security of a bugreport')
-
- def get_private(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_private(self, value):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- private = LateBindingProperty(get_private, set_private, doc = 'returns private of a bugreport')
-
- def get_subscriptions(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def set_subscriptions(self, lplogin):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- subscribtions = subscriptions = subscribers = LateBindingProperty(get_subscriptions, set_subscriptions, doc = 'returns subscriptions to a bugreport')
-
- def get_subscriptions_category(self, type):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
-
- def get_comments(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- comments = LateBindingProperty(get_comments, doc = 'returns a list of comments of a bugreport')
-
- def get_attachments(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- attachments = LateBindingProperty(get_attachments, doc = 'returns a list of attachments of a bugreport')
-
- def get_mentors(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- mentors = LateBindingProperty(get_mentors, doc = 'returns mentoring information')
-
- def get_date_updated(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- date_updated = LateBindingProperty(get_date_updated, doc = 'returns date when bugreport was updated')
-
- def get_branches(self):
- raise NotImplementedError, 'this method must be implemented by a concrete subclass'
-
- branches = LateBindingProperty(get_branches, doc = 'returns list of attached bzr branches')
-
-