Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(1)  |  Derive(0)  |  Import(7)

src/s/n/sneakernet-HEAD/appengine/cachetalk.py   sneakernet(Download)
  def get(self):
    from cache import can_operate_on, ContentCopy, get_cache_by_name, Cache, TYPE_COMPUTER
    from user_sn import confirm
    u = confirm(self)
    cname = self.request.get("cache")
  def post(self):
    from user_sn import confirm
    from cache import can_operate_on, get_copy, ContentCopy, get_cache_by_name, TYPE_COMPUTER, TYPE_EXTERN_FD, TYPE_LOCAL_FD, TYPE_EXTERNAL_RING
    from Content import content_by_id
    u = confirm(self)
            logging.info("Closing %s" % rc.key())
            rc.delete()
        co = ContentCopy(where = c,content=content)
        if co.content is None:
            logging.warning("Not adding %s" % item)

src/s/n/sneakernet-HEAD/appengine/run.py   sneakernet(Download)
def find_a_cache_to_get(u):
    #we should prioritize in terms of what gets things off the network the fastest
    from cache import TYPE_EXTERN_FD, TYPE_LOCAL_FD, TYPE_EXTERNAL_RING, is_cache_available_now, ContentCopy, Cache
    from request import RequestCopy
    teamcaches = team_caches(u)
    def fulfill(self,cache):
        from request import RequestCopy
        from cache import TYPE_EXTERN_FD, ContentCopy, get_copy
        fulfill_swap_requests = RequestCopy.all().filter("dest =",cache.permanent_location.team_responsible).filter("dest_int =",TYPE_EXTERN_FD).fetch(limit=1000)
        for request in fulfill_swap_requests:

src/s/n/sneakernet-HEAD/appengine/purge.py   sneakernet(Download)
def can_purge(user,contentcopy):
    from cache import ContentCopy, TYPE_COMPUTER
    allCopies = ContentCopy.all().filter("content =",contentcopy.content).fetch(limit = 1000) #now fetch all the copies
    allCopies = filter(available_soon_cc,allCopies) #only the ones that are online
    if len(allCopies) > LEAVE_COPIES_ON_DARKNET+1:
  def get(self):
    from user_sn import confirm
    u = confirm(self)
    from cache import get_cache_by_name, can_operate_on, ContentCopy
    from Content import content_by_id

src/s/n/sneakernet-HEAD/appengine/request.py   sneakernet(Download)
def copies_that_can_fulfill(request):
    from cache import ContentCopy
    return ContentCopy.all().filter("content =",request.file).fetch(limit=1000)