def download(self, contrib, contrib_cache): # get external revision nr externalRevision = "" if True: # enable version check since sf.net ViewVC is back again (20aug08) try: externalRevision = self.getRevision(contrib) except IOError: print >> sys.stderr, "Could not connect to the internet." return (False, -1) # get local revision nr revisionFile = os.path.join(contrib_cache.replace("\ ", " "), contrib, "revision.txt") if os.path.exists(revisionFile): rev = open(revisionFile).readline() if rev == externalRevision: # we're up-to-date return (False, rev) else: # clear for download shutil.rmtree(os.path.dirname(revisionFile)) dloader = Wget() url = "http://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/trunk/qooxdoo-contrib/%s/" % contrib # Wget cannot currently handle 'https' scheme dloader.wget(url, os.path.join(contrib_cache,contrib), {'recursive':True}) # store new revision nr open(revisionFile, "w").write(externalRevision) return (True, externalRevision)
def download(self, contrib, contrib_cache): # get external revision nr externalRevision = "" if True: # enable version check since sf.net ViewVC is back again (20aug08) try: externalRevision = self.getRevision(contrib) except IOError: print >> sys.stderr, "Could not conncet to the internet. Will use cached contributions." return # get local revision nr revisionFile = os.path.join(contrib_cache.replace("\ ", " "), contrib, "revision.txt") if os.path.exists(revisionFile): rev = open(revisionFile).readline() if rev == externalRevision: # we're up-to-date return else: # clear for download shutil.rmtree(os.path.dirname(revisionFile)) dloader = Wget() url = "http://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/trunk/qooxdoo-contrib/%s/" % contrib # Wget cannot currently handle 'https' scheme dloader.wget(url, os.path.join(contrib_cache, contrib), {'recursive': True}) # store new revision nr open(revisionFile, "w").write(externalRevision) return
def download(self, contrib, contrib_cache): cName, cBranch = contrib.split('/', 1) # get external revision nr externalRevision = "" if True: # enable version check since sf.net ViewVC is back again (20aug08) try: externalRevision = self.getRevision(cName, cBranch) except IOError: print >> sys.stderr, "Could not connect to the internet." return (False, -1) if not externalRevision: print >> sys.stderr, "Could not determine current revision of \"%s\"" % contrib return (False, -1) # get local revision nr revisionFile = os.path.join(contrib_cache.replace("\ ", " "), contrib, "revision.txt") if os.path.exists(revisionFile): rev = open(revisionFile).readline() if rev == externalRevision: # we're up-to-date return (False, rev) else: # clear for download shutil.rmtree(os.path.dirname(revisionFile)) dloader = Wget() #url = "http://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/trunk/qooxdoo-contrib/%s/" % contrib # Wget cannot currently handle 'https' scheme url = self.svn_url_schema % { 'project': self.project, 'cName': cName, 'cBranch': cBranch } dloader.wget(url, os.path.join(contrib_cache, contrib), {'recursive': True}) # store new revision nr open(revisionFile, "w").write(externalRevision) return (True, externalRevision)
def sf_spider(self, url, cache_path): dloader = Wget() rc = dloader.wget(url, cache_path, {'recursive': True}) return rc
def sf_spider(self, url, cache_path): dloader = Wget() rc = dloader.wget(url, cache_path, {'recursive':True}) return rc