Пример #1
0
  def __init__(self, base_url, owner, repo, object_store_creator, Fetcher):
    self._repo_key = '%s/%s' % (owner, repo)
    self._repo_url = '%s/%s/%s' % (base_url, owner, repo)

    self._blobstore = blobstore.AppEngineBlobstore()
    # Lookup the chrome github api credentials.
    self._username, self._password = _LoadCredentials(object_store_creator)
    self._fetcher = Fetcher(self._repo_url)

    self._stat_cache = object_store_creator.Create(
        GithubFileSystem, category='stat-cache')

    self._repo_zip = Future(value=None)
  def __init__(self, base_url, owner, repo, object_store_creator, Fetcher):
    self._repo_key = posixpath.join(owner, repo)
    self._repo_url = posixpath.join(base_url, owner, repo)
    self._username, self._password = _LoadCredentials(object_store_creator)
    self._blobstore = blobstore.AppEngineBlobstore()
    self._fetcher = Fetcher(self._repo_url)
    # Stores whether the github is up to date. This will either be True or
    # empty, the emptiness most likely due to this being a cron run.
    self._up_to_date_cache = object_store_creator.Create(
        GithubFileSystem, category='up-to-date')
    # Caches the zip file's stat. Overrides start_empty=False and use
    # |self._up_to_date_cache| to determine whether we need to refresh.
    self._stat_cache = object_store_creator.Create(
        GithubFileSystem, category='stat-cache', start_empty=False)

    # Created lazily in |_EnsureRepoZip|.
    self._repo_zip = None
Пример #3
0
 def CreateChromeAppsSamples(object_store_creator):
   return GithubFileSystem(
       '%s/GoogleChrome/chrome-app-samples' % url_constants.GITHUB_REPOS,
       blobstore.AppEngineBlobstore(),
       object_store_creator)
Пример #4
0
 def Create(object_store_creator):
     return GithubFileSystem(url_constants.GITHUB_URL,
                             blobstore.AppEngineBlobstore(),
                             object_store_creator)