| criswellious@246 | 1 | # Copyright 2007 Sam Hart
|
| criswellious@246 | 2 | #
|
| criswellious@246 | 3 | # This program is free software; you can redistribute it and/or modify
|
| criswellious@246 | 4 | # it under the terms of the GNU General Public License as published by
|
| criswellious@246 | 5 | # the Free Software Foundation; either version 2 of the License, or
|
| criswellious@246 | 6 | # (at your option) any later version.
|
| criswellious@246 | 7 | #
|
| criswellious@246 | 8 | # This program is distributed in the hope that it will be useful,
|
| criswellious@246 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| criswellious@246 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| criswellious@246 | 11 | # GNU General Public License for more details.
|
| criswellious@246 | 12 | #
|
| criswellious@246 | 13 | # You should have received a copy of the GNU General Public License
|
| criswellious@246 | 14 | # along with this program; if not, write to the Free Software
|
| criswellious@246 | 15 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| criswellious@246 | 16 | #
|
| criswellious@246 | 17 | # Author: Sam Hart
|
| criswellious@246 | 18 |
|
| criswellious@246 | 19 | """
|
| criswellious@246 | 20 | Swarm Data Objects
|
| criswellious@246 | 21 |
|
| criswellious@246 | 22 | Contains all of the data objects defined and used by Swarm.
|
| criswellious@246 | 23 | """
|
| criswellious@246 | 24 |
|
| criswellious@246 | 25 | #from sqlalchemy.orm import mapper, relation, backref
|
| criswellious@246 | 26 |
|
| criswellious@246 | 27 | #import swarmlib.db.schema as schema
|
| criswellious@246 | 28 |
|
| criswellious@246 | 29 | class Issue(object):
|
| criswellious@246 | 30 | def __init__(self, hash_id, short_hash_id):
|
| criswellious@265 | 31 | self.issue_id = short_hash_id
|
| criswellious@246 | 32 | self.hash_id = hash_id
|
| criswellious@246 | 33 | def __repr__(self):
|
| criswellious@246 | 34 | return "<Issue('%s', '%s')>" % (self.hash_id, self.short_hash_id)
|
| criswellious@246 | 35 |
|
| criswellious@246 | 36 | class Node(object):
|
| criswellious@246 | 37 | def __init__(self, hash_id, summary):
|
| criswellious@246 | 38 | self.hash_id = hash_id
|
| criswellious@246 | 39 | self.summary = summary
|
| criswellious@246 | 40 | def __repr__(self):
|
| criswellious@246 | 41 | return "<Node('%s', '%s')>" % (self.hash_id, self.summary)
|
| criswellious@246 | 42 |
|
| criswellious@246 | 43 | class TransactionEntry(object):
|
| criswellious@246 | 44 | def __init__(self, root, time, transaction, transaction_data):
|
| criswellious@246 | 45 | self.root = root
|
| criswellious@246 | 46 | self.time = time
|
| criswellious@246 | 47 | self.transaction = transaction
|
| criswellious@246 | 48 | self.transaction_log = transaction_log
|
| criswellious@246 | 49 |
|
| criswellious@246 | 50 | def __repr__(self):
|
| criswellious@246 | 51 | return "<TransactionEntry(root:'%s', time:'%s'>" % (self.root,
|
| criswellious@246 | 52 | self.time)
|
| criswellious@246 | 53 |
|
| criswellious@246 | 54 | class ComponentEntry(object):
|
| criswellious@246 | 55 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 56 | self.name = name
|
| criswellious@246 | 57 | self.isdefault = isdefault
|
| criswellious@246 | 58 |
|
| criswellious@246 | 59 | def __repr__(self):
|
| criswellious@246 | 60 | return "<ComponentEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 61 | self.isdefault)
|
| criswellious@246 | 62 |
|
| criswellious@246 | 63 | class VersionEntry(object):
|
| criswellious@246 | 64 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 65 | self.name = name
|
| criswellious@246 | 66 | self.isdefault = isdefault
|
| criswellious@246 | 67 |
|
| criswellious@246 | 68 | def __repr__(self):
|
| criswellious@246 | 69 | return "<VersionEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 70 | self.isdefault)
|
| criswellious@246 | 71 |
|
| criswellious@246 | 72 | class MilestoneEntry(object):
|
| criswellious@246 | 73 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 74 | self.name = name
|
| criswellious@246 | 75 | self.isdefault = isdefault
|
| criswellious@246 | 76 |
|
| criswellious@246 | 77 | def __repr__(self):
|
| criswellious@246 | 78 | return "<MilestoneEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 79 | self.isdefault)
|
| criswellious@246 | 80 |
|
| criswellious@246 | 81 | class SeverityEntry(object):
|
| criswellious@246 | 82 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 83 | self.name = name
|
| criswellious@246 | 84 | self.isdefault = isdefault
|
| criswellious@246 | 85 |
|
| criswellious@246 | 86 | def __repr__(self):
|
| criswellious@246 | 87 | return "<SeverityEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 88 | self.isdefault)
|
| criswellious@246 | 89 |
|
| criswellious@246 | 90 | class PriorityEntry(object):
|
| criswellious@246 | 91 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 92 | self.name = name
|
| criswellious@246 | 93 | self.isdefault = isdefault
|
| criswellious@246 | 94 |
|
| criswellious@246 | 95 | def __repr__(self):
|
| criswellious@246 | 96 | return "<PriorityEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 97 | self.isdefault)
|
| criswellious@246 | 98 |
|
| criswellious@246 | 99 | class StatusEntry(object):
|
| criswellious@246 | 100 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 101 | self.name = name
|
| criswellious@246 | 102 | self.isdefault = isdefault
|
| criswellious@246 | 103 |
|
| criswellious@246 | 104 | def __repr__(self):
|
| criswellious@246 | 105 | return "<StatusEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 106 | self.isdefault)
|
| criswellious@246 | 107 |
|
| criswellious@246 | 108 | class ResolutionEntry(object):
|
| criswellious@246 | 109 | def __init__(self, name, isdefault=False):
|
| criswellious@246 | 110 | self.name = name
|
| criswellious@246 | 111 | self.isdefault = isdefault
|
| criswellious@246 | 112 |
|
| criswellious@246 | 113 | def __repr__(self):
|
| criswellious@246 | 114 | return "<ResolutionEntry('%s', default:'%s')>" % (self.name,
|
| criswellious@246 | 115 | self.isdefault)
|
| criswellious@246 | 116 |
|
| criswellious@246 | 117 | class Upstream(object):
|
| criswellious@246 | 118 | def __init__(self, uri, upstream_type, authentication, transport):
|
| criswellious@246 | 119 | self.uri = uri
|
| criswellious@246 | 120 | self.upstream_type = upstream_type
|
| criswellious@246 | 121 | self.authentication = authentication
|
| criswellious@246 | 122 | self.transport = transport
|
| criswellious@246 | 123 |
|
| criswellious@246 | 124 | def __repr__(self):
|
| criswellious@246 | 125 | return "<Upstream('%s')>" % self.uri
|