Re: [web2py] Re: how to create pdf report in web2py???

2017-11-22 Thread Alex
you can find basic information here:
https://www.reportbro.com/docs/installation

client side you only have to initialize the plugin. For server integration 
with web2py there is an example implementation as well:
https://www.reportbro.com/static/download/reportbro_web2py.py

On Wednesday, November 22, 2017 at 12:33:47 AM UTC+1, Ramos wrote:
>
> Does someone have a web2py working example with reportbro???
>
> Thank you
>
> On Friday, 8 September 2017 18:39:31 UTC+1, Alex wrote:
>>
>> We created a user group at 
>> https://groups.google.com/forum/#!forum/reportbro
>> Don't hesitate to post in case you have any questions.
>>
>> I added the custom save example from above to our demos:
>>
>> https://github.com/jobsta/reportbro-designer/blob/master/demos/custom_save.html
>>
>> On Friday, September 1, 2017 at 12:08:53 AM UTC+2, Massimo Di Pierro 
>> wrote:
>>>
>>> Nice!
>>>
>>> On Saturday, 26 August 2017 08:19:30 UTC-5, Alex wrote:

 We created a report tool since creating pdf reports in a web 
 application is a common problem and none of the existing solutions were 
 optimal for us. We needed something that is easy to integrate, easy to use 
 (to design the reports) and easy to maintain (e.g. to create new versions 
 of an existing report template).

 https://www.reportbro.com

 The designer to create report templates is a javascript plugin which 
 can easily be integrated in a web application. Server-side we developed a 
 python package - which you can either download or install via pip - to 
 create the pdf (or xlsx) file with a given report template and data. 
 Because it's python it is easy to use in an existing web2py app.

 We appreciate any kind of feedback!

 Alex


>>

-- 
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] Logger issue

2017-11-22 Thread Alex
I'm not missing anything with logging.conf. As I mentioned above it is not 
just simply rewriting the logging configuration because I have to adapt the 
deployment process as well. Therefor I'd like to know in advance if you 
think that rewriting the logger would solve this issue.

And I'd like to know how this is possible at all in first place. I've other 
applications with much more users (but using Apache instead of Rocket) 
without this problem.

Alex

On Saturday, November 18, 2017 at 1:00:29 AM UTC+1, Dave S wrote:
>
>
>
> On Wednesday, November 15, 2017 at 10:38:09 AM UTC-8, Alex wrote:
>>
>> I've got a similar problem. I have a model file where I initialize the 
>> logger:
>>
>
> What did you find missing in using logging.conf?
>
> /dps
>
>  
>
>> import logging, logging.handlers
>>
>> def get_configured_logger(name):
>> logger = logging.getLogger(name)
>> if (len(logger.handlers) == 0):
>> # This logger has no handlers, so we can assume it hasn't yet 
>> been configured
>> # (Configure logger)
>>
>> # Create RotatingFileHandler
>> import os
>> formatter = "%(asctime)s %(levelname)s %(process)s %(thread)s 
>> %(funcName)s():%(lineno)d %(message)s"
>> # rotate log file when it reaches 10MB
>> handler = logging.handlers.RotatingFileHandler(os.path.join(
>> request.folder,'private/myapp.log'),maxBytes=10485760,backupCount=2)
>> handler.setFormatter(logging.Formatter(formatter))
>>
>> handler.setLevel(logging.DEBUG)
>>
>> logger.addHandler(handler)
>> logger.setLevel(logging.DEBUG)
>>
>> if len(logger.handlers) > 1:
>> logger.debug('handler: ' + str(len(logger.handlers)))
>> return logger
>>
>> # Assign application logger to a global var 
>> logger = get_configured_logger(request.application)
>>
>> sometimes it happens that an additional handler is added. After a few 
>> days sometimes there are 2 or even more handlers attached. Every log 
>> message is then printed multiple times in the log file.
>>
>> The application is internal and has only few users. Therefor I'm using 
>> the integrated Rocket webserver (Linux). Has anyone an idea why this is 
>> happening?
>>
>> Would rewriting the logger configuration with the logging.conf file help 
>> in this case? It's not that easy to simply rewrite and test it because the 
>> application is auto-deployed to different machines and it would be 
>> necessary to adapt the deployment process as well.
>>
>> Alex
>>
>> On Monday, October 23, 2017 at 11:37:03 AM UTC+2, Kiran Subbaraman wrote:
>>>
>>> Yes, I suggested the OP configure one for their specific app, using the 
>>> example app's config as a template. 
>>> Need not configure this in the code, for every request ... as they are 
>>> doing so now. 
>>>
>>> 
>>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>>
>>> On 23-Oct-17 3:01 PM, Dave S wrote:
>>>
>>>
>>>
>>> On Sunday, October 22, 2017 at 9:19:02 PM UTC-7, Kiran Subbaraman wrote: 

 configuring the logger for every thread (`current.logger = logger`), 
 and this seems unnecessary.
 Take a look at this logging configuration: 
 https://github.com/web2py/web2py/blob/0d646fa5e7c731cb5c392adf6a885351e77e4903/examples/logging.example.conf,
  
 and set one up for your app. 


>>> Doesn't the OP already have that file as part of the web2py 
>>> distribution?  It ships in the example app, no?
>>>
>>> /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+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.


Re: [web2py] Re: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
Not that easy :)

i´m reading your links and also this link
https://github.com/jobsta/reportbro-designer/blob/master/demos/custom_save.html

where i´m stuck in the save part

what url do i put in the save url ?
[image: Imagem inline 1]

i moved the run function from the reportbro_web2py.py to a controller and i
use it in the above "your save controller url" but i get a bad request in
the browser when i do in the console
$('#reportbro').reportBro('save')

Thank you


2017-11-22 10:38 GMT+00:00 Alex :

> you can find basic information here:
> https://www.reportbro.com/docs/installation
>
> client side you only have to initialize the plugin. For server integration
> with web2py there is an example implementation as well:
> https://www.reportbro.com/static/download/reportbro_web2py.py
>
>
> On Wednesday, November 22, 2017 at 12:33:47 AM UTC+1, Ramos wrote:
>>
>> Does someone have a web2py working example with reportbro???
>>
>> Thank you
>>
>> On Friday, 8 September 2017 18:39:31 UTC+1, Alex wrote:
>>>
>>> We created a user group at https://groups.google.com/foru
>>> m/#!forum/reportbro
>>> Don't hesitate to post in case you have any questions.
>>>
>>> I added the custom save example from above to our demos:
>>> https://github.com/jobsta/reportbro-designer/blob/master/
>>> demos/custom_save.html
>>>
>>> On Friday, September 1, 2017 at 12:08:53 AM UTC+2, Massimo Di Pierro
>>> wrote:

 Nice!

 On Saturday, 26 August 2017 08:19:30 UTC-5, Alex wrote:
>
> We created a report tool since creating pdf reports in a web
> application is a common problem and none of the existing solutions were
> optimal for us. We needed something that is easy to integrate, easy to use
> (to design the reports) and easy to maintain (e.g. to create new versions
> of an existing report template).
>
> https://www.reportbro.com
>
> The designer to create report templates is a javascript plugin which
> can easily be integrated in a web application. Server-side we developed a
> python package - which you can either download or install via pip - to
> create the pdf (or xlsx) file with a given report template and data.
> Because it's python it is easy to use in an existing web2py app.
>
> We appreciate any kind of feedback!
>
> Alex
>
>
>>> --
> 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.


Re: [web2py] Re: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
[image: Imagem inline 1]

2017-11-22 11:07 GMT+00:00 António Ramos :

> Not that easy :)
>
> i´m reading your links and also this link
> https://github.com/jobsta/reportbro-designer/blob/
> master/demos/custom_save.html
>
> where i´m stuck in the save part
>
> what url do i put in the save url ?
> [image: Imagem inline 1]
>
> i moved the run function from the reportbro_web2py.py to a controller and
> i use it in the above "your save controller url" but i get a bad request in
> the browser when i do in the console
> $('#reportbro').reportBro('save')
>
> Thank you
>
>
> 2017-11-22 10:38 GMT+00:00 Alex :
>
>> you can find basic information here:
>> https://www.reportbro.com/docs/installation
>>
>> client side you only have to initialize the plugin. For server
>> integration with web2py there is an example implementation as well:
>> https://www.reportbro.com/static/download/reportbro_web2py.py
>>
>>
>> On Wednesday, November 22, 2017 at 12:33:47 AM UTC+1, Ramos wrote:
>>>
>>> Does someone have a web2py working example with reportbro???
>>>
>>> Thank you
>>>
>>> On Friday, 8 September 2017 18:39:31 UTC+1, Alex wrote:

 We created a user group at https://groups.google.com/foru
 m/#!forum/reportbro
 Don't hesitate to post in case you have any questions.

 I added the custom save example from above to our demos:
 https://github.com/jobsta/reportbro-designer/blob/master/dem
 os/custom_save.html

 On Friday, September 1, 2017 at 12:08:53 AM UTC+2, Massimo Di Pierro
 wrote:
>
> Nice!
>
> On Saturday, 26 August 2017 08:19:30 UTC-5, Alex wrote:
>>
>> We created a report tool since creating pdf reports in a web
>> application is a common problem and none of the existing solutions were
>> optimal for us. We needed something that is easy to integrate, easy to 
>> use
>> (to design the reports) and easy to maintain (e.g. to create new versions
>> of an existing report template).
>>
>> https://www.reportbro.com
>>
>> The designer to create report templates is a javascript plugin which
>> can easily be integrated in a web application. Server-side we developed a
>> python package - which you can either download or install via pip - to
>> create the pdf (or xlsx) file with a given report template and data.
>> Because it's python it is easy to use in an existing web2py app.
>>
>> We appreciate any kind of feedback!
>>
>> Alex
>>
>>
 --
>> 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] Dynamically changing requirement of field in form

2017-11-22 Thread Simona Chovancová
Hello.

I have a form in web2py that controls editing and adding new user. But some 
fields need different requirements based on when user is being added or 
edited. Can I somehow change field requirements in view? I can only detect 
this in view. So far I came up with something like this, but it does not 
work.

{{userform.custom.widget.name['requires'] = IS_EMAIL(error_message='invalid 
email!')}}

Any ideas? Thanks for help.

-- 
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: Dynamically changing requirement of field in form

2017-11-22 Thread Simona Chovancová
figured out no longer needed

On Wednesday, November 22, 2017 at 12:49:23 PM UTC+1, Simona Chovancová 
wrote:
>
> Hello.
>
> I have a form in web2py that controls editing and adding new user. But 
> some fields need different requirements based on when user is being added 
> or edited. Can I somehow change field requirements in view? I can only 
> detect this in view. So far I came up with something like this, but it does 
> not work.
>
> {{userform.custom.widget.name['requires'] = 
> IS_EMAIL(error_message='invalid email!')}}
>
> Any ideas? Thanks for help.
>

-- 
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: how to create pdf report in web2py???

2017-11-22 Thread Alex
On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>
> Not that easy :)
>
> i´m reading your links and also this link
>
> https://github.com/jobsta/reportbro-designer/blob/master/demos/custom_save.html
>
> where i´m stuck in the save part
>
> what url do i put in the save url ?
>

that's up to you. e.g.
'{{=URL('report', 'save')}}'
so you would need a controller file report.py with a function save in your 
application. There you have to save the report (available as data 
parameter) yourself wherever you want to. E.g. you could save it in your db 
or as a file.

In your case you don't have the controller you specified in the url, 
therefor the ajax call fails.
 

> [image: Imagem inline 1]
>
> i moved the run function from the reportbro_web2py.py to a controller and 
> i use it in the above "your save controller url" but i get a bad request in 
> the browser when i do in the console
> $('#reportbro').reportBro('save')
>
> Thank you
>
>

-- 
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: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
Some questions ...

1 - i see that you have already a report_request table with the reports.
Are you talking about this table to save reports? Looks to me that this
table is to save the "templates" of the pdf reports


2 - How do i merge data from my db with your templates and generate a live
pdf with live data? so users can save it in their desktop ?

regards
António

2017-11-22 12:35 GMT+00:00 Alex :

> On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>>
>> Not that easy :)
>>
>> i´m reading your links and also this link
>> https://github.com/jobsta/reportbro-designer/blob/master/
>> demos/custom_save.html
>>
>> where i´m stuck in the save part
>>
>> what url do i put in the save url ?
>>
>
> that's up to you. e.g.
> '{{=URL('report', 'save')}}'
> so you would need a controller file report.py with a function save in your
> application. There you have to save the report (available as data
> parameter) yourself wherever you want to. E.g. you could save it in your db
> or as a file.
>
> In your case you don't have the controller you specified in the url,
> therefor the ajax call fails.
>
>
>> [image: Imagem inline 1]
>>
>> i moved the run function from the reportbro_web2py.py to a controller and
>> i use it in the above "your save controller url" but i get a bad request in
>> the browser when i do in the console
>> $('#reportbro').reportBro('save')
>>
>> Thank you
>>
>> --
> 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] SyntaxError: Adapter not found for gae

2017-11-22 Thread Tommi Lahtonen
Latest web2py (2.16.1 ) and 
latest Google App Engine  launcher (1.9.63) do not work together on Windows 
7. Welcome application works but admin interface does not. Trying to open 
Admin will give you this error:

INFO 2017-11-22 15:15:22,841 module.py:825] default: "GET /admin 
HTTP/1.1" 500 707
WARNING  2017-11-22 13:15:25,806 sandbox.py:1082] The module _ctypes is 
whitelisted for local dev only. If your application relies on _ctypes, it 
is likely that it will not function properly in production.

ERROR2017-11-22 13:15:26,867 restricted.py:174] Traceback (most recent 
call last):

  File "C:\MyTemp\web-sovellukset\web2py_2017\web2py\gluon\restricted.py", 
line 219, in restricted

exec(ccode, environment)

  File 
"C:\MyTemp\web-sovellukset\web2py_2017\web2py\applications\admin\models\access.py",
 
line 16, in 

session_db = DAL('gae')

  File 
"C:\MyTemp\web-sovellukset\web2py_2017\web2py\gluon\packages\dal\pydal\base.py",
 
line 169, in __call__

obj = super(MetaDAL, cls).__call__(*args, **kwargs)

  File 
"C:\MyTemp\web-sovellukset\web2py_2017\web2py\gluon\packages\dal\pydal\base.py",
 
line 453, in __init__

adapter = adapters.get_for(self._dbname)

  File 
"C:\MyTemp\web-sovellukset\web2py_2017\web2py\gluon\packages\dal\pydal\adapters\__init__.py",
 
line 20, in get_for

'Adapter not found for %s' % uri

SyntaxError: Adapter not found for gae



INFO 2017-11-22 13:15:26,867 gaehandler.py:75]  Request: 
184.00ms/184.05ms (real time/cpu time)

INFO 2017-11-22 15:15:26,871 module.py:825] default: "GET /admin/ 
HTTP/1.1" 500 707

-- 
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: how to create pdf report in web2py???

2017-11-22 Thread Alex
On Wednesday, November 22, 2017 at 1:46:06 PM UTC+1, Ramos wrote:
>
> Some questions ...
>
> 1 - i see that you have already a report_request table with the reports.
> Are you talking about this table to save reports? Looks to me that this 
> table is to save the "templates" of the pdf reports
>

this is a different table to temporarily store report definition and data. 
It is used as a workaround for the plugin. The data for pdf preview in MS 
Edge browser cannot be set directly and needs a url instead. Further this 
is also needed for xls preview, because there is no simple preview plugin 
for xls. Therefor the url for xls preview is opened in a new tab and 
handled by the browser.
 

> 2 - How do i merge data from my db with your templates and generate a live 
> pdf with live data? so users can save it in their desktop ?
>

in your web2py controller (where you generate the final pdf file) create a 
Report instance:
report = Report(report_definition, data)

where report_definition is the report template (the one you uploaded to 
your save controller), and data is a dict containing the actual data to 
fill in. the keys must match with your parameters of the report. E.g. if 
you have a parameter "first_name" then data must contain a key 
"first_name". You should check afterwards if there were any errors during 
report initialization (report.errors)

the report itself (pdf file) is created with
report_file = report.generate_pdf()


> regards
> António
>
> 2017-11-22 12:35 GMT+00:00 Alex >:
>
>> On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>>>
>>> Not that easy :)
>>>
>>> i´m reading your links and also this link
>>>
>>> https://github.com/jobsta/reportbro-designer/blob/master/demos/custom_save.html
>>>
>>> where i´m stuck in the save part
>>>
>>> what url do i put in the save url ?
>>>
>>
>> that's up to you. e.g.
>> '{{=URL('report', 'save')}}'
>> so you would need a controller file report.py with a function save in 
>> your application. There you have to save the report (available as data 
>> parameter) yourself wherever you want to. E.g. you could save it in your db 
>> or as a file.
>>
>> In your case you don't have the controller you specified in the url, 
>> therefor the ajax call fails.
>>  
>>
>>> [image: Imagem inline 1]
>>>
>>> i moved the run function from the reportbro_web2py.py to a controller 
>>> and i use it in the above "your save controller url" but i get a bad 
>>> request in the browser when i do in the console
>>> $('#reportbro').reportBro('save')
>>>
>>> Thank you
>>>
>>> -- 
>> 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.


Re: [web2py] Re: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
Great. Will investigate further...

Also another question

the reportbro logo at the bottom of the pdf is there to stay?

I´m doing a private app for my business. Do i need to pay any licence?
How do i remove that logo in the bottom of the page?

Regards
António

2017-11-22 13:31 GMT+00:00 Alex :

> On Wednesday, November 22, 2017 at 1:46:06 PM UTC+1, Ramos wrote:
>>
>> Some questions ...
>>
>> 1 - i see that you have already a report_request table with the reports.
>> Are you talking about this table to save reports? Looks to me that this
>> table is to save the "templates" of the pdf reports
>>
>
> this is a different table to temporarily store report definition and data.
> It is used as a workaround for the plugin. The data for pdf preview in MS
> Edge browser cannot be set directly and needs a url instead. Further this
> is also needed for xls preview, because there is no simple preview plugin
> for xls. Therefor the url for xls preview is opened in a new tab and
> handled by the browser.
>
>
>> 2 - How do i merge data from my db with your templates and generate a
>> live pdf with live data? so users can save it in their desktop ?
>>
>
> in your web2py controller (where you generate the final pdf file) create a
> Report instance:
> report = Report(report_definition, data)
>
> where report_definition is the report template (the one you uploaded to
> your save controller), and data is a dict containing the actual data to
> fill in. the keys must match with your parameters of the report. E.g. if
> you have a parameter "first_name" then data must contain a key
> "first_name". You should check afterwards if there were any errors during
> report initialization (report.errors)
>
> the report itself (pdf file) is created with
> report_file = report.generate_pdf()
>
>
>> regards
>> António
>>
>> 2017-11-22 12:35 GMT+00:00 Alex :
>>
>>> On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:

 Not that easy :)

 i´m reading your links and also this link
 https://github.com/jobsta/reportbro-designer/blob/master/
 demos/custom_save.html

 where i´m stuck in the save part

 what url do i put in the save url ?

>>>
>>> that's up to you. e.g.
>>> '{{=URL('report', 'save')}}'
>>> so you would need a controller file report.py with a function save in
>>> your application. There you have to save the report (available as data
>>> parameter) yourself wherever you want to. E.g. you could save it in your db
>>> or as a file.
>>>
>>> In your case you don't have the controller you specified in the url,
>>> therefor the ajax call fails.
>>>
>>>
 [image: Imagem inline 1]

 i moved the run function from the reportbro_web2py.py to a controller
 and i use it in the above "your save controller url" but i get a bad
 request in the browser when i do in the console
 $('#reportbro').reportBro('save')

 Thank you

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

-- 
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: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
I got it .
I have to read the record from the report_request table and do a json.load
before the
Report(definition, mydata)
also in the designer i have to create paramenters...

Thank you

2017-11-22 14:55 GMT+00:00 António Ramos :

> Great. Will investigate further...
>
> Also another question
>
> the reportbro logo at the bottom of the pdf is there to stay?
>
> I´m doing a private app for my business. Do i need to pay any licence?
> How do i remove that logo in the bottom of the page?
>
> Regards
> António
>
> 2017-11-22 13:31 GMT+00:00 Alex :
>
>> On Wednesday, November 22, 2017 at 1:46:06 PM UTC+1, Ramos wrote:
>>>
>>> Some questions ...
>>>
>>> 1 - i see that you have already a report_request table with the reports.
>>> Are you talking about this table to save reports? Looks to me that this
>>> table is to save the "templates" of the pdf reports
>>>
>>
>> this is a different table to temporarily store report definition and
>> data. It is used as a workaround for the plugin. The data for pdf preview
>> in MS Edge browser cannot be set directly and needs a url instead. Further
>> this is also needed for xls preview, because there is no simple preview
>> plugin for xls. Therefor the url for xls preview is opened in a new tab and
>> handled by the browser.
>>
>>
>>> 2 - How do i merge data from my db with your templates and generate a
>>> live pdf with live data? so users can save it in their desktop ?
>>>
>>
>> in your web2py controller (where you generate the final pdf file) create
>> a Report instance:
>> report = Report(report_definition, data)
>>
>> where report_definition is the report template (the one you uploaded to
>> your save controller), and data is a dict containing the actual data to
>> fill in. the keys must match with your parameters of the report. E.g. if
>> you have a parameter "first_name" then data must contain a key
>> "first_name". You should check afterwards if there were any errors during
>> report initialization (report.errors)
>>
>> the report itself (pdf file) is created with
>> report_file = report.generate_pdf()
>>
>>
>>> regards
>>> António
>>>
>>> 2017-11-22 12:35 GMT+00:00 Alex :
>>>
 On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>
> Not that easy :)
>
> i´m reading your links and also this link
> https://github.com/jobsta/reportbro-designer/blob/master/dem
> os/custom_save.html
>
> where i´m stuck in the save part
>
> what url do i put in the save url ?
>

 that's up to you. e.g.
 '{{=URL('report', 'save')}}'
 so you would need a controller file report.py with a function save in
 your application. There you have to save the report (available as data
 parameter) yourself wherever you want to. E.g. you could save it in your db
 or as a file.

 In your case you don't have the controller you specified in the url,
 therefor the ajax call fails.


> [image: Imagem inline 1]
>
> i moved the run function from the reportbro_web2py.py to a controller
> and i use it in the above "your save controller url" but i get a bad
> request in the browser when i do in the console
> $('#reportbro').reportBro('save')
>
> Thank you
>
> --
 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.
>>
>
>

-- 
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: how to create pdf report in web2py???

2017-11-22 Thread António Ramos
About fonts

there is only available

Courier new
Helvetica
Times new roman

I need aria, how do i add it ?

adding it to static folder and changing the addicional_fonts does not work
[image: Imagem inline 1]

Regards


2017-11-22 15:45 GMT+00:00 António Ramos :

> I got it .
> I have to read the record from the report_request table and do a json.load
> before the
> Report(definition, mydata)
> also in the designer i have to create paramenters...
>
> Thank you
>
> 2017-11-22 14:55 GMT+00:00 António Ramos :
>
>> Great. Will investigate further...
>>
>> Also another question
>>
>> the reportbro logo at the bottom of the pdf is there to stay?
>>
>> I´m doing a private app for my business. Do i need to pay any licence?
>> How do i remove that logo in the bottom of the page?
>>
>> Regards
>> António
>>
>> 2017-11-22 13:31 GMT+00:00 Alex :
>>
>>> On Wednesday, November 22, 2017 at 1:46:06 PM UTC+1, Ramos wrote:

 Some questions ...

 1 - i see that you have already a report_request table with the reports.
 Are you talking about this table to save reports? Looks to me that this
 table is to save the "templates" of the pdf reports

>>>
>>> this is a different table to temporarily store report definition and
>>> data. It is used as a workaround for the plugin. The data for pdf preview
>>> in MS Edge browser cannot be set directly and needs a url instead. Further
>>> this is also needed for xls preview, because there is no simple preview
>>> plugin for xls. Therefor the url for xls preview is opened in a new tab and
>>> handled by the browser.
>>>
>>>
 2 - How do i merge data from my db with your templates and generate a
 live pdf with live data? so users can save it in their desktop ?

>>>
>>> in your web2py controller (where you generate the final pdf file) create
>>> a Report instance:
>>> report = Report(report_definition, data)
>>>
>>> where report_definition is the report template (the one you uploaded to
>>> your save controller), and data is a dict containing the actual data to
>>> fill in. the keys must match with your parameters of the report. E.g. if
>>> you have a parameter "first_name" then data must contain a key
>>> "first_name". You should check afterwards if there were any errors during
>>> report initialization (report.errors)
>>>
>>> the report itself (pdf file) is created with
>>> report_file = report.generate_pdf()
>>>
>>>
 regards
 António

 2017-11-22 12:35 GMT+00:00 Alex :

> On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>>
>> Not that easy :)
>>
>> i´m reading your links and also this link
>> https://github.com/jobsta/reportbro-designer/blob/master/dem
>> os/custom_save.html
>>
>> where i´m stuck in the save part
>>
>> what url do i put in the save url ?
>>
>
> that's up to you. e.g.
> '{{=URL('report', 'save')}}'
> so you would need a controller file report.py with a function save in
> your application. There you have to save the report (available as data
> parameter) yourself wherever you want to. E.g. you could save it in your 
> db
> or as a file.
>
> In your case you don't have the controller you specified in the url,
> therefor the ajax call fails.
>
>
>> [image: Imagem inline 1]
>>
>> i moved the run function from the reportbro_web2py.py to a controller
>> and i use it in the above "your save controller url" but i get a bad
>> request in the browser when i do in the console
>> $('#reportbro').reportBro('save')
>>
>> Thank you
>>
>> --
> 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.
>>>
>>
>>
>

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

[web2py] scheduler: force another try, count tries

2017-11-22 Thread Martin Weissenboeck
Two questions:

​(1) Under some conditions (email send not successfully) ​I want to force
an other try after some minutes. Would it be a good idea to raise an
Exception?

(2) Let's say scheduler_task.retry_failed is 5 and we are in the second
repetition. How can I get these number = 2? Is there any property of
scheduler like scheduler.number_of_try?

​Regards, Martin​

-- 
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] Logger issue

2017-11-22 Thread Dave S


On Wednesday, November 22, 2017 at 2:50:45 AM UTC-8, Alex wrote:
>
> I'm not missing anything with logging.conf. As I mentioned above it is not 
> just simply rewriting the logging configuration because I have to adapt the 
> deployment process as well. Therefor I'd like to know in advance if you 
> think that rewriting the logger would solve this issue.
>
>
If the deployment process is A Separate Piece Of Code (Chef, Salt, 
fabfiles, BASH scripts, etc), I would put logging into that,copy the log 
file into the web2py/logs directory if you want, and just use logging.conf 
for web2py.  Adding an app to the logging of an existing installation just 
requires appending about 4 lines to logging.conf.

 

> And I'd like to know how this is possible at all in first place. I've 
> other applications with much more users (but using Apache instead of 
> Rocket) without this problem.
>
> Alex
>
>
I have no experience with logs other than logging.conf, so I don't know.  
In my experience, Rocket doesn't introduce any funnies in logging.

/dps

 

> On Saturday, November 18, 2017 at 1:00:29 AM UTC+1, Dave S wrote:
>>
>>
>>
>> On Wednesday, November 15, 2017 at 10:38:09 AM UTC-8, Alex wrote:
>>>
>>> I've got a similar problem. I have a model file where I initialize the 
>>> logger:
>>>
>>
>> What did you find missing in using logging.conf?
>>
>> /dps
>>
>>  
>>
>>> import logging, logging.handlers
>>>
>>> def get_configured_logger(name):
>>> logger = logging.getLogger(name)
>>> if (len(logger.handlers) == 0):
>>> # This logger has no handlers, so we can assume it hasn't yet 
>>> been configured
>>> # (Configure logger)
>>>
>>> # Create RotatingFileHandler
>>> import os
>>> formatter = "%(asctime)s %(levelname)s %(process)s %(thread)s 
>>> %(funcName)s():%(lineno)d %(message)s"
>>> # rotate log file when it reaches 10MB
>>> handler = logging.handlers.RotatingFileHandler(os.path.join(
>>> request.folder,'private/myapp.log'),maxBytes=10485760,backupCount=2)
>>> handler.setFormatter(logging.Formatter(formatter))
>>>
>>> handler.setLevel(logging.DEBUG)
>>>
>>> logger.addHandler(handler)
>>> logger.setLevel(logging.DEBUG)
>>>
>>> if len(logger.handlers) > 1:
>>> logger.debug('handler: ' + str(len(logger.handlers)))
>>> return logger
>>>
>>> # Assign application logger to a global var 
>>> logger = get_configured_logger(request.application)
>>>
>>> sometimes it happens that an additional handler is added. After a few 
>>> days sometimes there are 2 or even more handlers attached. Every log 
>>> message is then printed multiple times in the log file.
>>>
>>> The application is internal and has only few users. Therefor I'm using 
>>> the integrated Rocket webserver (Linux). Has anyone an idea why this is 
>>> happening?
>>>
>>> Would rewriting the logger configuration with the logging.conf file help 
>>> in this case? It's not that easy to simply rewrite and test it because the 
>>> application is auto-deployed to different machines and it would be 
>>> necessary to adapt the deployment process as well.
>>>
>>> Alex
>>>
>>> On Monday, October 23, 2017 at 11:37:03 AM UTC+2, Kiran Subbaraman wrote:

 Yes, I suggested the OP configure one for their specific app, using the 
 example app's config as a template. 
 Need not configure this in the code, for every request ... as they are 
 doing so now. 

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On 23-Oct-17 3:01 PM, Dave S wrote:



 On Sunday, October 22, 2017 at 9:19:02 PM UTC-7, Kiran Subbaraman 
 wrote: 
>
> configuring the logger for every thread (`current.logger = logger`), 
> and this seems unnecessary.
> Take a look at this logging configuration: 
> https://github.com/web2py/web2py/blob/0d646fa5e7c731cb5c392adf6a885351e77e4903/examples/logging.example.conf,
>  
> and set one up for your app. 
>
>
 Doesn't the OP already have that file as part of the web2py 
 distribution?  It ships in the example app, no?

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

Re: [web2py] Re: how to create pdf report in web2py???

2017-11-22 Thread Alex
you do not have to buy a license for a private app:
https://www.reportbro.com/license/index

the logo is only printed when using the public available reportbro 
instance. When you use your own server there will not be a logo on the 
generated pdf file. Unless you call generate_pdf with add_watermark=True 
parameter:
https://www.reportbro.com/docs/methods

you should not read the report template from the report_request table, 
because it is only used as a temporary table for the plugin (as mentioned 
above). You should store your report template yourself (in your save 
controller) and then use this template (from db or file system etc.) to 
generate a report.

about the fonts: what does not work? first you have to add it when 
initializing the plugin so the font is available in the designer. This is 
demonstrated in the certificate demo:
https://www.reportbro.com/demos/index

On the server you have to specify the additional_fonts parameter,  the 
value of the font must be the same as the value in the plugin intialization 
(so the font matches). And of course the specified ttf file must exist (in 
your case static/fonts/arial.ttf)

On Wednesday, November 22, 2017 at 3:56:33 PM UTC+1, Ramos wrote:
>
> Great. Will investigate further...
>
> Also another question
>
> the reportbro logo at the bottom of the pdf is there to stay?
>
> I´m doing a private app for my business. Do i need to pay any licence?
> How do i remove that logo in the bottom of the page?
>
> Regards
> António
>
> 2017-11-22 13:31 GMT+00:00 Alex >:
>
>> On Wednesday, November 22, 2017 at 1:46:06 PM UTC+1, Ramos wrote:
>>>
>>> Some questions ...
>>>
>>> 1 - i see that you have already a report_request table with the reports.
>>> Are you talking about this table to save reports? Looks to me that this 
>>> table is to save the "templates" of the pdf reports
>>>
>>
>> this is a different table to temporarily store report definition and 
>> data. It is used as a workaround for the plugin. The data for pdf preview 
>> in MS Edge browser cannot be set directly and needs a url instead. Further 
>> this is also needed for xls preview, because there is no simple preview 
>> plugin for xls. Therefor the url for xls preview is opened in a new tab and 
>> handled by the browser.
>>  
>>
>>> 2 - How do i merge data from my db with your templates and generate a 
>>> live pdf with live data? so users can save it in their desktop ?
>>>
>>
>> in your web2py controller (where you generate the final pdf file) create 
>> a Report instance:
>> report = Report(report_definition, data)
>>
>> where report_definition is the report template (the one you uploaded to 
>> your save controller), and data is a dict containing the actual data to 
>> fill in. the keys must match with your parameters of the report. E.g. if 
>> you have a parameter "first_name" then data must contain a key 
>> "first_name". You should check afterwards if there were any errors during 
>> report initialization (report.errors)
>>
>> the report itself (pdf file) is created with
>> report_file = report.generate_pdf()
>>
>>
>>> regards
>>> António
>>>
>>> 2017-11-22 12:35 GMT+00:00 Alex :
>>>
 On Wednesday, November 22, 2017 at 12:07:56 PM UTC+1, Ramos wrote:
>
> Not that easy :)
>
> i´m reading your links and also this link
>
> https://github.com/jobsta/reportbro-designer/blob/master/demos/custom_save.html
>
> where i´m stuck in the save part
>
> what url do i put in the save url ?
>

 that's up to you. e.g.
 '{{=URL('report', 'save')}}'
 so you would need a controller file report.py with a function save in 
 your application. There you have to save the report (available as data 
 parameter) yourself wherever you want to. E.g. you could save it in your 
 db 
 or as a file.

 In your case you don't have the controller you specified in the url, 
 therefor the ajax call fails.
  

> [image: Imagem inline 1]
>
> i moved the run function from the reportbro_web2py.py to a controller 
> and i use it in the above "your save controller url" but i get a bad 
> request in the browser when i do in the console
> $('#reportbro').reportBro('save')
>
> Thank you
>
> -- 
 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 I

[web2py] Re: scheduler: force another try, count tries

2017-11-22 Thread Dave S


On Wednesday, November 22, 2017 at 9:25:31 AM UTC-8, mweissen wrote:
>
> Two questions:
>
> ​(1) Under some conditions (email send not successfully) ​I want to force 
> an other try after some minutes. Would it be a good idea to raise an 
> Exception?
>
>
Who would be raising the exception?

 

> (2) Let's say scheduler_task.retry_failed is 5 and we are in the second 
> repetition. How can I get these number = 2? Is there any property of 
> scheduler like scheduler.number_of_try?
>
> ​Regards, Martin​
>
>
select retry_failed, times_run,  times_failed, last_run_time from 
scheduler_task where times_failed != 0 ;

Status should be 'FAILED' on those, as well.

And all those values are in the Row object returned by task_status.

Footnote:  In the online book (as at web2py.com/books), the search function 
with the term "scheduler" finds -K option in the command line help list, 
but doesn't find the API discussion also in Chapter 4.  I did get there by 
searching for "queue_task".  I'm not familiar with the guts of the search 
function to know why this happens.

/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 distribute your applications as binaries¶

2017-11-22 Thread mostwanted
Hi guys, i am trying to make my application a widnows desktop app, (i'm 
from Ubuntu), i'm reading the steps in the link below
http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries
 

but i get stuck when i get to this line 

*Create a file "myapp/start.bat" that contains "web2py/web2py.exe"*Can 
someone please break it down and simplify it for me, i'm not sure i 
understand it

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: How to distribute your applications as binaries¶

2017-11-22 Thread 黄祥
On Thursday, November 23, 2017 at 12:19:51 PM UTC+7, mostwanted wrote:
>
> Hi guys, i am trying to make my application a widnows desktop app, (i'm 
> from Ubuntu), i'm reading the steps in the link below
>
> http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries
>  
> 
> I am assuming where is says 
>
>- *Download a web2py windows binary distribution*
>
> it means downloading the version that runs on windows(right?)
>
yes 

>
> but i get stuck when i get to this line 
>
>- *Create a file "myapp/start.bat" that contains "web2py/web2py.exe"*
>
> please create a file name "start.bat" with in on the myapp path, which 
have a content web2py/web2py.exe on the file
e.g. (please change the path c:\web2py to fit your need)
myapp/start.bat

@echo off
set command=C:\web2py\web2py.exe
set interfaces=0.0.0.0
set port= 8000
start %command% --interfaces=%interfaces% -p %port%

just another way around, if you plan to make windows desktop app, perhaps 
you can looking for electron or nwjs, point it into your server url 
(webview), and it will generated, the exe for you.

best regards,
stifan

-- 
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: How to distribute your applications as binaries¶

2017-11-22 Thread Dave S


On Wednesday, November 22, 2017 at 9:19:51 PM UTC-8, mostwanted wrote:
>
> Hi guys, i am trying to make my application a widnows desktop app, (i'm 
> from Ubuntu), i'm reading the steps in the link below
>
> http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries
>  
> 
> I am assuming where is says 
>
>- *Download a web2py windows binary distribution*
>
> it means downloading the version that runs on windows(right?)
>
>
> but i get stuck when i get to this line 
>
>- *Create a file "myapp/start.bat" that contains "web2py/web2py.exe"*
>
>
".bat" is roughly equivalent to ".sh".  So you're making a script that will 
start web2py in the directory you just downloaded it to.

This script is a one-liner (unless you get fancy), and it just specifies 
the relative path to the executable.  And you should probably change the 
slashes ("/") to backslashes ("\") because you have to do tricks to get 
windows take slash as a path separator.

(web2py.exe has the python interpreter wrapped inside, unlike linux where 
you would say "python web2py/web2py.py")
 

> Can someone please break it down and simplify it for me, i'm not sure i 
> understand it
>
> Thanks
>
>
HTH

/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: How to distribute your applications as binaries¶

2017-11-22 Thread Dave S


On Wednesday, November 22, 2017 at 10:37:19 PM UTC-8, 黄祥 wrote:
>
> On Thursday, November 23, 2017 at 12:19:51 PM UTC+7, mostwanted wrote:
>>
>> Hi guys, i am trying to make my application a widnows desktop app, (i'm 
>> from Ubuntu), i'm reading the steps in the link below
>>
>> http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries
>>  
>> 
>> I am assuming where is says 
>>
>>- *Download a web2py windows binary distribution*
>>
>> it means downloading the version that runs on windows(right?)
>>
> yes 
>
>>
>> but i get stuck when i get to this line 
>>
>>- *Create a file "myapp/start.bat" that contains "web2py/web2py.exe"*
>>
>> please create a file name "start.bat" with in on the myapp path, which 
> have a content web2py/web2py.exe on the file
>

 

> e.g. (please change the path c:\web2py to fit your need)
> myapp/start.bat
>
>
Hey, he's just been told to create a directory "myapp" and put web2py  
there, so of course he needs to do that.

@echo off
> set command=C:\web2py\web2py.exe
> set interfaces=0.0.0.0
> set port= 8000
> start %command% --interfaces=%interfaces% -p %port%
>
>  
Port 8000 may not be correct for the people intalling the OP's package.  
He'll have to tell the customer how to configure the port, etc.  That's for 
a stand-alone configuration. If the customer wants to run it under a 
scalable front end (instead of the useful but not scalable Rocket), the OP 
will have to write up different instructions.  Those are in Chapter 13, but 
he will probably need to find a Windows-speaking person to help make sure 
the instructions work for a specific site.


just another way around, if you plan to make windows desktop app, perhaps 
> you can looking for electron or nwjs, point it into your server url 
> (webview), and it will generated, the exe for you.
>
>
Sounds like he wants to distribute server packages,  

best regards,
> stifan
>

/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: How to distribute your applications as binaries¶

2017-11-22 Thread mostwanted
When i run my .bat file it just flashes a black console and then closes, it 
doesn't display any errors or anything to notify me about what iIm doing 
wrong! What could i be missing? exactly the same as Stifan's;

@echo off
set command=C:\Users\mesho\Desktop\myapp\web2py\web2py.exe
set interfaces=0.0.0.0
set port=8000
start %command% --interfaces=%interfaces% --p=%port%


What am I missing or messing up??

On Thursday, November 23, 2017 at 8:37:19 AM UTC+2, 黄祥 wrote:
>
> On Thursday, November 23, 2017 at 12:19:51 PM UTC+7, mostwanted wrote:
>>
>> Hi guys, i am trying to make my application a widnows desktop app, (i'm 
>> from Ubuntu), i'm reading the steps in the link below
>>
>> http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries
>>  
>> 
>> I am assuming where is says 
>>
>>- *Download a web2py windows binary distribution*
>>
>> it means downloading the version that runs on windows(right?)
>>
> yes 
>
>>
>> but i get stuck when i get to this line 
>>
>>- *Create a file "myapp/start.bat" that contains "web2py/web2py.exe"*
>>
>> please create a file name "start.bat" with in on the myapp path, which 
> have a content web2py/web2py.exe on the file
> e.g. (please change the path c:\web2py to fit your need)
> myapp/start.bat
>
> @echo off
> set command=C:\web2py\web2py.exe
> set interfaces=0.0.0.0
> set port= 8000
> start %command% --interfaces=%interfaces% -p %port%
>
> just another way around, if you plan to make windows desktop app, perhaps 
> you can looking for electron or nwjs, point it into your server url 
> (webview), and it will generated, the exe for you.
>
> best regards,
> stifan
>

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