def findFiles(opts): cmd = ["/usr/bin/find"] cmd += picSubDirs(quick=opts.quick) cmd += "-regextype posix-egrep -name .xvpics -prune -type f -o".split() exts = videoExtensions if opts.video else (imageExtensions + videoExtensions) cmd += ['(', '-iregex', r'.*\.(%s)' % '|'.join(e.strip('.') for e in exts), ')'] log.debug(repr(cmd)) files = [f.strip() for f in subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].splitlines()] if opts.pat: log.info("found %s files, reducing to pattern", len(files)) files = [f for f in files if opts.pat in f] return files
def findFiles(opts): cmd = ["/usr/bin/find"] cmd += picSubDirs(quick=opts.quick) cmd += "-regextype posix-egrep -name .xvpics -prune -type f -o".split() exts = videoExtensions if opts.video else (imageExtensions + videoExtensions) cmd += [ '(', '-iregex', r'.*\.(%s)' % '|'.join(e.strip('.') for e in exts), ')' ] log.debug(repr(cmd)) files = [ f.strip() for f in subprocess.Popen( cmd, stdout=subprocess.PIPE).communicate()[0].splitlines() ] if opts.pat: log.info("found %s files, reducing to pattern", len(files)) files = [f for f in files if opts.pat in f] return files
mr.videoProgress() # todo: freshen thumbs here too? that should be on a lower # priority queue than getting the exif/file data v2.imageset.client.changed(picUri) quick = False graph = getGraph() scanFs = ScanFs(graph, '/my/pic') scanExif = ScanExif(graph) syncs = {} subdirs = picSubDirs( syncs, SesameSync, graph, quick) # root directories for fileschanged to watch underneath if quick: onChange('/my/site/photo/input/local.n3') onChange('/my/pic/flickr/3716645105_27bca1ba5a_o.jpg') onChange('/my/pic/phonecam/dt-2009-07-16/CIMG0074.jpg') onChange('/my/pic/digicam/dl-2009-07-20/DSC_0092.JPG') import httplib, cgi class PrettyErrorHandler(object): """ mix-in to improve cyclone.web.RequestHandler """
scanExif.addPic(picUri, rerunScans=True) mr = MediaResource(graph, picUri) if mr.isVideo(): mr.videoProgress() # todo: freshen thumbs here too? that should be on a lower # priority queue than getting the exif/file data quick = False graph = getGraph() scanFs = ScanFs(graph, '/my/pic') scanExif = ScanExif(graph) syncs = {} subdirs = picSubDirs(syncs, SesameSync, graph, quick) # root directories for fileschanged to watch underneath if quick: onChange('/my/site/photo/input/local.n3') onChange('/my/pic/flickr/3716645105_27bca1ba5a_o.jpg') onChange('/my/pic/phonecam/dt-2009-07-16/CIMG0074.jpg') onChange('/my/pic/digicam/dl-2009-07-20/DSC_0092.JPG') import httplib, cgi class PrettyErrorHandler(object): """ mix-in to improve cyclone.web.RequestHandler """ def get_error_html(self, status_code, **kwargs): try: tb = kwargs['exception'].getTraceback()