[web2py] One-time account

2016-08-04 Thread Dave S
For support issues, I can imagine having a "one time account".  That is, 
the account is created, info sent to the person-being-supported, p-b-s logs 
in and gets a form page to do what needs to be done, and then is logged out 
and the account disabled.  Any good way to do that without having an admin 
sitting around watching for p-b-s to show up?

I would probably prefer (as a potential p-b-s) to have a time-limited 
account, where the login queues a scheduler task that in n hours or n days 
or whatever does the disabling.  That way, if p-b-s messes up on the first 
try at the form, there's a grace period for getting it right.  But the 
original scheme could mostly handle that by having an admin (or support 
person) re-enable the account.  If the support person is the one who 
recognizes the error, that would be a natural way of handling it.

Thoughts?

/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: Using scheduler with facebook api calls

2016-08-04 Thread Dave S


On Thursday, August 4, 2016 at 1:17:04 PM UTC-7, Andre wrote:
>
> Thank you for the thoughtful response - some great points I need to mull 
> over some more.
>
> I think there needs to be a Niphlod tip jar.
>


I think the way we can best make him happy is by adding test coverage.  (I 
have that on my list, but I'm not yet over-achieving. )

/dps


> On Wednesday, August 3, 2016 at 4:29:20 PM UTC-4, Niphlod wrote:
>>
>> 15 minutes is a LOT for expecting a reply from an external source: sure 
>> you can't reduce that timespan (maybe using "cascading" steps) ? 
>> Assume this when working with ANY task-queue solution: if your 15 minutes 
>> task fails at the 14th minute, you wasted 14 minutes for nothing. It holds 
>> especially true for anything calling external resources (that may very well 
>> be unavailable for some time, e.g. network hiccups). If instead you can 
>> break up that in 5 steps of 3 minutes each, you "waste" 3 minutes at most. 
>> When you face a possibly-parallelizable scenario (which is quite often true 
>> in task-queue solutions), you get the additional benefit of being able to 
>> balance among available "processors" each and every step. 
>>
>> That being said a few points on "sizing" the scheduler processes: the 
>> "standard" scheduler can't really support more than 20-30 workers (no 
>> SQLite, please! :P). Yep, with 50, they'll be running, but they won't churn 
>> more tasks than 20, and they'll bash your backend pretty heavily. The 
>> "redis-backed" one works always better, but with this, too, won't get you 
>> more than 50. Now that you have the MAX limit, let's speak about what 
>> really matters, that is how many concurrent tasks you'll need. 
>> A single worker can process a task at a time. But it will happily process 
>> 5 tasks per second (given the task ACTUALLY processes something, and 
>> doesn't wait around): this translates to a single worker processing 300 
>> tasks per minute, if they are already queued and fast.
>> The "sweet point" you want to reach (assuming all you queue needs to be 
>> processed as soon as you queue it) is where you have at least one worker 
>> available to do the actual job (i.e. you have one "slot" available at the 
>> moment you queue tasks).
>> Let's say you are in the lower-end on the "sweet point", and assume every 
>> task ends takes 5 minutes, with only one worker available (the others are 
>> churning a task already)...you queue a task, and the result will be 
>> available in 5 minutes. During that period, any other queued task won't be 
>> processed, and if you queue 2 tasks at the same time, the result of the 
>> second queued task will be available in 10 minutes, unless some workers 
>> frees itself because another task has been completed.
>> With 4 available workers, you can basically queue 4 tasks at the same 
>> time and get back each result within 5 minutes. The fifth queued tasks' 
>> results will be available in 10 minutes (again, unless some other workers 
>> frees themselves).
>>
>> Going up the ladder one more step, from personal experience...I feel 
>> inclined to say that if your users are willing to wait from 30 seconds to 
>> 15 minutes, I'd hardly spin up lots of workers and leave them without work 
>> to do: IMHO anything that goes on the upper end of 2 minutes doesn't need 
>> to get reported to the user in 2 minutes for the simple fact it won't be 
>> around to read it 2 minutes later (they probably went somewhere else in the 
>> meantime and they'll be back maybe in 10 minutes, maybe the next day). A 
>> simple mail at the conclusion of the whole process with "hey, the thing you 
>> wanted is ready" seals the deal. 
>>
>> tl;dr: staying on the "lower" side won't consume unneeded resources and 
>> EVEN if the task took only 5 minutes to process for some users AND your 
>> server spitted up the result after 10 because it was busy processing some 
>> other user's tasks.
>>
>> On Sunday, July 31, 2016 at 6:42:13 PM UTC+2, Andre wrote:
>>>
>>> Hi,
>>>
>>> I've created a website that utilizes the facebook api and I'd like to 
>>> move my facebook requests out of the webserver request handling loop. I've 
>>> played around with the scheduler and I have a working prototype in place 
>>> however I'm not sure how many workers I should spawn for the scheduler. 
>>> Between waiting for a response from facebook and processing the results, 
>>> these "processes" can take as little as 30 seconds to upwards of 15 
>>> minutes. Anyone else run into a similar problem? Would the built-in 
>>> scheduler be appropriate to use? I'm thinking of just spawning a bunch of 
>>> workers (25-50 or so?)... and using trial and error to hone in the right 
>>> number.
>>>
>>> -Andre
>>>
>>

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

[web2py] Re: Using scheduler with facebook api calls

2016-08-04 Thread Andre
Thank you for the thoughtful response - some great points I need to mull 
over some more.

I think there needs to be a Niphlod tip jar.

On Wednesday, August 3, 2016 at 4:29:20 PM UTC-4, Niphlod wrote:
>
> 15 minutes is a LOT for expecting a reply from an external source: sure 
> you can't reduce that timespan (maybe using "cascading" steps) ? 
> Assume this when working with ANY task-queue solution: if your 15 minutes 
> task fails at the 14th minute, you wasted 14 minutes for nothing. It holds 
> especially true for anything calling external resources (that may very well 
> be unavailable for some time, e.g. network hiccups). If instead you can 
> break up that in 5 steps of 3 minutes each, you "waste" 3 minutes at most. 
> When you face a possibly-parallelizable scenario (which is quite often true 
> in task-queue solutions), you get the additional benefit of being able to 
> balance among available "processors" each and every step. 
>
> That being said a few points on "sizing" the scheduler processes: the 
> "standard" scheduler can't really support more than 20-30 workers (no 
> SQLite, please! :P). Yep, with 50, they'll be running, but they won't churn 
> more tasks than 20, and they'll bash your backend pretty heavily. The 
> "redis-backed" one works always better, but with this, too, won't get you 
> more than 50. Now that you have the MAX limit, let's speak about what 
> really matters, that is how many concurrent tasks you'll need. 
> A single worker can process a task at a time. But it will happily process 
> 5 tasks per second (given the task ACTUALLY processes something, and 
> doesn't wait around): this translates to a single worker processing 300 
> tasks per minute, if they are already queued and fast.
> The "sweet point" you want to reach (assuming all you queue needs to be 
> processed as soon as you queue it) is where you have at least one worker 
> available to do the actual job (i.e. you have one "slot" available at the 
> moment you queue tasks).
> Let's say you are in the lower-end on the "sweet point", and assume every 
> task ends takes 5 minutes, with only one worker available (the others are 
> churning a task already)...you queue a task, and the result will be 
> available in 5 minutes. During that period, any other queued task won't be 
> processed, and if you queue 2 tasks at the same time, the result of the 
> second queued task will be available in 10 minutes, unless some workers 
> frees itself because another task has been completed.
> With 4 available workers, you can basically queue 4 tasks at the same time 
> and get back each result within 5 minutes. The fifth queued tasks' results 
> will be available in 10 minutes (again, unless some other workers frees 
> themselves).
>
> Going up the ladder one more step, from personal experience...I feel 
> inclined to say that if your users are willing to wait from 30 seconds to 
> 15 minutes, I'd hardly spin up lots of workers and leave them without work 
> to do: IMHO anything that goes on the upper end of 2 minutes doesn't need 
> to get reported to the user in 2 minutes for the simple fact it won't be 
> around to read it 2 minutes later (they probably went somewhere else in the 
> meantime and they'll be back maybe in 10 minutes, maybe the next day). A 
> simple mail at the conclusion of the whole process with "hey, the thing you 
> wanted is ready" seals the deal. 
>
> tl;dr: staying on the "lower" side won't consume unneeded resources and 
> EVEN if the task took only 5 minutes to process for some users AND your 
> server spitted up the result after 10 because it was busy processing some 
> other user's tasks.
>
> On Sunday, July 31, 2016 at 6:42:13 PM UTC+2, Andre wrote:
>>
>> Hi,
>>
>> I've created a website that utilizes the facebook api and I'd like to 
>> move my facebook requests out of the webserver request handling loop. I've 
>> played around with the scheduler and I have a working prototype in place 
>> however I'm not sure how many workers I should spawn for the scheduler. 
>> Between waiting for a response from facebook and processing the results, 
>> these "processes" can take as little as 30 seconds to upwards of 15 
>> minutes. Anyone else run into a similar problem? Would the built-in 
>> scheduler be appropriate to use? I'm thinking of just spawning a bunch of 
>> workers (25-50 or so?)... and using trial and error to hone in the right 
>> number.
>>
>> -Andre
>>
>

-- 
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] Problems with DAL and mysql

2016-08-04 Thread Morganti
Hello everybody!

I am developing using directly to Mysql. For testing with some scripts, I 
was using python interpreter and  defining only tables that it was needed. 
But I have a problem today, when I went to appadmin to check some data, I 
lost the tables, I mean, I had 18 tables and passed to have only 2 and 
these two were not being used in python interpreter.
I had similiar problems in the past but I droped the table directly in 
phpmyadmin and I thought because of that I missed something between DAL and 
mysql, but now, I just was using appadmin and DAL in python interpreter.
As I did in that time, I created another database in mysql trying to use 
appadmin to create the tables again. It just created the same of two tables 
that I said.
I turned to try to use SQLite and again, only these two tables, but I 
changed nothing in the table definition.
I created another project and copied objects, I mean, model, controller, 
view one by one and used Sqlite. Now, the tables where created normally. I 
did not change anything in models.
I thought I had something wrong in models, but, after to create another 
project and copied all objects one by one, the application became to run 
normally
My intention is to use Mysql in Pythonanywhere. My afraid is to have this 
problem in production environment. 

Thanks your supporting.
BR
André

-- 
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: URL based internationalization and pattern router

2016-08-04 Thread Anthony


> In that way we can move the code to a new application, and use a complete 
> different urls without change one single line of code.
>

Move what code to a new application? In web2py, you can also change the 
URLs without changing the application code, though as noted, in some cases, 
the route patterns must know in what order to expect particular parameters 
from the application. Ultimately, though, routes are going to be inherently 
coupled to the application, as the routes must use identifiers recognized 
by the application.

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: URL based internationalization and pattern router

2016-08-04 Thread Anthony
On Sunday, July 31, 2016 at 5:31:47 PM UTC-4, Massimo Di Pierro wrote:
>
> Can you point to any other web framework that allows reverse mapping 
> path_info into query_string?
>

Looks like Yii does allow this. Its URL helper allows you to specify named 
parameters. Rather than putting all named parameters in a query string (as 
web2py would via the "vars" argument), it instead allows you to include 
parameter names in the route patterns, placing the associated values in the 
positions of the parameter names within the pattern (only parameter names 
that do not appear in the route pattern are added to the query string). 
web2py instead distinguishes between "args" (which go in the URL path) and 
"vars" (which go in the query string), and does not allow mapping of "vars" 
into the outgoing URL path (though incoming elements from the path can be 
mapped into request.get_vars).

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: URL based internationalization and pattern router

2016-08-04 Thread Anthony
On Wednesday, August 3, 2016 at 2:00:08 AM UTC-4, Carlos Cesar Caballero 
wrote:
>
> Hi, first sorry for the late reply, but I am on vacations and offline most 
> of the time.
>
> Here is an example on how we use the Yii2 framework router:
>
> 'urlManager' => [
> 'class' => \frontend\components\UrlManager::className(),
> 'enablePrettyUrl' => true,
> 'showScriptName' => false,
> //'suffix' => '.daxs',
> 'rules' => [
> //contact
> ['pattern' => 'contact', 'route' => '/site/contact/', 
> 'defaults' => ['lang' => 'en-US']],
> ['pattern' => 'contactarme', 'route' => '/site/contact/', 
> 'defaults' => ['lang' => 'es']],
> //about
> ['pattern' => 'en/about', 'route' => '/blog/post/view/', 
> 'defaults' => ['lang' => 'en-US', 'postSlug' => 'about']],
> ['pattern' => 'es/acerca-de', 'route' => 
> '/blog/post/view/', 'defaults' => ['lang' => 'es', 'postSlug' => 
> 'acerca-de']],
> //curriculum
> ['pattern' => 'en/curriculum', 'route' => 
> '/blog/post/view/', 'defaults' => ['lang' => 'en-US', 'postSlug' => 
> 'curriculum-2']],
> ['pattern' => 'es/curriculum', 'route' => 
> '/blog/post/view/', 'defaults' => ['lang' => 'es', 'postSlug' => 
> 'curriculum']],
> //feed
> ['pattern' => 'en/feed', 'route' => '/blog/post/feed', 
> 'defaults' => ['lang' => 'en-US'], 'suffix' => ".xml"],
> ['pattern' => 'es/canal', 'route' => '/blog/post/feed', 
> 'defaults' => ['lang' => 'es'], 'suffix' => ".xml"],
> //categories
> ['pattern' => 'en/', 'route' => 
> '/blog/post/category', 'defaults' => ['lang' => 'en-US']],
> ['pattern' => 'es/', 'route' => 
> '/blog/post/category', 'defaults' => ['lang' => 'es']],
> //articles
> ['pattern' => 'en//', 'route' => 
> '/blog/post/view', 'defaults' => ['lang' => 'en-US']],
> ['pattern' => 'es//', 'route' => 
> '/blog/post/view', 'defaults' => ['lang' => 'es']],
> ]
> ]
>
> As you can see, there is no need of routes in and routes out, it 
> automatically build in and out based on the rules,
>

Note, in web2py, you can write code to automatically build routes_out based 
on routes_in (this is particularly simple when using the $placeholder 
syntax rather than regular expressions). I think Yii is able to do this 
automatically because it does not allow arbitrary regular expressions 
anywhere in the URL, and where it does allow regular expressions, they are 
paired with parameter names to identify them.

In that way we can move the code to a new application, and use a complete 
> different urls without change one single line of code.
>

I think the only thing web2py can't easily do is map named parameters to 
particular path info positions when generating *outgoing *URLs (it can 
handle this for incoming URLs). You can use URL args to specify elements of 
the path, but the app code must specify the *order *of the items, which 
means the order cannot be changed without changing the app code. However, 
mapping named parameters to specific positions in the path can be kluged as 
follows:

routes_in = (
('/myapp/default/index/(?P[\w-]+)/(?P[\w-]+)',
 '/myapp/default/index?varA=\g=\g'),
)

routes_out = (
('/myapp/default/index/varA_(?P[\w-]+)/varB_(?P[\w-]+)',
 '/myapp/default/index/\g/\g'),
)

You would then create a URL like this:

URL('default', 'index', args=['varA_Value-A', 'varB_Value-B'])

and you will get:

/myapp/default/index/Value-B/Value-A

which when clicked will take you to the index function in the default 
controller, with request.get_vars = {'varA': 'Value-A', 'varB': 'Value-B'}.

Now you can change the order of varA and varB in the incoming/outgoing URL 
path by editing the routes only without touching the app code.

Anyway, aside from the issue of keeping the order of the elements of the 
URL path independent of the app code, I think the web2py rewrite system can 
accommodate your requirements. And of course, you could always write a 
custom URL helper to generate the outgoing URLs however you like -- this 
would obviously take a bit more work, but it would be a one-time effort.

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] Web2py and WebRTC?

2016-08-04 Thread 'Fernando Villarroel' via web2py-users
Thank you Antonio

Enviado desde mi iPhone

> El 04-08-2016, a las 4:51, António Ramos  escribió:
> 
> https://www.youtube.com/watch?v=MUWy-NSrvNQ
> 
> 2016-08-03 19:26 GMT+01:00 'Fernando Villarroel' via web2py-users 
> :
>> Dear.
>> 
>> I think the deploy coments use a server like Asterisk or FreeSWITCH.
>> 
>> So the deploy from Django surely use some library JavaScript for comunícate 
>> browsers like sip.js or another with websocket server (Asterisk or 
>> FreeSWITCH ).
>> 
>> Regarding about webrtc i deploy a server webrtc using FreeSWITCH 1.6
>> 
>> https://freeswitch.org/confluence/plugins/servlet/mobile#content/view/7144556
>> 
>> But i need know how i can do a websocket call to a single peer (browser 
>> user) from the server ws (FreeSWITCH); peer to peer
>> 
>> From web2py i know that i can use tornado; but i do know how i can do
>> 
>> Anyone could me some example?
>> 
>> Regards
>> 
>> Enviado desde mi iPhone
>> 
>>> El 03-08-2016, a las 10:14, Ron Chatterjee  
>>> escribió:
>>> 
>>> Have you implemented something similar webrtc + 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.
> 
> -- 
> 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] select() and iterselect()

2016-08-04 Thread 黄祥
trying to change select() with iterselect() on all of my code, some work 
and some not work. 
in select() can check if len(rows_2) > 0: on the other side iterselect() if 
rows_2:
*error traceback*

Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 227, in 
restricted
exec ccode in environment
  File 
"/Users/MacBookPro/site/web2py/applications/mutualfunds/views/report/report_currency.html",
 line 109, in 
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", 
line 2761, in __iter__
row = next(self)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", 
line 2739, in __next__
db_row = self.cursor.fetchone()
ProgrammingError: Cannot operate on a closed cursor.


*the code in file generated around line 109 is marked bold red color  :*

for row_pie in rows_2:
response 
.write("\r\n   
 ['", escape=False)
response .write(T 
(row_pie.product.name))
response 
.write("', ", escape=False)
response 
.write(row_pie.subscription_amount)
response .write(' 
],\r\n', escape=False)
pass
response .write("\r\n  
  ]\r\n}],\r\ntitle: {\r\n
text: '", escape=False)
response .write(T 
('Subscription'))
response 
.write('\'\r\n
},\r\ntooltip: {\r\npointFormat: \'{series.name} : Rp. {point.y:,.2f} 
({point.percentage:.1f} %)\'\r\n}\r\n});\r\n   
 \r\n// pie balance\r\n$(\'#pie_balance\').highcharts({\r\n 
   credits: {\r\nenabled: false\r\n},\r\n   
 plotOptions: {\r\npie: {\r\n
allowPointSelect: true,\r\ncursor: \'pointer\',\r\n 
   dataLabels: {\r\nenabled: true, \r\n 
   format: \'{point.name} :Rp. {point.y:,.2f}{point.percentage:.1f} %\'\r\n},\r\n
showInLegend: true\r\n}\r\n},\r\n
series: [{\r\ntype: \'pie\',\r\nname: \'', 
escape=False)
response .write(T 
('Balance'))
response .write(" 
',\r\ndata: [\r\n", escape=False)

*for row_pie in rows_2:*response 
.write("\r\n   
 ['", escape=False)
response .write(T 
(row_pie.product.name))
response 
.write("', ", escape=False)
response 
.write(row_pie.balance)
response .write(' 
],\r\n', escape=False)
pass
response .write("\r\n  
  ]\r\n}],\r\ntitle: {\r\n
text: '", escape=False)
response .write(T 
('Balance'))
response 
.write('\'\r\n
},\r\ntooltip: {\r\npointFormat: \'{series.name} : Rp. {point.y:,.2f} 
({point.percentage:.1f} %)\'\r\n}\r\n
});\r\n\t\t\r\n// pie profit_loss_value\r\n
$(\'#pie_profit_loss_value\').highcharts({\r\ncredits: {\r\n
enabled: false\r\n},\r\nplotOptions: {\r\n  
  pie: {\r\nallowPointSelect: true,\r\n 
   cursor: \'pointer\',\r\ndataLabels: {\r\n
enabled: true, \r\nformat: 
\'{point.name} :Rp. {point.y:,.2f}{point.percentage:.1f} 
%\'\r\n},\r\nshowInLegend: true\r\n 
   }\r\n},\r\nseries: [{\r\n
type: \'pie\',\r\nname: \'', escape=False)
response 

Re: [web2py] Re: bounty pypi

2016-08-04 Thread Richard Vézina
As to remain backward compatible, I guess... A big task... Can you propose
a package three structure we should comply to... We can then identify and
list the blocking code piece then evaluate the changes requires then
implement?

I think the issue is more to map all the change needed to be done than to
do it.

Richard

On Wed, Aug 3, 2016 at 3:45 PM, Niphlod  wrote:

> The difficulty stands in findind a proper way to do it (and changing
> web2py in order to support it being used as a proper package).
> The latest attempt was a real nightmare: a simple wrapper script was
> called to bootstrap a fresh directory from a tar(red) archive but it
> clearly wasn't (nor isn't) the right solution.
> Web2py is quite accustomed to be omnipotent in its own dir, and some of
> the "crucial" files are positioned in the root (logging.conf, routes.py,
> etc), and on top of that the applications/ folder is at the same level as
> gluon is. On top of that, the current repo holds the core code, contribs,
> apps, examples, scripts, etc, that are not "properly" pythonic.
> Some time ago I pushed some changes that would help running web2py with a
> different "root" folder (we always had a -f parameter, but it was never
> "stable" enough because of the aforementioned "conventions") and the core
> code can be used as a proper package...but that doesn't cover how (and
> when, and what, and etc) do the whole "set a new environment, prepare the
> scaffolding app, etc etc etc...
>
> tl;dr: The first thing to cope with is absolutely the "design" of the
> solution.
>
>
> On Friday, July 29, 2016 at 4:09:57 PM UTC+2, Marlysson Silva wrote:
>>
>> It so much dificult? Or just incentive..
>>
>> Em sexta-feira, 29 de julho de 2016 10:59:38 UTC-3, Massimo Di Pierro
>> escreveu:
>>>
>>> I will pay $200 if you help me put a version of web2py on PyPi.
>>>
>>> --
> 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] web2py admin - cannot install plugin - bug??

2016-08-04 Thread Mirek Zvolský
I have the .w2p file on disk.
I choose it in Admin interface, edit application, plugins, upload.

Then only first file from the plugin is properly unpacked,
other files aren't.
Then the error will flash: "App does not exist or you are not authorized"

I am trying to debug it and see that
redirect to admin/default/get_app is called twice:
- first with parameter = application name --> no problem
- second call is without parameter - which causes Error message and 
redirect to admin main page.

Is this a bug?
Or what can I do better?

I have tested it with 2.14.5 and with today trunk versions.
Behavior is the same :(

-- 
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] SSL Rocket Windows 10 problem

2016-08-04 Thread icodk
Running web2py 2.14.6 with SSL and it starts fine. However  stop working 
after a while (sometimes just after login) with error:

ERROR:Rocket.Errors.Port443:Traceback (most recent call last):
  File "C:\Dev\web\web2py_win\Web2py_2_14_6\gluon\rocket.py", line 590, in 
listen
sock = self.wrap_socket(sock)
  File "C:\Dev\web\web2py_win\Web2py_2_14_6\gluon\rocket.py", line 542, in 
wrap_socket
ssl_version=ssl.PROTOCOL_SSLv23)
  File "ssl.py", line 891, in wrap_socket
  File "ssl.py", line 509, in __init__
IOError: [Errno 2] No such file or directory

I can press stop server and start server on the server dialog and it works 
again for a while

my command line is:
web2py.exe -c cert/ia.crt -k cert/ia.key -p 443

What am I missing ?



-- 
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] Web2py and WebRTC?

2016-08-04 Thread António Ramos
https://www.youtube.com/watch?v=MUWy-NSrvNQ

2016-08-03 19:26 GMT+01:00 'Fernando Villarroel' via web2py-users <
web2py@googlegroups.com>:

> Dear.
>
> I think the deploy coments use a server like Asterisk or FreeSWITCH.
>
> So the deploy from Django surely use some library JavaScript for
> comunícate browsers like sip.js or another with websocket server (Asterisk
> or FreeSWITCH ).
>
> Regarding about webrtc i deploy a server webrtc using FreeSWITCH 1.6
>
>
> https://freeswitch.org/confluence/plugins/servlet/mobile#content/view/7144556
>
> But i need know how i can do a websocket call to a single peer (browser
> user) from the server ws (FreeSWITCH); peer to peer
>
> From web2py i know that i can use tornado; but i do know how i can do
>
> Anyone could me some example?
>
> Regards
>
> Enviado desde mi iPhone
>
> El 03-08-2016, a las 10:14, Ron Chatterjee 
> escribió:
>
> Have you implemented something similar webrtc + 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.
>

-- 
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: Grid export csv

2016-08-04 Thread Kostas M

As you said, it works again now, by setting: entity_quoting=False

Thanks Niphlod!

-- 
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: DAL size limit for query?

2016-08-04 Thread cem
You may try using iterselect() instead of select() if the issue is memory 
related.

The link to the book is below.

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=Using-an-iterator-based-select-for-lower-memory-use#Using-an-iterator-based-select-for-lower-memory-use

On Thursday, August 4, 2016 at 10:35:13 AM UTC+3, goome wrote:
>
> 2016-08-04 1:08 GMT+02:00, Dave S : 
> > 
> > 
> > On Wednesday, August 3, 2016 at 2:33:35 PM UTC-7, goome wrote: 
> >> 
> >> when trying in the shell, the shell itself got killed : 
> >> >> In [4]: legacy_db(query).select() 
> >> >> 
> >> >> Killed 
> >> >> root@rb:/home/www-data/web2py# 
> >> 
> >> 
> > Is that using web2py in a bash/python shell  (i.,e., -M -S myapp) ? 
> yes, this one 
>

-- 
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: DAL size limit for query?

2016-08-04 Thread Marcello Console
2016-08-04 1:08 GMT+02:00, Dave S :
>
>
> On Wednesday, August 3, 2016 at 2:33:35 PM UTC-7, goome wrote:
>>
>> when trying in the shell, the shell itself got killed :
>> >> In [4]: legacy_db(query).select()
>> >>
>> >> Killed
>> >> root@rb:/home/www-data/web2py#
>>
>>
> Is that using web2py in a bash/python shell  (i.,e., -M -S myapp) ?
yes, this one

-- 
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] display git version of my own web2py project

2016-08-04 Thread icodk
Thanks for the tip Niphold(I didn't know that)

On Wednesday, August 3, 2016 at 10:37:15 PM UTC+2, Niphlod wrote:
>
> if you just want web2py's version, use 
> request.global_settings.web2py_version
>
> On Friday, July 29, 2016 at 9:56:43 PM UTC+2, Richard wrote:
>>
>> with no expiritation time
>>
>> On Fri, Jul 29, 2016 at 3:54 PM, Richard Vézina  
>> wrote:
>>
>>> You could also use web2py cache...
>>>
>>> :)
>>>
>>> Richard
>>>
>>> On Fri, Jul 29, 2016 at 12:39 PM, icodk  wrote:
>>>
 Might be useful for others
 I like to be able to see which version/tag my production web2py 
 application has. Here is how I do it(better ideas are welcome):
 In  db.py  

 if not session.gitver:
 import os
 os.chdir("/path/to/myapp")
 os.system('git  describe --abbrev=7 --dirty --always --tags > 
 git_ver.txt')
 session.gitver = open('git_ver.txt').read()

 Then somewhere in layout.html (I do it in the footer):

 {{=session.gitver}}


 Tested on Windows


 -- 
 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+un...@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.