Re: [web2py] Re: OFF Topic - Tech for the frontend - Elm ???

2017-10-10 Thread António Ramos
Yep
also noticed choo some time ago.
It was designed to mimic elm arquitecture but in javascript

found this to compare some frameworks in code length

http://jscomp.netlify.com/pages/home_demos.html

2017-10-10 2:52 GMT+01:00 Eric Waldman :

> I've recently been quite enamoured by choo https://choo.io/
>
> It's got a beautiful api, very functional. Nowhere near as complex as
> Angular or React + Redux.
>
> On Thursday, September 28, 2017 at 11:59:56 AM UTC-4, Ramos wrote:
>>
>> i meant sharing   :)
>>
>> 2017-09-28 16:58 GMT+01:00 António Ramos :
>>
>>>
>>> Just charing and collecting some toughts...
>>> Anyone knows about ELM ?
>>>
>>> I Like vue a lot, especially after all the Angular 1 to angular 2 RIP
>>> event...
>>> But ELM seems simpler and cleaner and more functional...
>>>
>>>
>>> http://elm-lang.org/examples
>>>
>>> regards
>>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] any ideas for printing stdout to the web interface?

2017-10-10 Thread LoveWeb2py
I run a script that prints to stdout, but I'd like to have a modal popup 
and have all the information displayed to the user while the script is 
running.

Anyone have any ideas on how to achieve this within web2py?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] any ideas for printing stdout to the web interface?

2017-10-10 Thread António Ramos
can u show your script first?

2017-10-10 17:46 GMT+01:00 LoveWeb2py :

> I run a script that prints to stdout, but I'd like to have a modal popup
> and have all the information displayed to the user while the script is
> running.
>
> Anyone have any ideas on how to achieve this within web2py?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: any ideas for printing stdout to the web interface?

2017-10-10 Thread LoveWeb2py
well, imagine i'm doing 

for i in range(0,10):
print(i)

There are hundreds of logging functions inside of the script, so it'd be a 
bit much for here.

I know I can do that exact command as {{for i in range(0,10):}}
{{=i}}

 {{pass}}

but I would like to have a way to dynamically print stuff to the web 
interface. Maybe using ajax? I'm just not sure where to start...


On Tuesday, October 10, 2017 at 12:46:33 PM UTC-4, LoveWeb2py wrote:
>
> I run a script that prints to stdout, but I'd like to have a modal popup 
> and have all the information displayed to the user while the script is 
> running.
>
> Anyone have any ideas on how to achieve this within web2py?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Why web2py server hangs/freeze?

2017-10-10 Thread Dave S


On Monday, September 11, 2017 at 12:33:38 PM UTC-7, Dave S wrote:
 

> My experience with Rocket locking up happens on AWS linux, somewhere in 
> the cloud. There are both short lockups (about 10 minutes) which are 
> related to a socket error that times out, and indefinite lockups (hours) 
> which I haven't yet associated with a specific problem.  The latter 
> requires a kill the pid, restart the server cycle; at least, I don't have a 
> better fix yet.
>
>
I've gone almost 2 weeks since the last lockup, but had one this morning.  
While it was down, I had a chance to use curl to try connecting, results 
below.

 curl -k -vv -X GET https://myserver.com
* About to connect() to myserver.com port 443 (#0)
*   Trying 52.34.144.39... connected
* Connected to myserver.com (52.34.144.39) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* NSS error -5961 (PR_CONNECT_RESET_ERROR)
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error


 /dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Rocket logs and server crash

2017-10-10 Thread Dave S


On Wednesday, September 13, 2017 at 9:56:09 PM UTC-7, Dave S wrote:
>
>
>
> On Friday, September 1, 2017 at 4:07:33 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Thursday, August 31, 2017 at 3:05:56 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> Can you tell us more about your setup?
>>>
>>>
>>
>> AWS Linux, Python=2.7.12, web2py-shake-the-box:   webp2y (2.14.6) + 
>> Rocket + Sqlite.
>>
>> Since this is still evolving into production, and usually doesn't involve 
>> a lot of maintenance, I'm still hand-starting from the command line (-i 
>> 0.0.0.0 -p 443 -c ...pem -k pem ), doing the password (I know, -a 
>> exists), and after a few seconds hitting ^z and then bg.
>> Similar for port 80, which should return a 302, and then 2 -K  
>> invocations for scheduler stuff (I have 2 apps).
>>
>> I had a more recent failure-to-respond where there didn't seem to be 
>> anything in /var/log/messages, or any error in logs/web2py.log.
>> The 443 process was still running (in some sense), so I killed it and did 
>> a fresh one, and things were back to normal.
>>
>>>
>>>
> I did an experiment with one of these hangs, opening an ssh session to get 
> a command line (the usual way I deal with admin'ing this headless system), 
> and then trying to curl to / (that defaults to myapp/default/index, of 
> course) -- the connection seems to have timed out.
>
> [ec2-user@ip-172-31-16-18 web2py-2.14.6]$ curl -v --GET https://127.0.0.1/
> *   Trying 127.0.0.1...
> * TCP_NODELAY set
> * Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
> * Initializing NSS with certpath: sql:/etc/pki/nssdb
> *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
>   CApath: none
> * NSS error -5961 (PR_CONNECT_RESET_ERROR)
> * TCP connection reset by peer
> * Curl_http_done: called premature == 1
> * Closing connection 0
> curl: (35) TCP connection reset by peer
> [ec2-user@ip-172-31-16-18 web2py-2.14.6]$ 
> [ec2-user@ip-172-31-16-18 web2py-2.14.6]$ date
> Thu Sep 14 04:39:03 UTC 2017
>
>
>
As posted in another thread, I had one of these hangs today after 2 weeks 
or so of uptime.

/dps



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: any ideas for printing stdout to the web interface?

2017-10-10 Thread Dave S


On Tuesday, October 10, 2017 at 9:46:33 AM UTC-7, LoveWeb2py wrote:
>
> I run a script that prints to stdout, but I'd like to have a modal popup 
> and have all the information displayed to the user while the script is 
> running.
>
> Anyone have any ideas on how to achieve this within web2py?
>
>
There are 2 mechanism in HTML5, I believe, but I'm only going to point you 
at one for the moment:  Web Workers.
http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
>
http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
>
http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
>

With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
when it was time to replace the content.  A couple of the examples 
calculate Pi, and paste the results into the main page.

There is also web sockets in HTML5.
http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
>
Gluon/contrib has websocket_messaging.py.

I thought I remembered an HTML5 server push mechanisms for notifications, 
but if it's there I'm not looking in the right place.


If you need Apple-ish answers, there's this post:

https://groups.google.com/d/msg/web2py/W1OkIACwtJA/X4qs4-mY9e4J>

/dps

/dps 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Understanding the download function

2017-10-10 Thread Anthony
On Monday, October 9, 2017 at 1:42:59 AM UTC-4, Andy W wrote:
>
> Hi Rudy
>
> Have you tried re-defining the download function to include the path to the
> location you have used for storing the uploaded files? For example, in my
> case I ended up with the following in my controller:
>
> def download():
> import os
>  file_path = os.path.join(request.folder,'uploads', str(auth.user.
> client), request.args(0))
>  return response.stream(open(file_path), attachment=False, chunk_size=
> 4096)
>
>
This shouldn't be necessary. As long as you have the client id available in 
the request (e.g., in auth.user.client), you can simply use it to specify 
the uploadfolder when defining the model. In db.by:

db.define_table('company',
Field('logo', 'upload', label='Company Logo',
  uploadfolder=os.path.join(request.folder, 'uploads', auth.user.client 
if auth.user else ''),
  uploadseparate=True, autodelete=True)),
...)

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: any ideas for printing stdout to the web interface?

2017-10-10 Thread LoveWeb2py
Was looking for something more like 
this... https://github.com/joewalnes/websocketd

I'll give it a try. Thank you all!

On Tuesday, October 10, 2017 at 3:13:08 PM UTC-4, Dave S wrote:
>
>
>
> On Tuesday, October 10, 2017 at 9:46:33 AM UTC-7, LoveWeb2py wrote:
>>
>> I run a script that prints to stdout, but I'd like to have a modal popup 
>> and have all the information displayed to the user while the script is 
>> running.
>>
>> Anyone have any ideas on how to achieve this within web2py?
>>
>>
> There are 2 mechanism in HTML5, I believe, but I'm only going to point you 
> at one for the moment:  Web Workers.
>  http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
> >
>  http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
> >
>  http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
> >
>
> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
> when it was time to replace the content.  A couple of the examples 
> calculate Pi, and paste the results into the main page.
>
> There is also web sockets in HTML5.
>  http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
> >
> Gluon/contrib has websocket_messaging.py.
>
> I thought I remembered an HTML5 server push mechanisms for notifications, 
> but if it's there I'm not looking in the right place.
>
>
> If you need Apple-ish answers, there's this post:
>
> https://groups.google.com/d/msg/web2py/W1OkIACwtJA/X4qs4-mY9e4J>
>
> /dps
>
> /dps 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Issues with Scheduler (suddenly multiple tickers appear)

2017-10-10 Thread Boris Aramis Aguilar Rodríguez
So I narrowed down the issue, it happends when a worker detects he should 
be the ticker and does an update on all other workers to set them false, an 
oracle error happens (about deadlock) and it fails, the error "Error 
coordinating ticker" appears and then it continues, but lines later it 
COMMITS and makes itself a ticker... and everyone wants to be a ticker and 
scheduler dies and fire starts and i suffer in pain, so the fix should be 
removing the catch that prints the message "Error coordinating ticker" so 
that when the whole operation fails it rolls back and not commits itself to 
be a ticker.. anyways issue is open now:

https://github.com/web2py/web2py/issues/1787

El miércoles, 4 de octubre de 2017, 8:49:22 (UTC-6), Boris Aramis Aguilar 
Rodríguez escribió:
>
> Hi, I've been recently using lots of tasks scheduled on a server so I had 
> to use several workers to deal with the queue, currently I'm using 45 
> workers.
>
> Somewhere between 12 hours after starting the 45 workers, suddenly tasks 
> start accumulating in the queue and workers are alive (they report a 
> heartbeat), and the only thing i've noticed is that from the 45 workers 
> more than 1 becomes the ticker (the flag is_ticker is True for several of 
> them), so if I discovered that if I set to False the flag for all workers 
> except for one then tasks start being assigned again correctly, but it 
> happends again after some time.
>
> I'm not sure how to find where the bug is, so that is why I come here 
> asking for your guidance :)
>
> Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: any ideas for printing stdout to the web interface?

2017-10-10 Thread Dave S


On Tuesday, October 10, 2017 at 7:23:33 PM UTC-7, LoveWeb2py wrote:
>
> Was looking for something more like this... 
> https://github.com/joewalnes/websocketd
>
> I'll give it a try. Thank you all!
>

You may want to make use of a logging module.  The standard logging in 
web2py will go to a file (using the name in the as-shipped logging.conf 
unless you edit that), but it shouldn't be too hard to swap in something to 
send to a websocket instead.   Add your handler's name to logging.conf 
under the handlers section and under the logger_myapp section and add a 
handler_mywebsocks section.

I see on my Fedora system that /usr/lib64/python2.7/logging/handlers.py has 
a SocketHandler class which might be a starting point.

/dps


> On Tuesday, October 10, 2017 at 3:13:08 PM UTC-4, Dave S wrote:
>>
>>
>>
>> On Tuesday, October 10, 2017 at 9:46:33 AM UTC-7, LoveWeb2py wrote:
>>>
>>> I run a script that prints to stdout, but I'd like to have a modal popup 
>>> and have all the information displayed to the user while the script is 
>>> running.
>>>
>>> Anyone have any ideas on how to achieve this within web2py?
>>>
>>>
>> There are 2 mechanism in HTML5, I believe, but I'm only going to point 
>> you at one for the moment:  Web Workers.
>> > http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
>> >
>> > http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
>> >
>> > http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
>> >
>>
>> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
>> when it was time to replace the content.  A couple of the examples 
>> calculate Pi, and paste the results into the main page.
>>
>> There is also web sockets in HTML5.
>> > http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
>> >
>> Gluon/contrib has websocket_messaging.py.
>>
>> I thought I remembered an HTML5 server push mechanisms for notifications, 
>> but if it's there I'm not looking in the right place.
>>
>>
>> If you need Apple-ish answers, there's this post:
>>
>> https://groups.google.com/d/msg/web2py/W1OkIACwtJA/X4qs4-mY9e4J>
>>
>> /dps
>>
>> /dps 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: any ideas for printing stdout to the web interface?

2017-10-10 Thread Dave S


On Tuesday, October 10, 2017 at 10:35:19 PM UTC-7, Dave S wrote:
>
> The standard logging in web2py will go to a file (using the name in the 
> as-shipped logging.conf unless you edit that),
>

Of course, that's not-quite-coherently simplified.

The standard logging using the as-shipped logging.conf will both go to a 
file (using a default name from the as-shipped logging.conf) and to the 
console.  Editing logging.conf can a) remove either handler, b) change the 
name of the file, c) replace one handler with another, or d) add an 
additional handler.

That paragraph is not quite so simple, but I hope it is more coherent.

/dps "and maybe even accurate"

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.