[web2py] Re: Versioning Erro

2016-11-22 Thread Dave S


On Monday, November 21, 2016 at 8:45:17 AM UTC-8, Leonel Câmara wrote:
>
> It is a bug, see:
> https://github.com/web2py/web2py/issues/1245
>
> web2py needs to either remove the mercurial integration or keep up with 
> their api modifications.
>

Or use the correct API  (command server).   I've been filing the corners of 
my tuits, but I haven't got any of them rounded yet, sorry.

/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: web2py as Grafana endpoint

2016-11-22 Thread Dave S


On Thursday, November 17, 2016 at 11:09:27 PM UTC-8, Dave S wrote:
>
>
>
> On Thursday, November 17, 2016 at 2:38:57 PM UTC-8, Niphlod wrote:
>>
>> if the request comes in either as a POST or as a PUT it has a body (since 
>> all examples report a faily nested query structure, I'd say it's the case 
>> vs a simple querystring in a GET)
>>
>> If the body carries the correct content-encoding, it's automatically 
>> parsed into request.vars. You can still read the raw body as usual in 
>> request.body .
>>
>>
> Thanks, that helped me to know what to look for.  I got the Grafana stuff 
> installed, it does the fake-json-source ok, and with FF developer tools 
>  I'm seeing the traffic to my nascent endpoint.
>
> When configuring the datasource URL, it does a GET to the base URL (the 
> one just for "checking in", return an HTTP 200; I put a little status json 
> into the response body just for grins).  When you configure a panel (the 
> youtube videos they provide are important here) and select a metric , it 
> will do an OPTIONS and then a POST.
>
> I had put some CORS headers into my response, because FF is seeing me 
> return data when it accesses the Gravana server.   [Sidebar question:  does 
> the book cover anything about valid CORS?  I didn't find it if it's there; 
> fortunately, there were some good posts in the GG archive.  The book does 
> have little bits about providing protection against against black-hat 
> CORS.]  The request to me seems to come from the client JS -- since it 
> shows in the network panel -- but FF gives CORS errors if I don't have the 
> headers.
>
> So now I just have to make a good response to the metric requests.
>
> /dps
>
>  
I may have to force the response to ASCII, and I don't remember how to do 
that.  My JSON is currently being decoded as 36 or so objects, each a 
single character, while the fake source response is being decoded as a 
single compound object (per the FF devtool network tab), and the Grafana 
display is saying "datapoints is undefined".

My  content header line says "application/json;encoding/utf-8", theirs says 
only "application/json".

/dps


>>
>> On Tuesday, November 15, 2016 at 10:50:23 PM UTC+1, Dave S wrote:
>>>
>>> I'm trying to implement a simple json endpoint for Grafana.  Does anyone 
>>> here have experience with doing this?
>>>
>>> >> https://github.com/grafana/simple-json-datasource/blob/master/README.md>
>>>
>>> I'm looking at using @service.json, but I'm not sure how to get the body 
>>> on a /query.
>>>
>>> (The sample fake-simple-json-datasource is a server written in 
>>> javascript!  It doesn't make clear if the /query is a POST or a GET, and if 
>>> it's a GET how the body gets done.)
>>>
>>> /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] How to create RSS feed from internal table?

2016-11-22 Thread Alex Glaros
I have a web2py table, db.meeting, whose records are to be consumed by 
outside parties as an RSS feed.

In other words, people will subscribe to the RSS feed to obtain a list of 
meeting dates, times, locations and subjects.

Does anyone have an example of the syntax?  The examples in the book seem 
to use external, already-existing RSS data that is to be aggregated.

I want to to create the data from internal web2py tables.

thanks

Alex Glaros

-- 
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: 502 Bad Gateway - no tmp/web2py.socket file

2016-11-22 Thread Richard Brown
Thanks for the reply. The key word here is obviously 'should' - but is it 
something that should have happened or something I should have done, and 
how do I resolve it? I used the 'one step deployment' script as thought it 
would do everything I need to get Web2py working.

Richard

On Tuesday, November 22, 2016 at 7:19:25 PM UTC, Niphlod wrote:

> that should be generated by the uwsgi daemon
>
> On Tuesday, November 22, 2016 at 6:34:40 PM UTC+1, Richard Brown wrote:
>>
>> I've just tried to do a new install of Web2py on a Raspberry Pi 3 having 
>> been using it under Apache on a Model B for a few years now. I used the 
>> script "setup-web2py-nginx-uwsgi-ubuntu.sh" which seems to have done most 
>> things correctly, but when I try to access the site I get a '502 Bad 
>> Gateway' error in my browser and the following error in 
>> /var/log/nginx/error.log:
>>
>> 2016/11/22 16:41:30 [crit] 648#0: *1 connect() to 
>> unix:///tmp/web2py.socket failed (2: No such file or directory) while 
>> connecting to upstream, client: 192.168.1.65, server: raspberrypi, request: 
>> "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/web2py.socket:", host: 
>> "192.168.1.60"
>>
>> There is no web2py.socket file in the /tmp directory or anywhere else 
>> that I can find. I can see where the script sets up the path to this file 
>> but nothing about how the file itself should get there. Where do I find 
>> this file, or should the configuration point to a different file?
>>
>> Thanks,
>>
>> Richard
>>
>

-- 
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: custom widget - why is value empty even though it was set with form.vars.fieldname = something?

2016-11-22 Thread Leonel Câmara
That should work, it's probably a bug with the javascript code you're using 
to set the hidden input which isn't doing its job.

-- 
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] custom widget - why is value empty even though it was set with form.vars.fieldname = something?

2016-11-22 Thread Toby
I'm having an issue where "value" is empty inside my custom widget. I have 
a field in my database that uses a custom dropdown widget:

Field('color_scheme', 'string', 
requires=IS_IN_SET(color_schemes.COLOR_SCHEME_NAMES),
  widget=color_choice_widget),

I create a form using form=SQLFORM(...) and then I set the default value of 
the color_scheme with:
form.vars.color_scheme = DEFAULT_COLOR_SCHEME

In my custom widget, I want to read the current value so that I can apply 
certain styling to the selected value in the dropdown. But value=None 
inside my widget. Any idea what's going on?

The custom dropdown widget is something like this:
def color_choice_widget(field, value):
"""
Widget for the color scheme dropdown menu
"""
print value # Why does this print "None"?
return \
DIV(
# This DL is what the user sees
TAG['dl'](
,
_class="dropdown", _id="color_dropdown",
),
# This hidden INPUT is what actually gets submitted, and has 
value set by javascript
INPUT(_name=field.name,
  _class=field.type,
  _id="%s_%s" % (field._tablename, field.name),
  _value=value,
  requires=field.requires)
)

Thanks in advance for any advice on what I'm missing

Toby

-- 
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: 502 Bad Gateway - no tmp/web2py.socket file

2016-11-22 Thread Niphlod
that should be generated by the uwsgi daemon

On Tuesday, November 22, 2016 at 6:34:40 PM UTC+1, Richard Brown wrote:
>
> I've just tried to do a new install of Web2py on a Raspberry Pi 3 having 
> been using it under Apache on a Model B for a few years now. I used the 
> script "setup-web2py-nginx-uwsgi-ubuntu.sh" which seems to have done most 
> things correctly, but when I try to access the site I get a '502 Bad 
> Gateway' error in my browser and the following error in 
> /var/log/nginx/error.log:
>
> 2016/11/22 16:41:30 [crit] 648#0: *1 connect() to 
> unix:///tmp/web2py.socket failed (2: No such file or directory) while 
> connecting to upstream, client: 192.168.1.65, server: raspberrypi, request: 
> "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/web2py.socket:", host: 
> "192.168.1.60"
>
> There is no web2py.socket file in the /tmp directory or anywhere else that 
> I can find. I can see where the script sets up the path to this file but 
> nothing about how the file itself should get there. Where do I find this 
> file, or should the configuration point to a different file?
>
> Thanks,
>
> Richard
>

-- 
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 DAL decode_credentials=True can't work for task scheduler worker?

2016-11-22 Thread Niphlod
scheduler just accepts a DAL connection as a parameter. 
There's no way that db connection can work for the web process and not the 
scheduler one.

On Monday, November 21, 2016 at 4:42:55 PM UTC+1, DengFeng Mao wrote:
>
> I am using web2py Version 2.14.3-stable+timestamp.2016.03.26.23.02.02 with 
> Mysql
> There is '@' in mysql password, Then I set  decode_credentials=True in DAL.
> The web access and mysql access work well.
> Then I tried to add a task scheduler. The db table 'db.scheduler_task' , 
> 'db.scheduler_run', 'db.scheduler_worker' tables were created automatically 
> by the database migration.
> Question was coming when I tried to start a worker process with the 
> following command:
>  ./web2py  -K  myapp
>
> The error like this:
> -
> RuntimeError: Failure to connect, tried 5 times:
> OperationalError: (1045, u"Access denied for user   ...
> ---
>
> It confused me. There is no any issue for the web access database.  But 
> scheduler worker process can't connect database.
> Why?  I had thought  both web and scheduler worker use the same DAL 
> connection
>
> I tired mysql password without '@' and  DAL decode_credentials=False.
> scheduler worker process can connect database as expectation. But it 
> complaint
> ---
> InternalError: (1050, u"Table 'auth_user' already exists")
> 
>
> I know , I should set 'migrate=False' for the table 'auth_user'. But I 
> wonder why the web access process didn't complain that error?
> Only scheduler worker process complaint  it
>

-- 
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: what is in the cache ?

2016-11-22 Thread Niphlod
in redis terms (which will set an expire timing accordingly) doesn't make 
much sense. 

In the default implementation, which never expires anything, time_expire=0 
basically means "update that key".

On Monday, November 21, 2016 at 4:30:07 PM UTC+1, Pierre wrote:
>
> I understand  use-cases for 
> time_expire=None
>
>
> but I don't see a use-case for 
> time_expire=0
>
>
>
> when you do  
> cache.redis('message', lambda: 'Hello', time_expire=0)
>
> all the subsequent *cache.redis('message',)* will overwrite Hello
>
> to get a persistent Hello you have to write something like:
>
> cache.redis('message', None)
> cache.redis('message',lambda: 'Hello', time_expire=None)
>
>

-- 
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] 502 Bad Gateway - no tmp/web2py.socket file

2016-11-22 Thread Richard Brown
I've just tried to do a new install of Web2py on a Raspberry Pi 3 having 
been using it under Apache on a Model B for a few years now. I used the 
script "setup-web2py-nginx-uwsgi-ubuntu.sh" which seems to have done most 
things correctly, but when I try to access the site I get a '502 Bad 
Gateway' error in my browser and the following error in 
/var/log/nginx/error.log:

2016/11/22 16:41:30 [crit] 648#0: *1 connect() to unix:///tmp/web2py.socket 
failed (2: No such file or directory) while connecting to upstream, client: 
192.168.1.65, server: raspberrypi, request: "GET / HTTP/1.1", upstream: 
"uwsgi://unix:///tmp/web2py.socket:", host: "192.168.1.60"

There is no web2py.socket file in the /tmp directory or anywhere else that 
I can find. I can see where the script sets up the path to this file but 
nothing about how the file itself should get there. Where do I find this 
file, or should the configuration point to a different file?

Thanks,

Richard

-- 
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] Re: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-22 Thread Mark Graves
That is truly strange.  Seems to be a distinct confound.

Greatly appreciated work.



On Tue, Nov 22, 2016 at 7:27 AM, Anthony  wrote:

> On Tuesday, November 22, 2016 at 8:16:16 AM UTC-5, Mark Graves wrote:
>>
>> If I'm reading that correctly, doesn't that show web2py standard and
>> optimized  top 3?
>>
>> Wouldn't that suggest a massive performance difference cloud vs baremetal?
>>
>
> On all the tasks, all the frameworks do better on bare metal than on Azure
> -- the only exception is web2py on the 20-update requests of the "Data
> updates" task, and that appears to be due to some kind of errors being
> generated, not a general cloud vs. bare metal performance difference.
> Beyond that, I don't have much idea what was happening there.
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/I6wii5TFERY/unsubscribe.
> To unsubscribe from this group and all its topics, 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: password validator

2016-11-22 Thread Anthony
def user():
if request.args(0) == 'login':
custom_auth_table.password.requires.pop(0)
return dict(form=auth())

The default password validator is CRYPT(key=settings.hmac_key, 
min_length=settings.password_min_length), and the auth.login() method 
automatically resets the min_length parameter to 0 during login. But if you 
are using your own validators, you are responsible for changing them for 
login if necessary.

Anthony

On Tuesday, November 22, 2016 at 7:47:42 AM UTC-5, Marvix wrote:
>
> Hello, 
>
> start using web2py for a production application. Very satisfied with it!!
>
> Just a question, I added this:
>
> custom_auth_table.password.requires =  [IS_STRONG(min=8, special=2, 
> upper=3), CRYPT()]
>  
> but it seems that the validator is applied not only in the change password 
> form but also in the "normal" login form. 
>
> I don't know if this is the desired way, but it can lead to unwanted side 
> effects, for example:
>
> at some point the administrator decide to improve the strength of the 
> password, so the above line of code is changed for example in: (min=10, 
> special=3, upper=4).
> After that many users will not be able to login again and they are all 
> forced to change the password immediatly. I think this may problematic.
>
> second case (and this is my case...):
> the system have 2 distinct authorization systems. The "normal auth DB" 
> system and an LDAP system. 
> on the LDAP system the rules of the password are different, so a password 
> accepted by LDAP may not be ok with the requirements of the web2py 
> validators. 
> In this case an LDAP user, with a "good" LDAP password could not be 
> accepted in the web2py application, and could be problematic to explain to 
> users that password accepted for the LDAP system are not accepted in the 
> web2py application. 
>
> Would be better to check the strength of the password only in the "change 
> password" form? so the above rule is applied to the web2py password and not 
> to the LDAP ones?
> or, if this not the desired default behaviour, is there a way to manually 
> configure not to apply the validator on the login form?
>
> Thanks, 
> Marvi
>
>
>
>
>

-- 
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] Re: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-22 Thread Anthony
On Tuesday, November 22, 2016 at 8:16:16 AM UTC-5, Mark Graves wrote:
>
> If I'm reading that correctly, doesn't that show web2py standard and 
> optimized  top 3?
>
> Wouldn't that suggest a massive performance difference cloud vs baremetal?
>

On all the tasks, all the frameworks do better on bare metal than on Azure 
-- the only exception is web2py on the 20-update requests of the "Data 
updates" task, and that appears to be due to some kind of errors being 
generated, not a general cloud vs. bare metal performance difference. 
Beyond that, I don't have much idea what was happening there.

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.


Re: [web2py] Re: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-22 Thread Mark Graves
If I'm reading that correctly, doesn't that show web2py standard and
optimized  top 3?

Wouldn't that suggest a massive performance difference cloud vs baremetal?

That would be super strange, but I could be mistaken.

Would love to get a look at the errors  etc

On Mon, Nov 21, 2016 at 3:36 PM, Anthony  wrote:

> On Monday, November 21, 2016 at 2:39:21 AM UTC-5, Mark Graves wrote:
>>
>> This is great news! Thank you for working on this, all of you.
>>
>> Any ability to check out the errors?
>>
>
> Not that I know of. Note, the errors occurred only on the 20-update
> requests when running on physical hardware (I know, technically everything
> is ultimately running on "physical hardware"). They also ran tests in the
> cloud (on Azure), and there web2py was very competitive, even with the
> 20-update requests. See:
>
> https://www.techempower.com/benchmarks/#section=data-r13;
> hw=cl=update=4ftgjj=35s-0=4=6=0-jz6rk-
> 4fti4g-0-9zldvk-1ekg-2
>
> In general, I think web2py's *relative *performance was slightly better
> on Azure vs. the physical hardware tests.
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/I6wii5TFERY/unsubscribe.
> To unsubscribe from this group and all its topics, 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] password validator

2016-11-22 Thread Marvix
Hello, 

start using web2py for a production application. Very satisfied with it!!

Just a question, I added this:

custom_auth_table.password.requires =  [IS_STRONG(min=8, special=2, 
upper=3), CRYPT()]
 
but it seems that the validator is applied not only in the change password 
form but also in the "normal" login form. 

I don't know if this is the desired way, but it can lead to unwanted side 
effects, for example:

at some point the administrator decide to improve the strength of the 
password, so the above line of code is changed for example in: (min=10, 
special=3, upper=4).
After that many users will not be able to login again and they are all 
forced to change the password immediatly. I think this may problematic.

second case (and this is my case...):
the system have 2 distinct authorization systems. The "normal auth DB" 
system and an LDAP system. 
on the LDAP system the rules of the password are different, so a password 
accepted by LDAP may not be ok with the requirements of the web2py 
validators. 
In this case an LDAP user, with a "good" LDAP password could not be 
accepted in the web2py application, and could be problematic to explain to 
users that password accepted for the LDAP system are not accepted in the 
web2py application. 

Would be better to check the strength of the password only in the "change 
password" form? so the above rule is applied to the web2py password and not 
to the LDAP ones?
or, if this not the desired default behaviour, is there a way to manually 
configure not to apply the validator on the login form?

Thanks, 
Marvi




-- 
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] scheduling multiple tasks

2016-11-22 Thread Vid Ogris
There is no errors, the file is read etc. The task's status is always
TIMEOUT, although the first time I call it is executed correctly.

Then I delete the values of the fields the task manipulates with and the
second time around values are not inserted and also there is no error or
anything in the tables.

any suggestiions?


2016-11-21 15:00 GMT+08:00 Nico de Groot :

> Hi Vid,
>
> Two remarks at first sight.
>
> In save_outs you initialize the variable now. But you queue the task using
> start_now. But the task is inserted, maybe just copy paste error in your
> post...
>
> Is the function readOutFile working? Can you show It? It seems it gets
> stuck when called the second time. I would suggest to step through the code
> using the debugger, or use print statement to pinpoint the timeout.
>
> Nico
>
> Op za 19 nov. 2016 om 05:41 schreef Vid Ogris 
>
>> SO the problem continues.
>>
>> The task was running  and was completed for some dummy code.
>>
>> Now i have to go trough a folder, read a file and update file content to
>> database.
>>
>> The task always times out and there are two files that need to be
>> updated, non of them are. The code is executed, but there is no db update.
>> Also it seems for loop is not completed. For only one file db._lastsql is
>> printed in db. The statement in scheduler table is ok and if i run it it
>> inserts data into db. Any suggestions?
>>
>> My code
>>
>> in scheduler.py
>>
>> def saveIdOut():
>> try:
>> #demo koda
>> #poberem statuse
>> db_status = db(db.scripts.sc_status == 
>> 11).select(db.scripts.id).as_list()
>> #ggrem v mapo in pogledam katere skripte ki imajo status 11 se 
>> dejansko izvajajo
>> for rec in db_status:
>> scriptId = rec["id"]
>> outPath  = os.path.join(request.folder, 'engine', 'e1', 
>> str(scriptId) + '.out')
>> #preverim če obstaja datoteka
>> if os.path.isfile(outPath):
>> #če obstaja jo shranim v sc_engine_output
>> #sparsamo out datoteko da jo lahko damo v tabelo result
>> out = readOutFile(str(scriptId))
>> #Vnesemo podatke v tabelo script
>> db(db.scripts.id == scriptId).update(sc_engine_output = out)
>> print db._lastsql
>>
>> print "out datoteka za scripto %s, arhivirana" % 
>> (str(scriptId))
>>
>> db.commit()
>> return dict(status = 1)
>>
>> except Exception, e:
>> exc_type, exc_obj, exc_tb = sys.exc_info()
>> fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
>> print(exc_type, fname, exc_tb.tb_lineno)
>> print e.__doc__
>> print e.message
>> return dict(status = 666)
>>
>>
>> in my controler
>>
>> def save_outs():
>>
>>
>> """
>> for running scheduler
>> python web2py.py --nogui --no-banner -K woshiweb -D 0
>>
>> 1 hour = 3600 seconds # for period
>> 10 minutes = 600 seconds # for timeout
>> """
>>
>> import datetime
>> now = datetime.datetime.now()
>>
>>
>> start_now = datetime.datetime.now()
>>
>> stop_time_now = (start_now + datetime.timedelta(days = 1))
>>
>> scheduler.queue_task(saveIdOut, start_time = start_now,
>>
>>
>>next_run_time = start_now, stop_time = stop_time_now,
>>
>>repeats = 0, retry_failed = 2, period = 30, timeout = 15)
>>
>> print "Funkcija za arhiviranje outov AKTIVIRANA"
>> print "Glej scheduler tabele v postgresu"
>> session.flash = T("Task save_outs Queued")
>> redirect(URL('index.html'))
>>
>>
>> 2016-11-16 2:32 GMT+08:00 Dave S :
>>
>>
>>
>> On Tuesday, November 15, 2016 at 2:14:21 AM UTC-8, Yebach wrote:
>>
>> Thank you guys. I finally made it. I did not quite understand the whole
>> scheduler process but i am now getting there.
>>
>> Thank you again
>>
>>
>> Congratulations!  It sometimes takes a while to get the right mental
>> images, doesn't it?
>>
>> /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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/web2py/FK1ygjNNjDU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Lep pozdrav
>>
>> Vid Ogris
>>
>>
>> --
>> 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 

[web2py] Re: Pls Help. I can not change the background color of the flash message

2016-11-22 Thread quesada . ostos
thx!!

El lunes, 28 de marzo de 2011, 6:12:52 (UTC+2), pbreit escribió:
>
> Isn't it this CSS in static/css/base.css? Also, If you have any interest 
> in CSS, Chrome/Safari have an "Inspect Element" command and Firefox has the 
> terrific Firebug add on. These are all must-have tools for working with web 
> page styles.
>
>
> /*** web2py specific ***/
> div.flash {
> font-weight: bold;
> display: none;
> position: fixed;
> padding: 10px;
> top: 40px;
> right: 10px;
> min-width: 280px;
> opacity: 0.85;
> margin: 0px 0px 10px 10px;
> color: #fff;
> vertical-align: middle;
> cursor: pointer;
> background: #000;
> border: 2px solid #fff;
> -moz-border-radius: 5px;
> -webkit-border-radius: 5px;
> z-index: 2;
> }
> div.error {
> background-color: red;
> color: white;
> padding: 3px;
> }
>

-- 
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] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-22 Thread António Ramos
All is well now but i noticed that in my languages file for exampe pt.py
i have one key with all the html from my email_verification.html

is this ok?



2016-11-21 17:08 GMT+00:00 António Ramos :

> oops... :)
>
> rewinding my head again to the top of the thread.
>
> Thank you Leonel...
>
> 2016-11-21 17:07 GMT+00:00 Leonel Câmara :
>
>> Ramos you need to escape the % in 100%
>>
>> This should work
>>
>> b="\r\n\r\n  \r\n
>>  \r\n  \r\n
>> *%(a)s*\r\n\r\n\r\n\r\n> >\r\n\r\n\r\n"
>>
>> b % dict(a=1)
>>
>> --
>> 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] posibility to disable the mobile admin interface

2016-11-22 Thread Oli
is there a posibility to disable the mobile interface? there is only a white 
screen on pythonanywhere.com with web2py version 2.14.6 .

-- 
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.