소스 검색

Fixes.

tags/v1.0^2
Ben Kurtovic 10 년 전
부모
커밋
f02dc4497c
2개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. +7
    -7
      bitshift/crawler/indexer.py
  2. +1
    -1
      bitshift/parser/__init__.py

+ 7
- 7
bitshift/crawler/indexer.py 파일 보기

@@ -7,7 +7,7 @@ import bs4, datetime, logging, os, Queue, re, shutil, string, subprocess, time,\
threading

from ..database import Database
from ..parser import parse
from ..parser import parse, UnsupportedFileError
from ..codelet import Codelet

GIT_CLONE_DIR = "/tmp/bitshift"
@@ -151,11 +151,11 @@ class GitIndexer(threading.Thread):
source = self._decode(source_file.read())
if source is None:
continue
except IOError as exception:
except IOError:
continue

authors = [(self._decode(author), None) for author in \
commits_meta[filename]["authors"]]
authors = [(self._decode(author), None) for author in
commits_meta[filename]["authors"]]
codelet = Codelet("%s:%s" % (repo.name, filename), source, filename,
None, authors, self._generate_file_url(filename,
repo.url, repo.framework_name),
@@ -164,9 +164,9 @@ class GitIndexer(threading.Thread):
repo.rank)
try:
parse(codelet)
self.database.insert(codelet)
except UnsupportedFileError as excep:
pass
except UnsupportedFileError:
continue
self.database.insert(codelet)

def _generate_file_url(self, filename, repo_url, framework_name):
"""


+ 1
- 1
bitshift/parser/__init__.py 파일 보기

@@ -8,7 +8,7 @@ from pygments import lexers as pgl, util
from ..languages import LANGS
from .python import parse_py

_all__ = ["parse"]
_all__ = ["parse", "UnsupportedFileError"]

class UnsupportedFileError(Exception):
pass


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