Tutorial Review

17 messages Options Options
Embed this Post
Permalink
na-2 () Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
I wrote the following tutorial and submitted it for review. How does it get reviewed? Does someone just find it and review it?  Or is the answer to submit it here, which I am doing right now? Because I only saw instructions on how to write one properly but not what to do afterwards.

Here it is:
http://plone.org/documentation/tutorial/ocr-in-plone-using-tesseract-ocr

Thanks,
Nathan
Marco De Vitis () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Il 09/01/2008 8:50, NA ha scritto:

> I wrote the following tutorial and submitted it for review. How does it get
> reviewed? Does someone just find it and review it?  Or is the answer to
> submit it here, which I am doing right now? Because I only saw instructions

Uhm, I don't know if there's some automatic notification (maybe through
feeds?), but anyway writing here is the best way to warn potential
reviewers ;).

> http://plone.org/documentation/tutorial/ocr-in-plone-using-tesseract-ocr

This looks absolutely perfect to me!
But according to http://plone.org/documentation/how-to/use-help-center I
think maybe it should be presented as a how-to rather than a tutorial...
what do others think? And, in case you agree, is there a way to "switch"
the document type, or do you need to add a new how-to, copy&paste all
content from the tutorial, and then delete the tutorial?

Regarding the text, I only found these two minor glitches:

1. These two paragraph in parts 1 and 2 are redundant, they should be
merged into one:

"Tesseract OCR must be installed for this to work. You can download it
here. Read the documentation on how to install it. You can also compile
it with libtiff to support compressed TIFF files. Since I did not find
anywhere that documented installing Tesseract and libtiff together I
have documented my experience here."

"Install Tesseract and make sure it is working correctly by OCRing an
image from the command line. You may also want to install libtiff to
allow OCRing of compressed TIFF files. Installing Tesseract and libtiff
is beyond the scope of this tutorial but I have documented the steps I
followed here."

2. At the end of part 1:

"You will need to add scripts to Plone and import external scripts. This
is not difficult and the basic steps are outlined in the instructions."

My first reaction was: "what instructions??", I thought that you were
referring to other documentation.
Maybe you can replace "in the instructions" with "in this document".

Apart from this, very good writing!

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
na-2 () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Thank you!

I corrected the two issues with the text that you brought to my attention.

It seems like it should be a tutorial to me because it is multiple pages and having the four pages merged into one may be a bit large.

So are you a reviewer? Or do I still need to find a reviewer?

Thanks
Nathan
______________
ABillionBillion.com
Document Management for Everyone

Marco De Vitis wrote:
Il 09/01/2008 8:50, NA ha scritto:

> I wrote the following tutorial and submitted it for review. How does it get
> reviewed? Does someone just find it and review it?  Or is the answer to
> submit it here, which I am doing right now? Because I only saw instructions

Uhm, I don't know if there's some automatic notification (maybe through
feeds?), but anyway writing here is the best way to warn potential
reviewers ;).

> http://plone.org/documentation/tutorial/ocr-in-plone-using-tesseract-ocr

This looks absolutely perfect to me!
But according to http://plone.org/documentation/how-to/use-help-center I
think maybe it should be presented as a how-to rather than a tutorial...
what do others think? And, in case you agree, is there a way to "switch"
the document type, or do you need to add a new how-to, copy&paste all
content from the tutorial, and then delete the tutorial?

Regarding the text, I only found these two minor glitches:

1. These two paragraph in parts 1 and 2 are redundant, they should be
merged into one:

"Tesseract OCR must be installed for this to work. You can download it
here. Read the documentation on how to install it. You can also compile
it with libtiff to support compressed TIFF files. Since I did not find
anywhere that documented installing Tesseract and libtiff together I
have documented my experience here."

"Install Tesseract and make sure it is working correctly by OCRing an
image from the command line. You may also want to install libtiff to
allow OCRing of compressed TIFF files. Installing Tesseract and libtiff
is beyond the scope of this tutorial but I have documented the steps I
followed here."

2. At the end of part 1:

"You will need to add scripts to Plone and import external scripts. This
is not difficult and the basic steps are outlined in the instructions."

My first reaction was: "what instructions??", I thought that you were
referring to other documentation.
Maybe you can replace "in the instructions" with "in this document".

Apart from this, very good writing!

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-docs
Marco De Vitis () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Il 10/01/2008 0:12, NA ha scritto:

> It seems like it should be a tutorial to me because it is multiple pages and
> having the four pages merged into one may be a bit large.
>
> So are you a reviewer? Or do I still need to find a reviewer?

Well, I _can_ act as a reviewer and publish it, but I'm still at newbie
level in the doc team so I'd like to hear some senior's opinion about
the tutorial/how-to question, before doing it.

Anyway, I'm pretty sure all possible reviewers do follow this list.

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
Raphael Ritz () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Marco De Vitis wrote:

> Il 10/01/2008 0:12, NA ha scritto:
>
>> It seems like it should be a tutorial to me because it is multiple pages and
>> having the four pages merged into one may be a bit large.
>>
>> So are you a reviewer? Or do I still need to find a reviewer?
>
> Well, I _can_ act as a reviewer and publish it, but I'm still at newbie
> level in the doc team so I'd like to hear some senior's opinion about
> the tutorial/how-to question, before doing it.
>
> Anyway, I'm pretty sure all possible reviewers do follow this list.
>

Not sure about "all" but I do ;-)

I think given the way that it is written it is fine as a tutorial.

I'm hesitant to publish it because of other reasons. As stated in
the end it would be better

  - to have it as a product
    (but that might be a non-issue if you just say that here you
    illustrate how to do it via an external method. That alone
    might be a worth-while message.)

  - I don't think the code follows best practice
    It should be more defensive (checking conditions, logging etc)
    While that's even mentioned in the end of the tutorial I don't
    think we should publish such code as part of a *tutorial*

Personally, I would have used a pipe (like os.popen3) instead of
os.spawnv and the temp dir dance and a hard-coded path that
people need to adjust etc.

So, for those reasons I at least won't publish it right now.

Let's see what others think.

        Raphael






-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
Marco De Vitis () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Il 10/01/2008 11:38, Raphael Ritz ha scritto:

> Marco De Vitis wrote:
>> Anyway, I'm pretty sure all possible reviewers do follow this list.
>
> Not sure about "all" but I do ;-)

Well, I hope anyone interested in reviewing Plone docs keeps an eye on
this list ;).

> the end it would be better
>
>   - to have it as a product
>     (but that might be a non-issue if you just say that here you
>     illustrate how to do it via an external method. That alone
>     might be a worth-while message.)
>
>   - I don't think the code follows best practice
>     It should be more defensive (checking conditions, logging etc)
>     While that's even mentioned in the end of the tutorial I don't
>     think we should publish such code as part of a *tutorial*

That's why I think it should be a how-to.
I doesn't explain "best practices" or get into details, it just tells
you how to do a specific thing in a specific way, which might not be the
best possible, but might be of interest to someone anyway.

If you think publishing it wouldn't be wise as a how-to, either, due to
its not perfect technical content, then maybe NA could add a simple
notice at the start of the document, to warn the reader that the same
thing could be done in better ways.

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
Jon Stahl () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Marco De Vitis wrote:

> Il 10/01/2008 11:38, Raphael Ritz ha scritto:
>
>  
>> Marco De Vitis wrote:
>>    
>>> Anyway, I'm pretty sure all possible reviewers do follow this list.
>>>      
>> Not sure about "all" but I do ;-)
>>    
>
> Well, I hope anyone interested in reviewing Plone docs keeps an eye on
> this list ;).
>
>  
>> the end it would be better
>>
>>   - to have it as a product
>>     (but that might be a non-issue if you just say that here you
>>     illustrate how to do it via an external method. That alone
>>     might be a worth-while message.)
>>
>>   - I don't think the code follows best practice
>>     It should be more defensive (checking conditions, logging etc)
>>     While that's even mentioned in the end of the tutorial I don't
>>     think we should publish such code as part of a *tutorial*
>>    
>
> That's why I think it should be a how-to.
> I doesn't explain "best practices" or get into details, it just tells
> you how to do a specific thing in a specific way, which might not be the
> best possible, but might be of interest to someone anyway.
>
> If you think publishing it wouldn't be wise as a how-to, either, due to
> its not perfect technical content, then maybe NA could add a simple
> notice at the start of the document, to warn the reader that the same
> thing could be done in better ways.
>
>  
My opinion:

+1 for a how-to rather than a tutorial.  (Unfortunately, the only way to
change content types is manual cut-and-paste.)

-1 for not publishing because of Raphael's technical concerns.  Better
to publish a first draft, and let people (like Raphael!) give feedback,
then hopefully Nathan will be able to revise and improve it as
appropriate.

FYI, "submitting" a document for review puts it in the "review list" on
plone.org.  If you're on the doc-team, you should have access to that
via RSS and when logged in (no email notifications yet, but that will be
possible after we migrate to plone 3!).  Notifying the docs list of
course isn't a bad idea, either.

best,
jon

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
-----
Jon Stahl, Director of Web Solutions
ONE/Northwest - Online Networking for the Environment
http://www.onenw.org
Raphael Ritz () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Jon Stahl wrote:

[..]

Hi Jon and others,

> My opinion:
>
> +1 for a how-to rather than a tutorial.  (Unfortunately, the only way to
> change content types is manual cut-and-paste.)
>

As a How-To I have no objections.

When I said in my previous post that I'm fine with this being
a tutorial this was based on the way it is organized and written.

But then for a tutorial I assume people have the expectation
that things outlined there do follow best practices. And this
applies to the code in particular IMHO.
Therefore my objections.

As the latter doesn't necessarily apply to a How-To I'm fine
with publishing it as such and I might comment on it later on
the site myself.

> -1 for not publishing because of Raphael's technical concerns.  Better
> to publish a first draft, and let people (like Raphael!) give feedback,
> then hopefully Nathan will be able to revise and improve it as
> appropriate.
>

s.o.

> FYI, "submitting" a document for review puts it in the "review list" on
> plone.org.

Which I see nowhere (and I have management rights on the doc section).

> If you're on the doc-team, you should have access to that
> via RSS and when logged in

While that's correct the RSS feed doesn't show whether something
is pending or published.

> (no email notifications yet, but that will be
> possible after we migrate to plone 3!).  Notifying the docs list of
> course isn't a bad idea, either.
>

As I see it it's currently the best way to notify the doc team.

Sorry Nathan that we start discussing plone.org issues here.
Obviously this part has nothing to do with your submission
which is highly appreciated.

Raphael


> best,
> jon
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
Marco De Vitis () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Il 10/01/2008 16:19, Raphael Ritz ha scritto:

> Jon Stahl wrote:
>> FYI, "submitting" a document for review puts it in the "review list" on
>> plone.org.
>
> Which I see nowhere (and I have management rights on the doc section).

Same here, and I'm in the doc team and logged in.

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
na-2 () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Raphael Ritz
Hi everyone,

First of all, thank you for your feedback. I will attempt to respond.

I originally submitted the idea for this project to the products list and told them that I did not know how to make it into a product. They suggested that I start by writing a tutorial, after which people could help turn it into a product. So one way or another I really hope this gets published so that I could get feedback.

Raphael Ritz wrote:
  - to have it as a product
    (but that might be a non-issue if you just say that here you
    illustrate how to do it via an external method. That alone
    might be a worth-while message.)
1) Raphael, I have no problem starting the tutorial off explaining that this project uses external methods and that in the future we want to make it into a product.

Raphael Ritz wrote:
  - I don't think the code follows best practice
    It should be more defensive (checking conditions, logging etc)
    While that's even mentioned in the end of the tutorial I don't
    think we should publish such code as part of a *tutorial*
2) As far as best practices. You are probably right, and you say maybe it shouldn't be published as far as a *tutorial*, that's ok. Just let me know how to publish it then. If it should be a how-to then let me know that and how to convert it and I will. As long as I can publish it in some way so that people can give me feedback on how to make it conform to best practices.

Raphael Ritz wrote:
Personally, I would have used a pipe (like os.popen3) instead of
os.spawnv and the temp dir dance and a hard-coded path that
people need to adjust etc.
3) How would using popen3 help avoid the "temp dir dance"? I have to create the temp directories because I am using the command line tesseract and it takes an image filename as input and then creates a text file at the location you specify. I created a temp directory so that multiple users running the script at the same time would not conflict. Secondly, how would it help the hard coded path that people need to adjust? Wouldn''t I still have to pass the path to the Tesseract application?

John Stahl wrote:
+1 for a how-to rather than a tutorial.  (Unfortunately, the only way to
change content types is manual cut-and-paste.)
4) If that's what I gotta do just let me know.

John Stahl wrote:
-1 for not publishing because of Raphael's technical concerns.  Better
to publish a first draft, and let people (like Raphael!) give feedback,
then hopefully Nathan will be able to revise and improve it as
appropriate.
5) I like this idea. :)

Awaiting your decisions (who makes the final decision, by the way, or is that going to set off a new unrelated conversation...),
Nathan
____________________
ABillionBillion.com
Document Management for Everyone
Marco De Vitis () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Il 10/01/2008 17:32, NA ha scritto:

> Awaiting your decisions (who makes the final decision, by the way, or is
> that going to set off a new unrelated conversation...),

:)

Go for it! Cut&Paste all content in a new how-to, delete the tutorial,
let us know and we'll publish it (I'll do it if nobody else does it
first or says anything against it before I click).

--
Ciao,
   Marco.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
na-2 () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
OK, Done.
Marco De Vitis wrote:
(I'll do it if nobody else does it first or says anything against it before I click).
Go go go! :)

Whew. Copied and pasted and re uploaded my images. It is now a how-to, here it is:

http://plone.org/documentation/how-to/ocr-in-plone-using-tesseract-ocr


By the way, in case anyone here can fix this, when you create a new How-to it prefills some sections and text for you and one of the sections is this, "Prerequisities", which is spelled wrong.

Nathan
__________
ABillionBillion.com
Document Management for Everyone

Marco De Vitis wrote:
Il 10/01/2008 17:32, NA ha scritto:

> Awaiting your decisions (who makes the final decision, by the way, or is
> that going to set off a new unrelated conversation...),

:)

Go for it! Cut&Paste all content in a new how-to, delete the tutorial,
let us know and we'll publish it (I'll do it if nobody else does it
first or says anything against it before I click).

--
Ciao,
   Marco.
Raphael Ritz () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
NA wrote:
> OK, Done.
>
> Marco De Vitis wrote:
>> (I'll do it if nobody else does it first or says anything against it
>> before I click).
>>
> Go go go! :)
>

I just published it.

And to your specific question about pipes:

Here is how I do something similar
http://dev.plone.org/collective/browser/CMFBibliographyAT/trunk/tool/bibutils.py

Look in particular for the 'transform' method.

I don't really consider this perfect either (as you might
guess from comments in the code) but it does something very
similar to what you do in as much as it takes data in and
calls a (in that case C) program on the server to do a format
conversion.

Raphael


> Whew. Copied and pasted and re uploaded my images. It is now a how-to, here
> it is:
>
> http://plone.org/documentation/how-to/ocr-in-plone-using-tesseract-ocr
> http://plone.org/documentation/how-to/ocr-in-plone-using-tesseract-ocr
>
>
> By the way, in case anyone here can fix this, when you create a new How-to
> it prefills some sections and text for you and one of the sections is this,
> "Prerequisities", which is spelled wrong.
>
> Nathan
> __________
> ABillionBillion.com
> Document Management for Everyone
>
>
> Marco De Vitis wrote:
>> Il 10/01/2008 17:32, NA ha scritto:
>>
>>> Awaiting your decisions (who makes the final decision, by the way, or is
>>> that going to set off a new unrelated conversation...),
>> :)
>>
>> Go for it! Cut&Paste all content in a new how-to, delete the tutorial,
>> let us know and we'll publish it (I'll do it if nobody else does it
>> first or says anything against it before I click).
>>
>> --
>> Ciao,
>>    Marco.
>>
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
na-2 () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
I looked at your code and saw that you use popen3 and just pass in the name of the scrip instead of the path.
1) How does it know where the path of the script is, does it use the environment PATH variable, the same as if you would type the name of the script in a terminal from any path?
2) If that is the case then wouldn't that also work using os.spawnv? If fact, what is the reason you suggest os.popen3 instead of os.spawnv?

Thanks,
Nathan


Raphael Ritz wrote:
And to your specific question about pipes:

Here is how I do something similar
http://dev.plone.org/collective/browser/CMFBibliographyAT/trunk/tool/bibutils.py

Look in particular for the 'transform' method.

I don't really consider this perfect either (as you might
guess from comments in the code) but it does something very
similar to what you do in as much as it takes data in and
calls a (in that case C) program on the server to do a format
conversion.

Raphael
Wichert Akkerman () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Previously NA wrote:
> I looked at your code and saw that you use popen3 and just pass in the name
> of the scrip instead of the path.
> 1) How does it know where the path of the script is, does it use the
> environment PATH variable, the same as if you would type the name of the
> script in a terminal from any path?
> 2) If that is the case then wouldn't that also work using os.spawnv? If
> fact, what is the reason you suggest os.popen3 instead of os.spawnv?

The subprocess module is the preferred approach these days.

Wichert.

--
Wichert Akkerman <wichert@...>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
Raphael Ritz () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by na-2
NA wrote:
> I looked at your code and saw that you use popen3 and just pass in the name
> of the scrip instead of the path.
> 1) How does it know where the path of the script is, does it use the
> environment PATH variable, the same as if you would type the name of the
> script in a terminal from any path?

Yes.

> 2) If that is the case then wouldn't that also work using os.spawnv?

No, only with 'spawnvp' but according to

   http://docs.python.org/lib/os-process.html

this is not available on Windows.


> If
> fact, what is the reason you suggest os.popen3 instead of os.spawnv?
>

Sort of.

Frankly speaking apart from the above just personal taste.
I find it more convenient when dealing with simple calls
that read from stdin and write to stdout as compared to
the explicit tmpdir dance.

But you see that Wichert suggest to use the subprocess
module. I don't fully understand why this would make a
difference as popen2, popen3 and popen4 also execute
the command as a subprocess (according to

  http://docs.python.org/lib/os-newstreams.html#os-newstreams

at least) but I wouldn't mind being told why ;-)

Raphael


> Thanks,
> Nathan
>
>
>
> Raphael Ritz wrote:
>> And to your specific question about pipes:
>>
>> Here is how I do something similar
>> http://dev.plone.org/collective/browser/CMFBibliographyAT/trunk/tool/bibutils.py
>>
>> Look in particular for the 'transform' method.
>>
>> I don't really consider this perfect either (as you might
>> guess from comments in the code) but it does something very
>> similar to what you do in as much as it takes data in and
>> calls a (in that case C) program on the server to do a format
>> conversion.
>>
>> Raphael
>>
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@...
https://lists.sourceforge.net/lists/listinfo/plone-docs
na-2 () Re: Tutorial Review
Reply Threaded MoreMore options
Print post
Permalink
Tesseract doesn't output the resulting text to stdout, it outputs to a file, so regardless, I have to do the tmpdir dance.

Raphael Ritz wrote:
NA wrote:
> I looked at your code and saw that you use popen3 and just pass in the name
> of the scrip instead of the path.
> 1) How does it know where the path of the script is, does it use the
> environment PATH variable, the same as if you would type the name of the
> script in a terminal from any path?

Yes.

> 2) If that is the case then wouldn't that also work using os.spawnv?

No, only with 'spawnvp' but according to

   http://docs.python.org/lib/os-process.html

this is not available on Windows.


> If
> fact, what is the reason you suggest os.popen3 instead of os.spawnv?
>

Sort of.

Frankly speaking apart from the above just personal taste.
I find it more convenient when dealing with simple calls
that read from stdin and write to stdout as compared to
the explicit tmpdir dance.

But you see that Wichert suggest to use the subprocess
module. I don't fully understand why this would make a
difference as popen2, popen3 and popen4 also execute
the command as a subprocess (according to

  http://docs.python.org/lib/os-newstreams.html#os-newstreams

at least) but I wouldn't mind being told why ;-)

Raphael


> Thanks,
> Nathan
>
>
>
> Raphael Ritz wrote:
>> And to your specific question about pipes:
>>
>> Here is how I do something similar
>> http://dev.plone.org/collective/browser/CMFBibliographyAT/trunk/tool/bibutils.py
>>
>> Look in particular for the 'transform' method.
>>
>> I don't really consider this perfect either (as you might
>> guess from comments in the code) but it does something very
>> similar to what you do in as much as it takes data in and
>> calls a (in that case C) program on the server to do a format
>> conversion.
>>
>> Raphael
>>
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-docs mailing list
Plone-docs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-docs