checking backup system, its not that bad after all
This commit is contained in:
parent
df8a6d3905
commit
079f143abc
6 changed files with 90 additions and 10 deletions
|
|
@ -7,6 +7,7 @@ from turbogears.database import PackageHub
|
|||
import turbogears
|
||||
import re
|
||||
from urllib import quote, quote_plus
|
||||
import urllib2
|
||||
import os
|
||||
from os.path import abspath, join, dirname, exists
|
||||
from datetime import datetime
|
||||
|
|
@ -34,6 +35,7 @@ def debug(string):
|
|||
hub = PackageHub('oxdbarchive')
|
||||
__connection__ = hub
|
||||
|
||||
|
||||
class Archive(SQLObject):
|
||||
name = UnicodeCol(length=255, alternateID=True)
|
||||
basePath = UnicodeCol()
|
||||
|
|
@ -52,7 +54,16 @@ class Archive(SQLObject):
|
|||
socket.setdefaulttimeout(256)
|
||||
url = "%s/%s?md5sum=%s" % (self.baseUrlFrontend, action, md5sum)
|
||||
#print url
|
||||
result = read_url(url)
|
||||
try:
|
||||
result = read_url(url)
|
||||
except urllib2.HTTPError, e:
|
||||
print e.code
|
||||
print e.read()
|
||||
raise
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
raise
|
||||
#print "Frontend:", result['result']
|
||||
socket.setdefaulttimeout(dto)
|
||||
|
||||
|
|
@ -102,7 +113,7 @@ class Archive(SQLObject):
|
|||
#just a new md5? happens for srt files quite often
|
||||
qq = ArchiveFile.select(AND(
|
||||
ArchiveFile.q.archiveID == self.id,
|
||||
ArchiveFile.q.path == params['path'],
|
||||
ArchiveFile.q.path == params['path'].encode('utf-8'),
|
||||
))
|
||||
f = None
|
||||
if qq.count() == 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue