Menu

#313 titles from file for pagegenerators.py

closed-accepted
nobody
None
5
2009-05-06
2009-04-29
No

Additional option "-plainfile" reads titles from text files without square brackets ("-file")

Discussion

  • Francesco Cosoleto

    f.readline() should be used instead of re.findall().

    I think we have a too populated list of options. Probably it's better to change -file to interpret line as page titles when no [[title]] is found, instead of adding yet another option.

     
  • sigmaoctantis

    sigmaoctantis - 2009-04-30

    patch

     
  • sigmaoctantis

    sigmaoctantis - 2009-04-30

    Thanks, I updated it accordingly. Feel free to combine the two.

     
  • Francesco Cosoleto

     
  • Francesco Cosoleto

    A preliminary patch to enhance -file option as described is attached. Any comments?

     
  • sigmaoctantis

    sigmaoctantis - 2009-04-30

    It is better than two separate options. I tested it and it works with files in both formats.

     
  • NicDumZ — Nicolas Dumazet

    looks good to me. I was pretty sure that some generator already allowed to use one title per line, but I can't find it anymore. (?)

     
  • Francesco Cosoleto

     
  • Francesco Cosoleto

    I think I will commit this patch tomorrow with a slightly changed docstring.

     
  • Francesco Cosoleto

    • status: open --> closed-accepted
     
  • Francesco Cosoleto

    Applied in r6839.

     
  • sigmaoctantis

    sigmaoctantis - 2009-05-07

    Thanks. For some encodings/systems, the initial title would need to be stripped of any BOM
    ( http://evanjones.ca/python-utf8.html#bom ).

     

Log in to post a comment.