Changeset 4236
- Timestamp:
- 07/04/2008 05:06:29 PM (2 months ago)
- Files:
-
- trunk/dabo/dApp.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/dApp.py
r4234 r4236 623 623 return 624 624 u2 = urllib2 625 # os.path.join works great for this; just make sure that the 625 # os.path.join works great for this; just make sure that any Windows 626 # paths are converted to forward slashes, and that the 626 627 # pth value doesn't begin with a slash 627 url = os.path.join(self.SourceURL, pth.lstrip("/")) 628 pth = pth.lstrip(os.path.sep) 629 urlparts = base.split(os.path.sep) + pth.split(os.path.sep) 630 url = "/".join(urlparts) 628 631 req = u2.Request(url) 629 632 lastmod = self._sourceLastModified.get(url) … … 631 634 if lastmod: 632 635 req.add_header("If-Modified-Since", lastmod) 636 elif os.path.exists(pth): 637 modTime = datetime.datetime.fromtimestamp(os.stat(pth)[8]) 638 req.add_header("If-Modified-Since", dabo.lib.dates.webHeaderFormat(modTime)) 633 639 try: 634 640 resp = u2.urlopen(req) … … 647 653 if newFile: 648 654 file(pth, "w").write(newFile) 655 dabo.infoLog.write(_("File %s updated") % pth) 649 656 650 657
