Merge lp:~elachuni/wsgi-oops/no-more-twisted into lp:wsgi-oops

Proposed by Anthony Lenton
Status: Merged
Approved by: Eric Casteleijn
Approved revision: not available
Merged at revision: 50
Proposed branch: lp:~elachuni/wsgi-oops/no-more-twisted
Merge into: lp:wsgi-oops
Diff against target: 27 lines (+15/-2)
1 file modified
canonical/oops/oops.py (+15/-2)
To merge this branch: bzr merge lp:~elachuni/wsgi-oops/no-more-twisted
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Rick McBride (community) Approve
Review via email: mp+19442@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Anthony Lenton (elachuni) wrote :

This branch removes the dependency on twisted by providing our own unsignedID.

The code is taken literally from twisted so it should be completely backwards compatible, not need new tests or break existing ones.

Revision history for this message
Rick McBride (rmcbride) wrote :

Cool! you had me from the words "No More Twisted"

tests pass with the code checked into tree.

review: Approve
Revision history for this message
Elliot Murphy (statik) wrote :

On Tue, Feb 16, 2010 at 4:01 PM, Anthony Lenton
<email address hidden> wrote:
> The code is taken literally from twisted so it should be completely backwards compatible, not need new tests or break existing ones.

What does this mean for copyright? Who has copyright on the code that
was added? Or did you just re-implement this simple function yourself,
and the way that twisted had done it was the obvious way to write the
code?

I ask because I think Canonical requires that we maintain 100%
copyright over projects where we are the primary authors, so I want to
be careful about introducing code that is not accompanied by a
copyright assignment.
--
Elliot Murphy | https://launchpad.net/~statik/

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Awesome!

review: Approve
Revision history for this message
Anthony Lenton (elachuni) wrote :

> On Tue, Feb 16, 2010 at 4:01 PM, Elliot Murphy wrote:
> <email address hidden> wrote:
> > The code is taken literally from twisted so it should be completely
> backwards compatible, not need new tests or break existing ones.
>
> What does this mean for copyright? Who has copyright on the code that
> was added? Or did you just re-implement this simple function yourself,
> and the way that twisted had done it was the obvious way to write the
> code?

This branch just copied the function over, docstrings, comments and all. The only clear advantage of this way was that it would be real easy to convince people that it doesn't break any tests; we could reimplement it quickly, inline it or rewrite it as a lambda.

Let me know if we'd need to change the code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'canonical/oops/oops.py'
2--- canonical/oops/oops.py 2009-09-18 18:21:21 +0000
3+++ canonical/oops/oops.py 2010-02-16 21:01:11 +0000
4@@ -24,8 +24,21 @@
5 import sys
6 import StringIO
7
8-from twisted.python.util import unsignedID
9-
10+# Taken from twisted.python.util.
11+#
12+# A value about twice as large as any Python int, to which negative values
13+# from id() will be added, moving them into a range which should begin just
14+# above where positive values from id() leave off.
15+_HUGEINT = (sys.maxint + 1L) * 2L
16+def unsignedID(obj):
17+ """
18+ Return the id of an object as an unsigned number so that its hex
19+ representation makes sense
20+ """
21+ rval = id(obj)
22+ if rval < 0:
23+ rval += _HUGEINT
24+ return rval
25
26 class OOPSEntryError(Exception):
27 """Raised when the entry_name added already exists in the OOPS."""

Subscribers

People subscribed via source and target branches