Merge branch 'master' of git://git.assembla.com/fpdboz

Conflicts:

	pyfpdb/fpdb_import.py
This commit is contained in:
Ray 2008-11-05 05:59:08 -05:00
commit 2bc04ea17b
2 changed files with 9 additions and 8 deletions

View File

@ -56,7 +56,7 @@ class Site:
self.hudopacity = node.getAttribute("hudopacity") self.hudopacity = node.getAttribute("hudopacity")
self.hudbgcolor = node.getAttribute("bgcolor") self.hudbgcolor = node.getAttribute("bgcolor")
self.hudfgcolor = node.getAttribute("fgcolor") self.hudfgcolor = node.getAttribute("fgcolor")
self.converter = node.getAttribute("converter")
self.layout = {} self.layout = {}
for layout_node in node.getElementsByTagName('layout'): for layout_node in node.getElementsByTagName('layout'):

View File

@ -110,7 +110,7 @@ class Importer:
self.filelist = list(set(self.filelist)) self.filelist = list(set(self.filelist))
#Add a directory of files to filelist #Add a directory of files to filelist
def addImportDirectory(self,dir,monitor = False): def addImportDirectory(self,dir,monitor = False, filter = "passthrough"):
if os.path.isdir(dir): if os.path.isdir(dir):
if monitor == True: if monitor == True:
self.monitor = True self.monitor = True
@ -146,14 +146,15 @@ class Importer:
stat_info = os.stat(file) stat_info = os.stat(file)
try: try:
lastupdate = self.updated[file] lastupdate = self.updated[file]
# print "Is " + str(stat_info.st_mtime) + " > " + str(lastupdate) if stat_info.st_mtime > lastupdate:
#if stat_info.st_mtime > lastupdate:
if stat_info.st_size > lastupdate:
self.import_file_dict(file) self.import_file_dict(file)
self.updated[file] = stat_info.st_size self.updated[file] = time()
except: except:
# print "Adding " + str(file) + " at approx " + str(time()) self.updated[file] = time()
self.updated[file] = 0 # This codepath only runs first time the file is found, if modified in the last
# minute run an immediate import.
if (time() - stat_info.st_mtime) < 60:
self.import_file_dict(file)
# This is now an internal function that should not be called directly. # This is now an internal function that should not be called directly.
def import_file_dict(self, file): def import_file_dict(self, file):