def __init__(self):
self._cwd = u'.'
self._tree = []
- self._basepath = re.compile('[/\w\._-]*/\w+',re.UNICODE)
+ self._basepath = re.compile('[/\w\._-]*/[\w-]+',re.UNICODE)
def scan(self):
for dirname, dirnames, filenames in os.walk(self._cwd):
print "WARNING: File "+im+" is missing!"
return res
+ def collect_videos(self):
+ res = []
+ for i in self._doc.xpath(u"//db:videodata[@fileref]",namespaces=const.XPATH):
+ im = os.path.join(self._dirname,i.get('fileref'))
+ if os.path.isfile(im):
+ res.append(im)
+ else:
+ print "WARNING: File "+im+" is missing!"
+ return res
+
def collect_forms(self):
res = []
for i in self._doc.xpath(u"//html:form[@action]",namespaces=const.XPATH):
self._doc.parse_xincludes()
doc = self._doc.collect_links()
img = self._doc.collect_images()
+ vid = self._doc.collect_videos()
form= self._doc.collect_forms()
- self._resources = doc + img + form
+ self._resources = doc + img + vid + form
def render(self, transform):
self._rendered_article = self._doc.xslt(transform['xhtml5'])
else: raise
def publish(src,target):
- cmd = ["rsync","-a","--delete",src,target]
+ cmd = ["rsync","-a","--delete","--partial",src,target]
retcode = subprocess.call(cmd)
if retcode:
error('%s : retruncode %s' % (' '.join(cmd),str(retcode)))