[Zope3-checkins] CVS: Products3/z3checkins - branch.png:1.1 product.png:1.1 zope3.png:1.1 configure.zcml:1.3 container.pt:1.3 interfaces.py:1.3 message.py:1.5 message_part.pt:1.3
Marius Gedminas
mgedmin@codeworks.lt
Tue, 8 Apr 2003 13:35:11 -0400
Update of /cvs-repository/Products3/z3checkins
In directory cvs.zope.org:/tmp/cvs-serv26556
Modified Files:
configure.zcml container.pt interfaces.py message.py
message_part.pt
Added Files:
branch.png product.png zope3.png
Log Message:
Added icons to visually distinguish checkins into core code and other products,
and also to identify checkins made to branches.
=== Added File Products3/z3checkins/branch.png ===
<Binary-ish file>
=== Added File Products3/z3checkins/product.png ===
<Binary-ish file>
=== Added File Products3/z3checkins/zope3.png ===
<Binary-ish file>
=== Products3/z3checkins/configure.zcml 1.2 => 1.3 ===
--- Products3/z3checkins/configure.zcml:1.2 Thu Apr 3 07:08:24 2003
+++ Products3/z3checkins/configure.zcml Tue Apr 8 13:35:10 2003
@@ -66,6 +66,7 @@
for=".interfaces.ICheckinMessage"
name="html"
template="message_part.pt"
+ class=".message.CheckinMessageView"
permission="zope.View" />
<browser:page
@@ -95,5 +96,11 @@
template="container.pt"
class=".message.ContainerView"
permission="zope.View" />
+
+<!-- Resources -->
+
+ <browser:resource name="zope3.png" file="zope3.png" />
+ <browser:resource name="product.png" file="product.png" />
+ <browser:resource name="branch.png" file="branch.png" />
</zopeConfigure>
=== Products3/z3checkins/container.pt 1.2 => 1.3 ===
--- Products3/z3checkins/container.pt:1.2 Thu Apr 3 07:48:48 2003
+++ Products3/z3checkins/container.pt Tue Apr 8 13:35:10 2003
@@ -13,6 +13,7 @@
.author { font-weight: bold; }
a.title { display: block; width: 100%; }
a:hover { background: #e0e6ff; }
+ img.icon { float: right; padding: 0ex; margin: 2px; border: none; }
</style>
</head>
<body>
=== Products3/z3checkins/interfaces.py 1.2 => 1.3 ===
--- Products3/z3checkins/interfaces.py:1.2 Thu Apr 3 07:08:24 2003
+++ Products3/z3checkins/interfaces.py Tue Apr 8 13:35:10 2003
@@ -13,6 +13,7 @@
author_email = Attribute("Author's email address")
subject = Attribute("Subject line of the checking message")
directory = Attribute("Directory that was updated")
+ branch = Attribute("Branch tag if this was commited to a branch")
log_message = Attribute("Checkin log message")
date = Attribute("Date and time of the checkin")
body = Attribute("Body of the message")
=== Products3/z3checkins/message.py 1.4 => 1.5 ===
--- Products3/z3checkins/message.py:1.4 Thu Apr 3 07:48:48 2003
+++ Products3/z3checkins/message.py Tue Apr 8 13:35:10 2003
@@ -96,7 +96,7 @@
def __init__(self, message_id=None, author=None, author_name=None,
author_email=None, subject=None, date=None, directory=None,
- log_message=None, body=None):
+ log_message=None, body=None, branch=None):
self.message_id = message_id
self.author = author
self.author_name = author_name
@@ -106,6 +106,19 @@
self.directory = directory
self.log_message = log_message
self.body = body
+ self.branch = branch
+
+ def __setstate__(self, state):
+ super(CheckinMessage, self).__setstate__(state)
+ if 'branch' not in state:
+ self.branch = None
+ log_idx = self.body.index("\nLog Message:")
+ if log_idx == -1:
+ log_idx = self.body.index("\nLog message:")
+ if log_idx != -1:
+ m = re.search("(?m)^ Tag: (.*)$", self.body[:log_idx])
+ if m:
+ self.branch = m.group(1)
def __cmp__(self, other):
"""Messages with the same message_id compare identical."""
@@ -144,16 +157,17 @@
tzinfo=FixedTimezone(tzoffset / 60))
m.rewindbody()
body_lines = input.readlines()
- log_message = self.extract_log(body_lines)
+ log_message, branch = self.extract_log(body_lines)
body = "".join(body_lines).strip()
return CheckinMessage(message_id=message_id, author=author,
author_name=author_name,
author_email=author_email, subject=subject,
date=date, directory=directory,
- log_message=log_message, body=body)
+ log_message=log_message, body=body, branch=branch)
def extract_log(self, lines):
log_message = []
+ branch = None
in_log_msg = 0
for line in lines:
if in_log_msg:
@@ -164,9 +178,11 @@
else:
if line.lower().startswith('log message:'):
in_log_msg = 1
+ elif line.startswith(' Tag: '):
+ branch = line[len(' Tag: '):].strip()
if not in_log_msg:
raise FormatError("Could not find log message")
- return "".join(log_message).strip()
+ return "".join(log_message).strip(), branch
class CheckinMessageAdapter:
@@ -290,6 +306,11 @@
return self._archive[-1]
else:
return None
+
+ def core(self):
+ """Returns True if this is a checkin to Zope 3 core, False if it is in
+ a different part of the repository."""
+ return self.context.directory.startswith("Zope3")
def body(self):
"""Colorizes checkin message body."""
=== Products3/z3checkins/message_part.pt 1.2 => 1.3 ===
--- Products3/z3checkins/message_part.pt:1.2 Thu Apr 3 07:48:48 2003
+++ Products3/z3checkins/message_part.pt Tue Apr 8 13:35:10 2003
@@ -1,4 +1,11 @@
<div class="message">
+<img tal:condition="view/core"
+ class="icon" src="/@@/zope3.png" alt="Z3" title="Zope 3 core"/>
+<img tal:condition="not: view/core"
+ class="icon" src="/@@/product.png" alt="Product" title="Zope 3 product"/>
+<img tal:condition="context/branch"
+ class="icon" src="/@@/branch.png" alt="Branch"
+ tal:attributes="title string:Branch: ${context/branch}"/>
<a target="_content" class="title" tal:attributes="href context/@@absolute_url">
<span class="date" tal:content="context/date/@@isodatetime" />:
<span class="author" tal:content="context/author_name" />