Selaa lähdekoodia

Fix origin stuff.

tags/v1.0^2
Ben Kurtovic 10 vuotta sitten
vanhempi
commit
28d07de930
2 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. +3
    -3
      bitshift/codelet.py
  2. +1
    -2
      bitshift/database/__init__.py

+ 3
- 3
bitshift/codelet.py Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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(


Ladataan…
Peruuta
Tallenna