Browse Source

Fix origin stuff.

tags/v1.0^2
Ben Kurtovic 10 years ago
parent
commit
28d07de930
2 changed files with 4 additions and 5 deletions
  1. +3
    -3
      bitshift/codelet.py
  2. +1
    -2
      bitshift/database/__init__.py

+ 3
- 3
bitshift/codelet.py View File

@@ -28,8 +28,8 @@ class Codelet(object):
per available ratings (stars, forks, upvotes, etc.).
:ivar symbols: (dict) Dictionary containing dictionaries of functions,
classes, variable definitions, etc.
:ivar origin: (tuple) 3-tuple of (site_name, site_url, image_blob), as
added by the database.
:ivar origin: (tuple) 2-tuple of (site_name, site_url), as added by the
database.
"""

def __init__(self, name, code, filename, language, authors, url,
@@ -72,7 +72,7 @@ class Codelet(object):
self.date_modified = date_modified
self.rank = rank
self.symbols = symbols or {}
self.origin = origin or (None, None, None)
self.origin = origin or (None, None)

def serialize(self):
"""


+ 1
- 2
bitshift/database/__init__.py View File

@@ -120,8 +120,7 @@ class Database(object):
url = row["origin_url_base"] + row["codelet_url"]
else:
url = row["codelet_url"]
origin = (row["origin_name"], row["origin_url"],
row["origin_image"])
origin = (row["origin_name"], row["origin_url"])
authors = self._get_authors_for_codelet(cursor, codelet_id)
symbols = self._get_symbols_for_code(cursor, code_id, tree)
yield Codelet(


Loading…
Cancel
Save