~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to UpdateManager/Common/utils.py

  • Committer: Michael Vogt
  • Date: 2009-01-26 17:25:04 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090126172504-7fi0vbawq62kcnuc
UpdateManager/Common/utils.py: it url_downloadable more robust

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
  (scheme, netloc, path, querry, fragment) = urlparse.urlsplit(uri)
73
73
  if scheme == "http":
74
74
    import httplib
75
 
    c = httplib.HTTPConnection(netloc)
76
75
    try:
 
76
      c = httplib.HTTPConnection(netloc)
77
77
      c.request("HEAD", path)
78
78
      res = c.getresponse()
79
79
      if debug_func:
87
87
    return False
88
88
  elif scheme == "ftp":
89
89
    import ftplib
90
 
    f = ftplib.FTP(netloc)
91
 
    f.login()
92
90
    try:
 
91
      f = ftplib.FTP(netloc)
 
92
      f.login()
93
93
      f.cwd(os.path.dirname(path))
94
94
      size = f.size(os.path.basename(path))
95
95
      f.quit()