View Single Post
Old 08-29-2009, 07:55 AM   #2
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Thanks for this code. It looks like it does a very nice job of an arduous task.

I ran the python script with just -r and it worked, but with -pqr it crashed yielding this error message:
Code:
E:\ebooks\Coding_Mobi2IMP_PDFRead\pacify>pacify.py -i 157.txt -pqr
pacify v0.2 - Copyright 2009 Pax Librorum (www.PaxLibrorum.com)

Right-trimming lines...

Parsing...

  line break: nr (2643)
  paragraph break: nrnr (823)
  ...:  (46)

Removing intraparagraph linebreaks...

Fixing erroneous paragraph breaks...

Traceback (most recent call last):
  File "E:\ebooks\Coding_Mobi2IMP_PDFRead\pacify\pacify.py", line 802, in <module>
    main()
  File "E:\ebooks\Coding_Mobi2IMP_PDFRead\pacify\pacify.py", line 111, in main
    theTome = parfixTome(theTome)
  File "E:\ebooks\Coding_Mobi2IMP_PDFRead\pacify\pacify.py", line 440, in parfix Tome
    if strLowerAlpha.find(theTome[idx+2][0:1]) > -1:
IndexError: list index out of range
Could you also create a windows executable, pacify.exe, for those here that don't do python? I did create one myself using py2exe and this setup.py code (used in PDFRead ):
Code:
import py2exe
from distutils.core import setup

setup(
    name = 'Pacify',
    description = 'Text reformatter / RTF extractor - Copyright 2009 Pax Librorum (www.PaxLibrorum.com)',
    version = '0.2',
    author = 'ahi',
    author_email = 'http://www.paxlibrorum.com/contact/',
    console = ['pacify.py'],
    options = {"py2exe": {"typelibs": [('{1103EA00-3A0C-11D3-A6F6-00104B2947FB}',0,1,0)]}},
)
Attached Files
File Type: txt 157.txt (235.0 KB, 380 views)
File Type: txt output.txt (233.2 KB, 638 views)
File Type: txt output-smartquotes.txt (233.7 KB, 381 views)

Last edited by nrapallo; 08-29-2009 at 08:07 AM. Reason: added smart quotes version of output.txt
nrapallo is offline   Reply With Quote