rd.update(title_group.encode('utf-8'))
rdl=rd.hexdigest()
for i in xrange(1,pagenum+1):
- cmd=u"pdftotext -eol unix -enc UTF-8 -f "+str(i)+u" -l "+str(i)+" \""+pdfpath+u"\" page-"+str(i)+dstpath
+ tmpdstpath="\""+cacheFolder+"page-"+str(i)+dstpath+"\""
+ cmd=u"pdftotext -eol unix -enc UTF-8 -f "+str(i)+u" -l "+str(i)+" \""+pdfpath+u"\" "+tmpdstpath
p=subprocess.Popen(cmd.encode("utf-8"),shell=True)
p.wait()
time.sleep(1)
- TEXT2solr(s,os.path.splitext(os.path.basename(pdfpath))[0],"page-"+str(i)+dstpath,i,pagenum,pdfpath,idnum)
+ TEXT2solr(s,os.path.splitext(os.path.basename(pdfpath))[0],tmpdstpath,i,pagenum,pdfpath,idnum)
generateCache(pdfpath.encode("utf-8"),os.path.splitext(os.path.basename(pdfpath))[0].encode("utf-8")+"_"+str(i),i)
- os.system("rm -f page-"+str(i)+dstpath)
+ os.system("rm -f "+tmpdstpath)
sql = u"insert into pdffile (id,path,page,title,title_id,part) values (?,?,?,?,?,?)"
dbcon.execute(sql,(idnum,pdfpath,pagenum,title_group,rdl,parttext))
s.commit()
#!/bin/bash
echo "Libre10 installer for Centos/fedora."
+echo "You need to uninstall python-lxml package and install latest lxml from easy_install."
+echo "Do you want to uninstall python-lxml before libre10 installation?[N/y]"
+read YN
+if $YN = "y" || $YN = 'Y' || $YN = 'yes' || $YN = 'YES'; then
+ yum remove python-lxml
echo "If you haven't enabled EPEL, you would better do it."
echo "You've already enabled EPEL?[Y/n]"
read YN
if $YN = 'N' || $YN = 'n' ; then
- yum install cpan jre java-1.6.0 GraphicsMagick libjpeg poppler-utils libyaml libyaml-devel libxml2-devel libxslt-devel libxml2 libxslt python-devel
- yum install python-setuptools
+ yum -y install cpan jre java-1.6.0 GraphicsMagick libjpeg poppler-utils libyaml libyaml-devel libxml2-devel libxslt-devel libxml2 libxslt python-devel
+ yum -y install python-setuptools
easy_install pysolr
easy_install lxml
- yum install PyYAML
+ yum -y install PyYAML
cpan CGI CGI::Carp DBI DBD::SQLite Data::Dumper::Concise YAML::XS URI::Escape HTML::Template::Pro WebService::Solr File::Slurp XML::Simple
bash ./etc_process.sh
else
- yum install cpan jre java-1.6.0 GraphicsMagick ImageMagick libjpeg poppler-utils libyaml libyaml-devel libxml2-devel libxslt-devel libxml2 libxslt python-devel
- yum install python-setuptools
+ yum -y install cpan jre java-1.6.0 GraphicsMagick ImageMagick libjpeg poppler-utils libyaml libyaml-devel libxml2-devel libxslt-devel libxml2 libxslt python-devel
+ yum -y install python-setuptools
easy_install pysolr
easy_install lxml
- yum install PyYAML perl-DBD-SQLite perl-DBI perl-CGI per-XML-Simple perl-File-Slurp perl-Data-Dumper-Concise perl-YAML-LibYAML perl-HTML-Template-Pro perl-File-Slurp
+ yum -y install PyYAML perl-DBD-SQLite perl-DBI perl-CGI per-XML-Simple perl-File-Slurp perl-Data-Dumper-Concise perl-YAML-LibYAML perl-HTML-Template-Pro perl-File-Slurp
cpan URI::Escape WebService::Solr
bash ./etc_process.sh
fi
###########################################
# Libre10 - yet another hoge - #
-# Ver.0.8.2 #
-# 2013/07/27 yukikaze & long.inus #
+# Ver.0.8.3 #
+# 2013/11/01 yukikaze & long.inus #
# Copyright (C) 2013 #
###########################################