소스 검색

Fix origin stuff.

tags/v1.0^2
Ben Kurtovic 10 년 전
부모
커밋
28d07de930
2개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. +3
    -3
      bitshift/codelet.py
  2. +1
    -2
      bitshift/database/__init__.py

+ 3
- 3
bitshift/codelet.py 파일 보기

@@ -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 파일 보기

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


불러오는 중...
취소
저장