Pharo-Chrome (was: Soup bug(fix))

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Mariano Martinez Peck


On Wed, Nov 15, 2017 at 7:04 PM, Sean P. DeNigris <[hidden email]> wrote:
Alistair Grant wrote
> Sorry for making you do all the work

Not at all; happy to help. It takes a village! BTW I tracked it down to the
spaces in the command path. IIRC from my OSP hacking days, it probably has
something to do with the path not being run through the shell to interpret
the $\s.


Yeah, OSSubprocess wont interpret, not expand anything. If you want to use shell, then you have to use #shellCommand: or #shell:command:  (see its senders for test examples)

Cheers,


--
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

alistairgrant
In reply to this post by Sean P. DeNigris
Hi Sean & Mariano,

On 16 November 2017 at 00:21, Sean P. DeNigris <[hidden email]> wrote:

> Alistair Grant wrote
>> I'm glad (and relieved :-)) to hear that it is working.
>>
>> Would you mind sending the modified command path that you're using so
>> I can update the code?  (I guess that it is just removing the
>> backspaces, but just in case...).
>
> That is correct…
>
> OSSUnixSubprocess new
>         command: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
>         arguments: #('--user-data-dir=/tmp/pharo/GoogleChrome/debugSession'
> '--remote-debugging-port=9222');
>         run.

Thanks for the confirmation.  I'll update the package soon(ish).


On 16 November 2017 at 12:16, Mariano Martinez Peck
<[hidden email]> wrote:
>
> Yeah, OSSubprocess wont interpret, not expand anything. If you want to use
> shell, then you have to use #shellCommand: or #shell:command:  (see its
> senders for test examples)

Sigh... The code originally just called system().  When I wanted to be
able to terminate the chrome process I switched to OSSubprocess.  The
linux paths happen to not have spaces in them, and I didn't even think
of this.  Sorry about that.

Cheers,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephane Ducasse-3
In reply to this post by Mariano Martinez Peck
Hi mariano

pay attention to really use the version of guillermo because he was
fixing some bugs.

Stef

On Wed, Nov 15, 2017 at 3:15 AM, Mariano Martinez Peck
<[hidden email]> wrote:

> If this is a problem with OSSubprocess I am happy to help it debug it, but
> please share with me the exact steps to reproduce it and which code to look
> at. And which OS and which Pharo. And it should be 32 bits (OSSubprocess
> doesn't work on 64 yet)
>
> Thanks,
>
> On Tue, Nov 14, 2017 at 9:47 PM, Sean P. DeNigris <[hidden email]>
> wrote:
>>
>> Alistair Grant wrote
>> > This looks like you are using an old (cached?) version.
>>
>> Ugh, yes. I just deleted the local clone and let Iceberg reclone.
>>
>> Now when I tried:
>>     `GoogleChrome get:
>> 'https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO'`
>> I got:
>>     Error: Error: posix_spawn(), code: 2, description: No such file or
>> directory
>> Even though pasting the command into Terminal successfully launched
>> Chrome.
>>
>> BTW I had to insert a leading / to into the executable location.
>>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Mariano Martinez Peck


On Thu, Nov 16, 2017 at 6:27 PM, Stephane Ducasse <[hidden email]> wrote:
Hi mariano

pay attention to really use the version of guillermo because he was
fixing some bugs.


Hi Stef,

Well, in general the idea is to use the "upstream" project and not personal forks. As far as I am aware of, I have merged all PR from Guille into `master`.
So unless he has recent commits that were not yet made available via a PR, then my upstream project should be correct. 
The only thing I would do as a user is to load `master` rather than the latest released stable version as latest Guille PR merge happened AFTER the last release. 

Cheers, 

 
Stef

On Wed, Nov 15, 2017 at 3:15 AM, Mariano Martinez Peck
<[hidden email]> wrote:
> If this is a problem with OSSubprocess I am happy to help it debug it, but
> please share with me the exact steps to reproduce it and which code to look
> at. And which OS and which Pharo. And it should be 32 bits (OSSubprocess
> doesn't work on 64 yet)
>
> Thanks,
>
> On Tue, Nov 14, 2017 at 9:47 PM, Sean P. DeNigris <[hidden email]>
> wrote:
>>
>> Alistair Grant wrote
>> > This looks like you are using an old (cached?) version.
>>
>> Ugh, yes. I just deleted the local clone and let Iceberg reclone.
>>
>> Now when I tried:
>>     `GoogleChrome get:
>> '<a href="https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO&#39;`" rel="noreferrer" target="_blank">https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO'`
>> I got:
>>     Error: Error: posix_spawn(), code: 2, description: No such file or
>> directory
>> Even though pasting the command into Terminal successfully launched
>> Chrome.
>>
>> BTW I had to insert a leading / to into the executable location.
>>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com




--
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephane Ducasse-3
>
> Well, in general the idea is to use the "upstream" project and not personal
> forks. As far as I am aware of, I have merged all PR from Guille into
> `master`.

Ok so this is good

> So unless he has recent commits that were not yet made available via a PR,
> then my upstream project should be correct.

Guille usually do it the right way. good.

> The only thing I would do as a user is to load `master` rather than the
> latest released stable version as latest Guille PR merge happened AFTER the
> last release.

I do not get why as a user I would load master instead of stable.
 Or I do not understand the diff between master, dev, stable, released,

To me Stable means that it has been somehow release why I do not see a
released concern
in the master beside. This vocabulary is unclear to me.

I do not get it but this sounds good.


Stef

>
> Cheers,
>
>
>>
>> Stef
>>
>> On Wed, Nov 15, 2017 at 3:15 AM, Mariano Martinez Peck
>> <[hidden email]> wrote:
>> > If this is a problem with OSSubprocess I am happy to help it debug it,
>> > but
>> > please share with me the exact steps to reproduce it and which code to
>> > look
>> > at. And which OS and which Pharo. And it should be 32 bits (OSSubprocess
>> > doesn't work on 64 yet)
>> >
>> > Thanks,
>> >
>> > On Tue, Nov 14, 2017 at 9:47 PM, Sean P. DeNigris
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Alistair Grant wrote
>> >> > This looks like you are using an old (cached?) version.
>> >>
>> >> Ugh, yes. I just deleted the local clone and let Iceberg reclone.
>> >>
>> >> Now when I tried:
>> >>     `GoogleChrome get:
>> >> 'https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO'`
>> >> I got:
>> >>     Error: Error: posix_spawn(), code: 2, description: No such file or
>> >> directory
>> >> Even though pasting the command into Terminal successfully launched
>> >> Chrome.
>> >>
>> >> BTW I had to insert a leading / to into the executable location.
>> >>
>> >>
>> >>
>> >> -----
>> >> Cheers,
>> >> Sean
>> >> --
>> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >>
>> >
>> >
>> >
>> > --
>> > Mariano
>> > http://marianopeck.wordpress.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Guillermo Polito
Yes, everything is on official's Mariano repository.

On Fri, Nov 17, 2017 at 10:29 AM, Stephane Ducasse <[hidden email]> wrote:
>
> Well, in general the idea is to use the "upstream" project and not personal
> forks. As far as I am aware of, I have merged all PR from Guille into
> `master`.

Ok so this is good

> So unless he has recent commits that were not yet made available via a PR,
> then my upstream project should be correct.

Guille usually do it the right way. good.

> The only thing I would do as a user is to load `master` rather than the
> latest released stable version as latest Guille PR merge happened AFTER the
> last release.

I do not get why as a user I would load master instead of stable.
 Or I do not understand the diff between master, dev, stable, released,

To me Stable means that it has been somehow release why I do not see a
released concern
in the master beside. This vocabulary is unclear to me.

I do not get it but this sounds good.


Stef

>
> Cheers,
>
>
>>
>> Stef
>>
>> On Wed, Nov 15, 2017 at 3:15 AM, Mariano Martinez Peck
>> <[hidden email]> wrote:
>> > If this is a problem with OSSubprocess I am happy to help it debug it,
>> > but
>> > please share with me the exact steps to reproduce it and which code to
>> > look
>> > at. And which OS and which Pharo. And it should be 32 bits (OSSubprocess
>> > doesn't work on 64 yet)
>> >
>> > Thanks,
>> >
>> > On Tue, Nov 14, 2017 at 9:47 PM, Sean P. DeNigris
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Alistair Grant wrote
>> >> > This looks like you are using an old (cached?) version.
>> >>
>> >> Ugh, yes. I just deleted the local clone and let Iceberg reclone.
>> >>
>> >> Now when I tried:
>> >>     `GoogleChrome get:
>> >> '<a href="https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO&#39;`" rel="noreferrer" target="_blank">https://finance.yahoo.com/quote/%5EAXJO/history?p=%5EAXJO'`
>> >> I got:
>> >>     Error: Error: posix_spawn(), code: 2, description: No such file or
>> >> directory
>> >> Even though pasting the command into Terminal successfully launched
>> >> Chrome.
>> >>
>> >> BTW I had to insert a leading / to into the executable location.
>> >>
>> >>
>> >>
>> >> -----
>> >> Cheers,
>> >> Sean
>> >> --
>> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >>
>> >
>> >
>> >
>> > --
>> > Mariano
>> > http://marianopeck.wordpress.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com




--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

alistairgrant
In reply to this post by alistairgrant
An updated version is available including:

* The fix for spaces in the executable name mentioned below.
* Support for Chrome headless mode.
* Improved screenshot capture (it now captures the entire page, see the README)
* Extended documentation (README.md)

Cheers,
Alistair


On 16 November 2017 at 19:22, Alistair Grant <[hidden email]> wrote:

> Hi Sean & Mariano,
>
> On 16 November 2017 at 00:21, Sean P. DeNigris <[hidden email]> wrote:
>> Alistair Grant wrote
>>> I'm glad (and relieved :-)) to hear that it is working.
>>>
>>> Would you mind sending the modified command path that you're using so
>>> I can update the code?  (I guess that it is just removing the
>>> backspaces, but just in case...).
>>
>> That is correct…
>>
>> OSSUnixSubprocess new
>>         command: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
>>         arguments: #('--user-data-dir=/tmp/pharo/GoogleChrome/debugSession'
>> '--remote-debugging-port=9222');
>>         run.
>
> Thanks for the confirmation.  I'll update the package soon(ish).
>
>
> On 16 November 2017 at 12:16, Mariano Martinez Peck
> <[hidden email]> wrote:
>>
>> Yeah, OSSubprocess wont interpret, not expand anything. If you want to use
>> shell, then you have to use #shellCommand: or #shell:command:  (see its
>> senders for test examples)
>
> Sigh... The code originally just called system().  When I wanted to be
> able to terminate the chrome process I switched to OSSubprocess.  The
> linux paths happen to not have spaces in them, and I didn't even think
> of this.  Sorry about that.
>
> Cheers,
> Alistair

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Sean P. DeNigris
Administrator
Alistair Grant wrote
> An updated version is available including:

Great, thanks! #exampleEvalutionOfJavaScript and #exampleNavigation both
work now. Also, the finance.yahoo.com example from this thread worked until
missing class DataFrame. IIUC you said this was from a different project,
but I didn't see it in the Pharo Catalog. How would I load it and what is
the project about? Thanks!



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

alistairgrant
On 25 November 2017 at 14:18, Sean P. DeNigris <[hidden email]> wrote:
> Alistair Grant wrote
>> An updated version is available including:
>
> Great, thanks! #exampleEvalutionOfJavaScript and #exampleNavigation both
> work now. Also, the finance.yahoo.com example from this thread worked until
> missing class DataFrame. IIUC you said this was from a different project,
> but I didn't see it in the Pharo Catalog. How would I load it and what is
> the project about? Thanks!

The Pharo-Chrome readme includes code for loading DataFrame:

Metacello new
  baseline: 'DataFrame';
  repository: 'github://PolyMathOrg/DataFrame';
  load.


If you are familiar with python pandas, it is a similar package for
Pharo.  See also:

https://github.com/PolyMathOrg/DataFrame


Cheers,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Sean P. DeNigris
Administrator
Alistair Grant wrote
> https://github.com/PolyMathOrg/DataFrame

Cool, thanks! I didn't know about this project.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephane Ducasse-3
Hi Alistair

If you want help I can add a baseline that automtically load DataFrame.
Because users should not load by themselves external project.

Stef

On Sat, Nov 25, 2017 at 3:57 PM, Sean P. DeNigris <[hidden email]> wrote:

> Alistair Grant wrote
>> https://github.com/PolyMathOrg/DataFrame
>
> Cool, thanks! I didn't know about this project.
>
>
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

alistairgrant
Hi Stef,

On 26 November 2017 at 22:39, Stephane Ducasse <[hidden email]> wrote:
> Hi Alistair
>
> If you want help I can add a baseline that automtically load DataFrame.
> Because users should not load by themselves external project.

Thanks for the offer, but Pharo-Chrome isn't actually dependent on
DataFrame.  I just used it in an example in the README as it makes
inspecting the results easy (it's possible to inspect the results
without DataFrame, you'll just be looking at an Array of Arrays).  As
we've seen from Pillar and Magritte, the more dependencies the greater
the maintenance costs and potential for incompatibility.  If there's a
compelling reason to automatically load DataFrame I'm happy to do
that, but at the moment I'm not seeing it.

Cheers,
Alistair



> Stef
>
> On Sat, Nov 25, 2017 at 3:57 PM, Sean P. DeNigris <[hidden email]> wrote:
>> Alistair Grant wrote
>>> https://github.com/PolyMathOrg/DataFrame
>>
>> Cool, thanks! I didn't know about this project.
>>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephan Eggermont-3
On 27-11-17 11:02, Alistair Grant wrote:
>  As
> we've seen from Pillar and Magritte, the more dependencies the greater
> the maintenance costs and potential for incompatibility.

That conclusion is not supported by the actual code. The maintenance
costs for Pillar were high because of ignoring existing users of the
code and bad Metacello practices.

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephane Ducasse-3
In reply to this post by alistairgrant
Hi alistair

I understand. If this is a useful combination my practice is to create
a separate projects which loads both.

For Pillar and Magritte this is another story. When magritte is used
deep down in the core of Magritte then
you end up being forced to load magritte even when you do not need it.
I was a naive design decision.


Stef

On Mon, Nov 27, 2017 at 11:02 AM, Alistair Grant <[hidden email]> wrote:

> Hi Stef,
>
> On 26 November 2017 at 22:39, Stephane Ducasse <[hidden email]> wrote:
>> Hi Alistair
>>
>> If you want help I can add a baseline that automtically load DataFrame.
>> Because users should not load by themselves external project.
>
> Thanks for the offer, but Pharo-Chrome isn't actually dependent on
> DataFrame.  I just used it in an example in the README as it makes
> inspecting the results easy (it's possible to inspect the results
> without DataFrame, you'll just be looking at an Array of Arrays).  As
> we've seen from Pillar and Magritte, the more dependencies the greater
> the maintenance costs and potential for incompatibility.  If there's a
> compelling reason to automatically load DataFrame I'm happy to do
> that, but at the moment I'm not seeing it.
>
> Cheers,
> Alistair
>
>
>
>> Stef
>>
>> On Sat, Nov 25, 2017 at 3:57 PM, Sean P. DeNigris <[hidden email]> wrote:
>>> Alistair Grant wrote
>>>> https://github.com/PolyMathOrg/DataFrame
>>>
>>> Cool, thanks! I didn't know about this project.
>>>
>>>
>>>
>>> -----
>>> Cheers,
>>> Sean
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Pharo-Chrome (was: Soup bug(fix))

Stephane Ducasse-3
In reply to this post by Stephan Eggermont-3
Hi stephan

not really this is more "not thinking in terms of large dependencies" :)

Stef

On Mon, Nov 27, 2017 at 12:26 PM, stephan <[hidden email]> wrote:

> On 27-11-17 11:02, Alistair Grant wrote:
>>
>>  As
>> we've seen from Pillar and Magritte, the more dependencies the greater
>> the maintenance costs and potential for incompatibility.
>
>
> That conclusion is not supported by the actual code. The maintenance costs
> for Pillar were high because of ignoring existing users of the code and bad
> Metacello practices.
>
> Stephan
>
>

12