[web2py] Re: Testing

2016-03-19 Thread Pierre Thibault
OK, sorry for the noise.

Le lundi 14 mars 2016 13:01:48 UTC-4, Leonel Câmara a écrit :
>
> Yeah this group is moderated so you have to wait until your messages are 
> aproved the first few times until you're whitelisted.
>

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

2016-03-14 Thread Pierre Thibault
OK, it seems the problem is gone but Saturday I sent a few messages and 
they would not appear.

I hope the problem is not generalized. Keep on an eye on this.

Le lundi 14 mars 2016 12:49:58 UTC-4, Pierre Thibault a écrit :
>
> I do not see my messages in this group.
>

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

2016-03-14 Thread Pierre Thibault
I do not see my messages in this group.

-- 
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: import error

2016-03-12 Thread Pierre Thibault
Is this bug fixed? Is Pygments working with web2py?

Here the problem is that python modules loaded from the module folder of 
the app are using the key applications.xxx.module_name in sys.modules. So a 
lookup for module_name in sys.modules will probably result as a KeyError. 
Should we change the dictionary used my sys.modules so a lookup would 
automatically try applications.xxx.module_name?

Le lundi 20 juin 2011 08:12:11 UTC-4, Falko Delarue a écrit :
>
>
> > try to replace: 
> > 
> > oldmod = sys.modules['pygments.lexers'] 
> > 
> > with: 
> > 
> > import pygments.lexers as oldmod 
>
> hagrr why must pygements be so ... 
>
> i tried that but i got 
> File "applications/pygments_test/modules/pygments/lexers/__init__.py", 
> line 223, in  
> import pygments.lexers as oldmod 
> AttributeError: 'module' object has no attribute 'lexers' 
>
> so i though i try to remove the whole oldmod stuff 
> #import pygments.lexers as oldmod 
> newmod = _automodule('pygments.lexers') 
> #newmod.__dict__.update(oldmod.__dict__) 
> sys.modules['pygments.lexers'] = newmod 
> #del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types 
>
> but unfortunately this does not help in the end because when i want to 
> use pygemtns to render some html i get 
>
> Traceback (most recent call last): 
>   File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 192, in 
> restricted 
> exec ccode in environment 
>   File "/home/fkrause/Dev/web2py/applications/pyMantis/views/ 
> plugin_restapidoc/method.html", line 26, in  
>  
>   File "/home/fkrause/Dev/web2py/applications/pyMantis/models/ 
> plugin_restapidoc.py", line 54, in code_highlight 
> lexer = pygments.lexers.get_lexer_by_name(language.lower(), 
> stripall=True) 
>   File "applications/pyMantis/modules/pygments/lexers/__init__.py", 
> line 74, in get_lexer_by_name 
> _load_lexers(module_name) 
>   File "applications/pyMantis/modules/pygments/lexers/__init__.py", 
> line 32, in _load_lexers 
> mod = __import__(module_name, None, None, ['__all__']) 
>   File "/home/fkrause/Dev/web2py/gluon/custom_import.py", line 283, in 
> __call__ 
> fromlist, level) 
>   File "/home/fkrause/Dev/web2py/gluon/custom_import.py", line 75, in 
> __call__ 
> level) 
> ImportError: No module named agile 
>

-- 
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] Did move my web2py projects to GitHub

2015-05-04 Thread Pierre Thibault
Hello,

I had a few projects for Web2py and I did move them to GitHub because 
GoogleCode is going down soon.

Here a few links:

Pierre-Thibault/neo-web2py-utils 
https://github.com/Pierre-Thibault/neo-web2py-utils A utility project for 
web2py applications  Not a lot of stuff in this one...

Pierre-Thibault/neo-web2py2eclipse 
https://github.com/Pierre-Thibault/neo-web2py2eclipse neo-web2py2eclipse 
is an automated eclipse project creator for web2py applications.

Pierre-Thibault/neo-insert-imports 
https://github.com/Pierre-Thibault/neo-insert-imports  A tool for Web2py 
Pydev Eclipse users to add the code for the static code analyzer.

I hope it can be useful.

-- 
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] Some powerTable questions

2011-08-29 Thread Pierre Thibault
Hello,

I have a few question on the power table:

- Can I make the columns re-sizable?
- Can I display a column hierarchically? I want to display a little
triangle or little + at the left of each item in a column so the user
can unfold the item like if it was a folder containing other folders
and files.

Thank for this plug-in. This is great work.


[web2py] Re: Some powerTable questions

2011-08-29 Thread Pierre Thibault
Thank you.

So, I don't have data coming SQL. Would then recommend solidtable?

On 29 août, 15:46, Bruno Rocha rochacbr...@gmail.com wrote:
 Datatables has resizeable feature. So you can do it with a bit of
 javascript. But there is not an API for that in plugin yet.

 PowerTable will be rewriten, may be using solidtable as base.

 Web2py now has too many table/grid options and I think we can just extend
 the existing best ones.

 Powertable already has nested tables 'details' but allow only obe level.

 Using the new extracolumns feature in sqltable or solidtable we can achieve
 your tree like nested tables. A bit of jquery and this would be easy.

 I am not saying you dont have to use powertable, just that it is a little
 deprecated and can be very better with new features (web2py evolves too
 fast!)

 The only features that powertable has and other dont. is nested tables, by
 column filtering, edit in place, tooltips, ajax.

 Putting this 5 features in smartgrid and this will be the best option.

 http://zerp.ly/rochacbruno
 Em 29/08/2011 15:52, Pierre Thibault pierre.thibau...@gmail.com
 escreveu:



[web2py] Re: Some powerTable questions

2011-08-29 Thread Pierre Thibault
On 29 août, 20:26, Bruno Rocha rochacbr...@gmail.com wrote:
 what is your data source?

I have XML data.

 datatables can handle json and xml (but it is not implemented in the plugin,
 but can be done with JS), if you want a JSON based grid I recommend
 PowerGrid, another plugin I created. PowerGrid is based in JSON or PJSON, it
 comes with a default callback module, but you can specify any callback
 function wich returns JSON to be loaded in the grid.

I can transform my data in Python or JS. I don't care that much about
coding the data transformation necessary to make things work. What
seems to be the challenge is displaying the hierarchy I talk about.

What would be your recommendation?


Re: [web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/6/26 Massimo Di Pierro massimo.dipie...@gmail.com

 I found the problem

 http://groups.google.com/group/web2py/msg/aaa803e14404fc62

 This is not a problem with web2py.

 @ Pierre, I did found a non-related problem with web2py.

 models/meteo.py uses custom_import to import modules/meteo.py. The latter
 imports matplotlib. I do not have matplotlib and current_import fails with
 this error:

 Traceback (most recent call last):
   File /Users/mdipierro/web2py/gluon/restricted.py, line 192, in restricted
 exec ccode in environment
   File /Users/mdipierro/web2py/applications/wind2pow2/models/meteo.py 
 http://127.0.0.1:8000/admin/default/edit/wind2pow2/models/meteo.py, line 
 74, in module
 from meteo import model, data_units, meta_datas, getUniqueSequence
   File /Users/mdipierro/web2py/gluon/custom_import.py, line 280, in __call__
 fromlist, level)
   File /Users/mdipierro/web2py/gluon/custom_import.py, line 124, in __call__

 raise e  # Don't hide something that went wrong
 ImportError: No module named meteo


 This error is not quite correct.

 Massimo


Hello Massimo,

Sorry, I was not very available. So as I understand, the problem here is
that the custom importer does not give a proper error message? An error is
expected but it does not show the right one?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/7/4 Massimo Di Pierro massimo.dipie...@gmail.com

 yes. Not sure what the error should be


I created a ticket. Can you assign it to me? I think this is low priority. I
take a look later.

http://code.google.com/p/web2py/issues/detail?id=325

A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/7/4 Massimo Di Pierro massimo.dipie...@gmail.com

 I do not see an option to assign a ticket. You should be able to write,
 comment and close it anyway.

 Massimo



I can only comment. I cannot change the status or the priority. I don't why.
I have these options for my own Google projects but I don't know how it
works precisely or why it does/does not display.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Pierre Thibault
2011/6/26 sebastian sebastianov...@gmail.com

 what about the functions defined in the models ? (global functions)



Pydev won't see them because they are imported implicitly by web2py. You can
use the if 0: trick so the static code analyzer will not complain:

if 0:
  from applications.myapp.models import myfunc

In the preferences of Pydev you can make if fold-able to be able to fold
the noisy code: Window  Preferences  Pydev  Editor  Folding

There is not much you can do because this is not a standard way to do things
in Python. Breaking from the standard has his part of ugly.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Pierre Thibault
2011/6/26 Sebastian E. Ovide sebastian.ov...@gmail.com

 add info:

 from applications.soso.models import my_db_helper_here

 eclipse give this error:

 Unresolved import: my_db_helper_here
 Unused import: my_db_helper_here


Is the web2py folder in your path?

I guess you are missing a level. Try something like:

from applications.soso.models.some_module import my_db_helper_here

I'm sorry I forgot the some_module in my first example.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Running web2py on Jython

2011-06-24 Thread Pierre Thibault
2011/6/23 Richard richb...@gmail.com

 Hi Pierre,


Hi Richard,



 thanks for replying. I remember that I already stumbled upon the blog
 page you mention before I posted my question on this list. I admit
 that I didn't read it in depth back then. But I took as a good sign
 that you wrote in your final line: Everything works fine and web2py
 runs with Jython. :-)

 I did not read it in detail because your description was not quite
 matching with my prospective setup. My Linux distribution won't be
 quite the same, and as a restricted user I will certainly be in no
 position to install packages. In addition to that I didn't understand
 some details of your instructions. Why would it be necessary to build
 the SQLite native library? It is true that Jython comes *without* a
 sqlite3 module (import sqlite3 fails on Jython). But that's why the
 zxJDBC driver has to be put into the classpath. When it is loaded it
 will be announced in the web2py startup with the line Database
 drivers available: pymysql, zxJDBC. IMHO that should suffice.


I think the key here is understanding the differences between Python and
Jython. Jython runs in the Java environment. Jython access databases using
zxJDBC and zxJDBC access the databases using the Java JDBC infrastructure.
zxJDBC is itself an implementation of Python 2.0 DBI interface standard: the
interface Python uses to access databases.

If Jython has access to SQLite databases, it means Java has access to these
databases too. So it may be necessary to build these libraries so Java can
use them using JNI (Jana Native Interface). Python, not Jython, uses C
extensions while Jython does not because it uses Java.

I suggest reading
http://www.jython.org/jythonbook/en/1.0/DatabasesAndJython.html for better
understanding on the subject.



 I am certainly missing parts of the whole picture here, but if
 building a SQLite native library is a required step for setting up
 web2py on Jython, it certainly should be put into the Official web2py
 Book. So far there is no mention of such a requirement now.


I don't think these issues are related to web2py. They are specific to
Jython.


 On the contrary, I believe the native sqlite library is not needed.
 Most convincing for me: When I start a clean source code install of
 web2py R-1.85.2 unter Jython/Linux and access the welcome app via
 browser, then a sqlite database automagically appears in the
 filesystemin a newly created folder 'databases'. Via admin app the
 database can be edited. For example I added a new user and then
 verified that the new entry was written to the database file.


It is already installed then.



 As an addititional note, when I verified this behaviour with R-1.85.2,
 I noticed a bug (attention Massimo). Unter Jython the name of the
 database, as declared in models/db.py, gets 'shortened'. With the
 standard declaration db = DAL('sqlite://storage.sqlite') the name of
 the file in folder 'databases' is  'ge.sqlite'. If I change the name
 in the declaration to 'richardstorage.sqlite' the real database file
 is named 'rdstorage.sqlite'. Somehow the first five chars get dropped
 unter Jython 2.5.2, verified unter Windows XP and Linux (Ubuntu
 derivative). No such error running this version of web2py under Python
 2.6. I can't tell if this error still exist in hg tip since other
 errors stop me before that point :-(


I saw this bug before. It is not corrected or is the version too old?



 Regards,
 Richard




-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Running web2py on Jython

2011-06-23 Thread Pierre Thibault
2011/6/23 Richard richb...@gmail.com

 Hi,

 has anyone running a reasonably current version of web2py running on
 Jython 2.5.x? I need help with this.


Hello Richard,

Yes, I did a try but I didn't wanted to go very far with that. I was just
curious about giving it a try.

I had a problem with the database stuff I remember. I think this is the same
issue that you have.

web2py is no longer working with Python 2.4. Python 2.4 is old stuff now.

Here I wrote about using SQLite with Jython. I think this can help:
http://pierrethibault.posterous.com/?tag=jythonpage=2
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-20 Thread Pierre Thibault
2011/6/20 weheh richard_gor...@verizon.net

 Hi Pierre, I've read your excellent pages and followed your
 instructions before, to good effect. Of course, the downside is that
 one ends up with a lot of junk code in the beginning of one's files. I
 was under the impression that the latest version of web2py bypassed
 all that with a simple 1-liner: from gluon import *  but this doesn't
 seem to be the case as it doesn't work for me. Hence, my question and
 this thread. Thanks for the quick response!



Thank you Weheh. This is the best solution I know for working with Pydev and
web2py. Definitively not perfect.

The good news is that it seems that the Pydev team is working on something
to improve the support of web2py:
http://groups.google.com/group/web2py/browse_thread/thread/38784ca3ebf3bbb0/aeded9d3cab7c468?lnk=gstq=pydev#aeded9d3cab7c468

We can hope for the best.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: import error

2011-06-20 Thread Pierre Thibault
2011/6/20 selecta gr...@delarue-berlin.de

 the open id error is gone now
 (globals = None - AttributeError: 'NoneType' object has no attribute
 'get')
 but the pygments error still exists
  oldmod = sys.modules['pygments.lexers']
  KeyError: 'pygments.lexers'
 any clue about this one?
 --


Hello,

The importer will import the module as something like
applications.appname.modules.pygments (this the name used for sys.modules)
if the module to import is in the directory modules. This enables to have
different versions of the same module for different applications.

Since pygments is accessing a module with sys.modules, you cannot use
pygments in the modules directory. You can put pygments in site-packages
instead. Or you can modify pygments for working with web2py (more difficult
I guess).

This is feature. It is not a bug.

I guess I can improve the design by replacing sys.modules by a class that
will do the lockup in applications.appname if it fails like in this example.
How can I access appname from the code? I guess this is the new thread
variable thing implemented recently.

How much do you need this extra feature?

A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] import from my modules with reload

2011-06-20 Thread Pierre Thibault
2011/6/20 Manuele Pesenti manuele.pese...@gmail.com

 is it possible?
 using features nearly introduced and importing modules with
 import mymodules

 is it possible to have a reload of the modules just modified?

 thanks a lot

Manuele


Yes.

You can use the Python reload function.

Or you can use the date tracking feature of web2py that will check the date
of each module imported and import the last version automatically.

Put this code at the beginning of your models:

from gluon.custom_import import track_changes
track_changes()
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re : Re: web2py with Eclipse

2011-06-20 Thread Pierre Thibault
On May 10, 8:46 am, Massimo Di Pierro massimo@gmail.com 
wrote: 
 This is going to be easier in the future. Using trunk, just add this 
 to models: 
 
 from gluon import * 
 request,session,response,T,
cache=current.request,current,session,curremt.response,current.t,current.cache

Can we the same trick for the controllers?


Re: [web2py] Re: import error

2011-06-20 Thread Pierre Thibault
2011/6/20 selecta gr...@delarue-berlin.de

  I guess I can improve the design by replacing sys.modules by a class that
  will do the lockup in applications.appname if it fails like in this
 example.
  How can I access appname from the code? I guess this is the new thread
  variable thing implemented recently.

 not sure i can follow you here, do you mean request.application?? no i
 guess i'm lost


It is a bit like you said but request is only available for models,
controllers and views so the thread variable thing was added for core
modules. I don't know yet if I can use this technique in
gluon.custom_import.



 
  How much do you need this extra feature?

 well, what i want to do is to create an application that i can
 distribute easily (pyMantis, ...) for this i need to be able to add
 new modules in future distributions and remove them again if they are
 not needed, so far I have written a plugin for creating releases (win
 linux mac and web2py app packages) and updating running releases
 (using the web2py app packages). The plugin currently looks into the
 site packages folder and adds all site packages from a local myapp/
 site-packages directory. This i not so nice i think and also a bit
 error-prone. So it would be nice to create web2py app packages that
 just work without any further setup steps (just like web2pys
 philosophy: batteries included)


Yes, but I think it is the only module to have that bug and it plays with
low level stuff instead of doing standard imports. Before a fix is made, you
try to replace:

oldmod = sys.modules['pygments.lexers']

with:

import pygments.lexers as oldmod

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: import error

2011-06-20 Thread Pierre Thibault
2011/6/20 selecta gr...@delarue-berlin.de


  try to replace:
 
  oldmod = sys.modules['pygments.lexers']
 
  with:
 
  import pygments.lexers as oldmod

 hagrr why must pygements be so ...

 i tried that but i got
 File applications/pygments_test/modules/pygments/lexers/__init__.py,
 line 223, in module
 import pygments.lexers as oldmod
 AttributeError: 'module' object has no attribute 'lexers'


The importer won't be very hard to fix. I just need the access the name of
the application with the thread local variable. I think Jonathan did that
stuff. I'll wait for his answer.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-20 Thread Pierre Thibault
2011/6/20 weheh richard_gor...@verizon.net

 @Anthony, Unfortunately, this code from the other thread does not work
 for my Eclipse installation:

 if 0:
from gluon.dal import DAL
from gluon.tools import Auth
db = DAL()
auth = Auth()


 The only thing that has worked so far is Pierre's implementation,
 which is (no offense) unbelievably ugly (but effective).


To ease things, it is possible to make if fold-able: Window  Preferences 
Pydev  Editor  Code folding  Fold if statements. Then you click in the
gutter to reduce in only one line.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] web2py with Eclipse -- still lots of undefined stuff

2011-06-19 Thread Pierre Thibault
2011/6/19 weheh richard_gor...@verizon.net

 I'm using web2py 1.96.4 with Eclipse. I put
from gluon import *
 in a model I was debugging. Eclipse still shows all the web2py stuff
 like db, DIV, session, T, etc. as being undefined variables. What am I
 doing wrong?


All these things are magically imported by web2py. This is not standard
Python programming.

Here a few pointers:

http://pierrethibault.posterous.com/?tag=eclipsepage=2

http://pierrethibault.posterous.com/tag/eclipse

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Recognizing and suggesting names

2011-06-18 Thread Pierre Thibault
2011/6/18 Dwayne dwaynebl...@gmail.com

 Dear all,

 When I type an email address on hotmail or gmail, the email address is
 recognized if it exists and also hotmail and gmail make some
 suggestions.
 The same system exists for tags on Stackoverflow. Suggestions are made
 and existing tags are recognized.

 Does a similar system exist in web2py ? I would like to apply it to
 names (first and last names together).

 Thanks a lot,
 Dwayne


I don't know but I believe that this the kind of things that would be a nice
addition as a plug-in.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: import error

2011-06-17 Thread Pierre Thibault
2011/6/17 Massimo Di Pierro massimo.dipie...@gmail.com

 uploading your fix to trunk.

 On Jun 17, 8:50 am, amit in4tu...@gmail.com wrote:
  I am getting the same import error as the OP. The problem occurs when
  an external module calls __import__ but has passed globals=None. The
  following patch in gluon/custom_import.py fixes it for me, since in
  this case, web2py does not need to perform any customized import.
 

  255c255
   and not name.startswith(applications.):
  ---
 
   and not name.startswith(applications.) and not
 globals==None:
 


Exact. I prefer and isinstance(globals, dict) to not globals==None.

Note that this patch means that the modules directory not be searched in
that case.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] bug in custom_import.py

2011-06-17 Thread Pierre Thibault
2011/6/17 Jose jjac...@gmail.com

 at line 254 (trunk version)

if not name.startswith(.) and level = 0 and globals != None
 and
and not name.startswith(applications.):

 Jose


?? What do you mean? More information is needed.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] bug in custom_import.py

2011-06-17 Thread Pierre Thibault
2011/6/17 Jonathan Lundell jlund...@pobox.com

 On Jun 17, 2011, at 2:28 PM, Pierre Thibault wrote:

 2011/6/17 Jose jjac...@gmail.com

 at line 254 (trunk version)

if not name.startswith(.) and level = 0 and globals != None
 and
and not name.startswith(applications.):

 Jose


 ?? What do you mean? More information is needed.


 There are two 'and's in a row. (Also: globals is not None)


OK. I think Massimo made an error with the patch. Here is my personal code:

if not name.startswith(.) and level = 0 \
and not name.startswith(applications.) \
and isinstance(globals, dict):

Massimo, can you correct?
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: import error

2011-06-17 Thread Pierre Thibault
2011/6/17 selecta gr...@delarue-berlin.de

 I also have problems importing pygments from the modules directory
 http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.pygments_test.w2p

 i downloaded pygments from http://pypi.python.org/pypi/Pygments


Do you still have problems with you are using the last version of trunk?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: import error

2011-06-16 Thread Pierre Thibault
2011/6/15 Massimo Di Pierro massimo.dipie...@gmail.com

 looking into this...


Still no news. Should we forget this issue? I really would like to debug but
I don't have enough information. It seems the bug is very rare.



 On Jun 15, 8:12 am, mb_...@yahoo.fr mb_...@yahoo.fr wrote:
  I wanted to use the w2popenid example application from bitbucket
  website :https://bitbucket.org/bottiger/web2py-openid/overview
   I have downloaded and placed the code in the applications directory.
  I have changed in the models folder the file db.py: this line from
  applications.cas.modules.w2popenid import OpenIDLogin is replaced
  with this one from w2popenid import OpenIDLogin or this from
  applications.w2popenid.modules.import OpenIDLogin. But it don't
  worked. I get to follow this trace
  Traceback (most recent call last):
File /home/mamadou/Desktop/web2py/gluon/restricted.py, line 192,
  in restricted
  exec ccode in environment
File /home/mamadou/Desktop/web2py/applications/w2popenid/models/
  db.py, line 42, in module
  from testing import lala
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
  280, in __call__
  fromlist, level)
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
  in __call__
  level)
File /home/mamadou/Desktop/web2py/applications/w2popenid/modules/
  testing.py, line 7, in module
  import openid.consumer.consumer
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
  280, in __call__
  fromlist, level)
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
  in __call__
  level)
File /usr/lib/pymodules/python2.7/openid/consumer/consumer.py,
  line 197, in module
  from openid.consumer.discover import discover,
  OpenIDServiceEndpoint, \
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
  280, in __call__
  fromlist, level)
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
  in __call__
  level)
File /usr/lib/pymodules/python2.7/openid/consumer/discover.py,
  line 21, in module
  from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
  280, in __call__
  fromlist, level)
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
  in __call__
  level)
File /usr/lib/pymodules/python2.7/openid/yadis/etxrd.py, line 28,
  in module
  ElementTree = importElementTree()
File /usr/lib/pymodules/python2.7/openid/oidutil.py, line 58, in
  importElementTree
  ElementTree = __import__(mod_name, None, None, ['unused'])
File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
  258, in __call__
  globals.get(__file__, ))
  AttributeError: 'NoneType' object has no attribute 'get'
 
  to fix i must modify the module custom_import in the web2py/gluon
  folder.
  starting line 256
 
  try:
  caller_file_name = os.path.join(self.web2py_path,
  \globals.get(__file__, ))
  except AttributeError:
  caller_file_name = 




-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] import error

2011-06-15 Thread Pierre Thibault
2011/6/15 mb_...@yahoo.fr mb_...@yahoo.fr

 I wanted to use the w2popenid example application from bitbucket
 website : https://bitbucket.org/bottiger/web2py-openid/overview
  I have downloaded and placed the code in the applications directory.
 I have changed in the models folder the file db.py: this line from
 applications.cas.modules.w2popenid import OpenIDLogin is replaced
 with this one from w2popenid import OpenIDLogin or this from
 applications.w2popenid.modules.import OpenIDLogin. But it don't
 worked. I get to follow this trace
 Traceback (most recent call last):
  File /home/mamadou/Desktop/web2py/gluon/restricted.py, line 192,
 in restricted
exec ccode in environment
  File /home/mamadou/Desktop/web2py/applications/w2popenid/models/
 db.py, line 42, in module
from testing import lala
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
 280, in __call__
fromlist, level)
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
 in __call__
level)
  File /home/mamadou/Desktop/web2py/applications/w2popenid/modules/
 testing.py, line 7, in module
import openid.consumer.consumer
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
 280, in __call__
fromlist, level)
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
 in __call__
level)
  File /usr/lib/pymodules/python2.7/openid/consumer/consumer.py,
 line 197, in module
from openid.consumer.discover import discover,
 OpenIDServiceEndpoint, \
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
 280, in __call__
fromlist, level)
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
 in __call__
level)
  File /usr/lib/pymodules/python2.7/openid/consumer/discover.py,
 line 21, in module
from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
 280, in __call__
fromlist, level)
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line 75,
 in __call__
level)
  File /usr/lib/pymodules/python2.7/openid/yadis/etxrd.py, line 28,
 in module
ElementTree = importElementTree()
  File /usr/lib/pymodules/python2.7/openid/oidutil.py, line 58, in
 importElementTree
ElementTree = __import__(mod_name, None, None, ['unused'])
  File /home/mamadou/Desktop/web2py/gluon/custom_import.py, line
 258, in __call__
globals.get(__file__, ))
 AttributeError: 'NoneType' object has no attribute 'get'

 to fix i must modify the module custom_import in the web2py/gluon
 folder.
 starting line 256

 try:
caller_file_name = os.path.join(self.web2py_path,
 \globals.get(__file__, ))
 except AttributeError:
 caller_file_name = 



Hi,

Could you send me the code of your app and instructions on how to reproduce
the problem in my personal mail box? I will investigate the problem. Thank
you.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] How do you document your apps?

2011-06-15 Thread Pierre Thibault
I like epydoc. It is supported by pydev. It is simple. Sphinx is more both
more powerful and more complex.

I am sending my epydoc Eclipse external tool as an attachment. I think you
just have to put the file somewhere in an open project to make it available
as a external tool. To use it, click on your project and choose the command
from the external tool menu available in the tool bar.

2011/6/15 Marcel Luethi marcel.lue...@gmail.com

 Hello!

 I just finished an internal project using web2py (1.95.1) and have to
 document it for my colleagues.
 Preferably it is a system based of doc strings. Maybe Sphinx?

 Question:
 What are you using?
 Do you have any suggestions?

 Thanks in advance for your input!

 Best regards,
 Marcel




-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Epydoc.launch
Description: Binary data


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-11 Thread Pierre Thibault
2011/6/11 Alessandro Iob alessandro@gmail.com

 Hi Pierre,

 I'll send a test application to Anthony this weekend.

 I've experienced the same problem under OS X (with a case-insensitive file
 system) when I've changed the case from Castalia to castalia:
 web2py tried to include the controllers from old Castalia path and not
 from the new lowercase version. Obviously I've closed and restarted web2py
 before changing the application name. I think OS X has a filename cache of
 some kind.

 Alessandro


OK, cool! I'll be the reference for questions on the code. If needed, you
may write directly to my personal mail box. I don't follow everything on the
web2py mailing list because there is too many messages so I may sometimes
miss something.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Script TDD in web2py

2011-06-11 Thread Pierre Thibault
2011/6/10 contatogilson...@gmail.com contatogilson...@gmail.com

 Hello guys,

 I started to create a script to test the scripts that use the library
 unittest projects web2py. I usually like this:

 - I create the folder *tests* in the project;
 - Inside the tests folder create two folders: *models* and *controllers*;

 For now, I have done is to test the model layer. But I ask the help and
 contribution ofall to improve this script, and so we have a full support to
 the use of TDD in both themodel layer as the control. This is good for
 people like me, sympathized greatly with doctests.


Hello Gilson,

This is something I thought about. Here is my idea about web2py testing:

1) I want to use py.test (http://doc.pytest.org/en/latest/) for testing. I
don't want to have to create my test suits manually and with py.test I can
mark my functions with decorators to create test suits.

2) For the controllers, I want to create two types of tests: web GUI tests
and headless tests.

For the web gui tests, I plan to use Windmill (http://www.getwindmill.com/).

For the headless tests, I plan to use WebTest (
http://pythonpaste.org/webtest/).

More specifically, I want my test suits to start web2py on another thread.
This way pydev will be able to give me the code coverage at the end of my
tests. For headless tests, I plan with send my http request with a special
argument like test=true so my controller will know it is a test. Then I
will decorate my controller functions so that instead of returning a
dictionary to be rendered by the view, it will stream the dictionary as a
file and my tests will be able to easily analyze the results by downloading
the file and recreating the same dictionary.

Yet, I have to implemented this solution but this is what I have in mind.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Script TDD in web2py

2011-06-11 Thread Pierre Thibault
2011/6/11 contatogilson...@gmail.com contatogilson...@gmail.com

 Show an example of how you use py.test to perform unit tests on the model
 layer and controller.

 _
 *Gilson Filho*
 *Web Developer
 http://gilsondev.com*


I have nothing concrete yet. I am just thinking about what might be the best
strategy.

I don't know what I will do with the models. What one way would be a
controller made to return the globals. Do I need to test the models? It may
be seen as configuration files.

The other thing I plan to do is put the application logic in the modules
directory. This way, I can test the business logic without web2py and I
reuse the logic in other apps.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Script TDD in web2py

2011-06-11 Thread Pierre Thibault
2011/6/11 contatogilson...@gmail.com contatogilson...@gmail.com

 Yes, I understand. But the issue is the use of the gluon. Perform tests is
 fine, the problem is to run the same tests using the libraries and gluon. 
 Therefore
 it has to import them. Hence the creation of this script.


The code to start web2py is in web2py.py. I'll have to create a similar code
to start it but I want to start it without a gui interface. I also want to
start it at the beginning of the tests and stop it at the end.

Your strategy is different: you are executing code like if that code was in
a web2py environment. I prefer to use another strategy: I run web2py itself
and I send real http request from a real client. This way, I cannot have
bugs because the mockup environment is different from the real one: I am
testing the real thing. I think it is a better approach.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Script TDD in web2py

2011-06-11 Thread Pierre Thibault
2011/6/11 contatogilson...@gmail.com contatogilson...@gmail.com

 So when you create the script makes available for us to test and to use =)


Well, it is better than I thought. I don't even need such a script! Sorry to
say that. :-)

I can start web2py from Eclipse with code coverage. After that I can start,
also from Eclipse, my test suit (gui or headless) and I will get both my
test results and my code coverage for my tests after the tests has run. The
only thing I will need is the decorator thing I talked about. I don't think
it will be hard to do.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Script TDD in web2py

2011-06-11 Thread Pierre Thibault
2011/6/12 anil manikyam anilmanikya...@gmail.com




  *i want to update last row in a table in web2py how?*


 --
 @n!l m@n!ky@m



Hi Anil, I think this is a bit out of subject. Please, open a new conversion
with a new subject.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: New Features in Book

2011-06-10 Thread Pierre Thibault
I can talk about the features that I implemented. Just ask.

We could be documentation driven: The developer writes the feature he is
going to implement, we write the tests (tests driven) and then he writes the
implementation. This process will creates the documentation we need for the
book.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-10 Thread Pierre Thibault
2011/6/9 Pierre Thibault pierre.thibau...@gmail.com

 2011/6/9 caleb.hatti...@gmail.com

 On , Anthony abasta...@gmail.com wrote:
  Do you have an app to reproduce the problem? I created an app named
 Castalia (note the capitalization) with a module
 /modules/selfgroup/castalia/config.py, which I think is the same structure
 and naming as Alessandro's app. In a controller action, I then did:
 
  from selfgroup.castalia import config
 
  and it seems to work fine, though I believe Alessandro was getting an
 import error at that point. But maybe I'm missing something.

 I think we should ask him to make a small test app for us that
 demonstrates the problem. Else we're guessing.


 Alessandro, can you send us the code having the unexpected behavior so the
 Windows guys can take a look?

 As I understand, you have to remove the capitalization to make it work
 because otherwise even if the capitalization match, it does not import
 properly. Right?

 --


OK, since we cannot reproduce the bug and we cannot know precisely what the
bug is, we will consider the issue closed. Do you think there is something
to add about this issue?


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: PyCharm is going to support web2py

2011-06-09 Thread Pierre Thibault
2011/6/9 Ross Peoples ross.peop...@gmail.com

 Not to start a holy war or anything, but I hear people talking all the time
 about how emacs or vim is the best code editor ever. Why is that? Does it do
 code completion or have some other really helpful feature that I just
 missed? I've used vim to edit text files, but editing code in a tiny console
 window just doesn't seem very friendly. Is there something I'm missing here?



I think they are very powerful editors but they are also difficult to learn.
Emacs is too hard for me I believe.

I prefer Eclipse with Pydev because it is very integrated: editor, debugger,
static code analyzer, Mercurial commands in the contextual menu, access to
tickets from the editor, code coverage reports and more.

I documented the integration I did with Eclipse:
http://pierrethibault.posterous.com/?tag=web2pypage=2

These questions lead to very personal response.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Pierre Thibault
2011/6/9 caleb.hatti...@gmail.com

 On , Pierre Thibault pierre.thibau...@gmail.com wrote:
  2011/6/9 cjrh caleb.hatti...@gmail.com
 
  On Thursday, 9 June 2011 03:03:51 UTC+2, Massimo Di Pierro wrote:Users
 who have an opinion please share it now. This is important.
 
  Could you direct us to more details about the issue?My current
 understanding is shallow, but I agree with Pierre that platform-specific
 environment settings are very likely not the way to go here.   I much prefer
 all cross-platform issues to be handled with the os and sub modules.   Why
 can't we do that here?
 
  It seems we have no developer with Windows where is the problem.

 I am on Windows, still XP even. Is there a small zipped app that I could
 test quickly to see the problem?


Sure, if you can debug code. Get code from the Mercurial repository. Debug
and submit the patch to Massimo. Look for the problem described by
Alessandro.

You'll find the information you need on the problem on the threads named
web2py 1.96.*x* is OUT.

It is probably a bug with the code I wrote but I don't have a Windows
machine to debug a problem specific to this platform.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: PyCharm is going to support web2py

2011-06-09 Thread Pierre Thibault
2011/6/9 Ross Peoples ross.peop...@gmail.com

 Not to start a holy war or anything, but I hear people talking all the time
 about how emacs or vim is the best code editor ever. Why is that? Does it do
 code completion or have some other really helpful feature that I just
 missed? I've used vim to edit text files, but editing code in a tiny console
 window just doesn't seem very friendly. Is there something I'm missing here?


Here is a thread on the subject:
http://groups.google.com/group/montrealpython/browse_thread/thread/87a05b7188e28168/2dc66732948da2ba?lnk=gstq=eclipse#2dc66732948da2ba

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Project: pydev extension for web2py in Eclipse

2011-06-09 Thread Pierre Thibault
You can use this project: http://code.google.com/p/neo-insert-imports/ to
add automatically the necessary imports for the static analyzer.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Pierre Thibault
2011/6/9 caleb.hatti...@gmail.com

 On , Anthony abasta...@gmail.com wrote:
  Do you have an app to reproduce the problem? I created an app named
 Castalia (note the capitalization) with a module
 /modules/selfgroup/castalia/config.py, which I think is the same structure
 and naming as Alessandro's app. In a controller action, I then did:
 
  from selfgroup.castalia import config
 
  and it seems to work fine, though I believe Alessandro was getting an
 import error at that point. But maybe I'm missing something.

 I think we should ask him to make a small test app for us that demonstrates
 the problem. Else we're guessing.


Alessandro, can you send us the code having the unexpected behavior so the
Windows guys can take a look?

As I understand, you have to remove the capitalization to make it work
because otherwise even if the capitalization match, it does not import
properly. Right?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/7 Massimo Di Pierro massimo.dipie...@gmail.com

 I am not much of a windows user. I would like to understand what can
 go wrong with the solution in trunk?
 --


Is the solution in the trunk the one proposed by Alessandro:

os.environ['PYTHONCASEOK'] = '1'

?

Well, this solution is using a global change to fix for what is just
probably just one bad line of code. This a good temporary solution but a bad
long term solution.

This is solution have the following flaws:

- This solution may impact a lot of code;
- Developers may experience unexpected behavior;
- It makes it difficult to integrate web2py code with other code;

The last flaw is very nasty. One example is web2py needing a special Python
setting and another piece of code needing another setting. So each time
execution switches from one source to another, the settings has to be
restored properly. This may mean a big patch needs to be applied to make it
work. This is the risk I see in this solution.

And this problem is more probably related to a case insensitive file system
than Windows itself. It may be only related to the file system type.

This is why I suggested a ticket for a better fix later.


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/8 Massimo Di Pierro massimo.dipie...@gmail.com

 Let me tink about this.
 This has relevant content:
 http://www.python.org/dev/peps/pep-0235/

 Users who have an opinion please share it now. This is important.


Thank you for the pointer. It seems there is a bug in the web2py code where
we are losing the capitalization. The import on Windows should work just
like if it was on Unix. The best thing would be to fix this bug but it has
to be done on Windows so until then we can create a ticket.

I suggest to remove the current fix in trunk because it is too awkward.
Alessandro can use lower case letters until real fix done.

I think it is the best solution for the moment.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/8 Jonathan Lundell jlund...@pobox.com

 On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
 
  Let me tink about this.
  This has relevant content:
  http://www.python.org/dev/peps/pep-0235/
 
  Users who have an opinion please share it now. This is important.

 What's going on, exactly? My impression is that something is getting
 lowercased that shouldn't be. Is it not within web2py's control?



Yes, I think it is a bug somewhere in the patch that I submitted.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-07 Thread Pierre Thibault
2011/6/7 Alessandro Iob alessandro@gmail.com

 I have fixed the problem adding the following code in one of my models:

 import os
 os.environ['PYTHONCASEOK'] = '1'

 It makes ignore path case on operating systems with case-insensitive
 file-systems (namely Win32 and OS/X with the default fs).

 Do you think it should be added, with a proper os test, to the importer
 code?



No. Now that we know the problem, or that we have enough information to
easily locate the lines of code in problem, we can fix these lines. We need
someone who can do it on Windows.

I don't like the idea of global change of the Python environment. A local
fix is far better solution and it should not very difficult to do in this
case.

Thank you for your collaboration.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] web2py 1.96.4 is OUT

2011-06-07 Thread Pierre Thibault
2011/6/7 Massimo Di Pierro massimo.dipie...@gmail.com

 - auto import should work on windows (now on windows ignore will
 ignore case by default)


I don't like this solution.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread Pierre Thibault
2011/6/7 Massimo Di Pierro massimo.dipie...@gmail.com

 What do you propose? I do not like it very much either.

 On Jun 7, 3:33 pm, Pierre Thibault pierre.thibau...@gmail.com wrote:
  2011/6/7 Massimo Di Pierro massimo.dipie...@gmail.com
 
   - auto import should work on windows (now on windows ignore will
   ignore case by default)
 
  I don't like this solution.
 
  --
 
  A+


I guess it is a pragmatic solution until someone can edit and test the code
under Windows. I suggest creating a ticket with low priority for doing this
later as an improvement.

A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 No, it does not work. And the problem is not related to the 
 *_DateTrackerImporter
 as I'm not using the track_changes options.*

 **I've made some tests and I've found that in _Web2pyImporter.__call__ the
 code reaches the import like 'from x import a, b, ...' section with the
 vars set to:

  name = selfgroup.castalia
 caller_file_name =
 C:\w2p\web2py\applications\castalia\controllers/default.py
 self.web2py_path = C:\w2p\web2py
 match_app_dir = _sre.SRE_Match object at 0x018B7420
 modules_prefix = applications.castalia.modules
 module_prefix + '.' + name =
 applications.castalia.modules.selfgroup.castalia
 fromlist = ('config',)
 level = -1

 then the call to

 super(_Web2pyImporter, self).__call__(
  modules_prefix+.+name, globals, locals, fromlist, level
 )

 raises the ImportError exception (No module named
 castalia.modules.selfgroup.castalia).
 The sys.path seems correct:

  ['', 'C:\\w2p\\web2py\\site-packages', 'C:\\w2p\\web2py',
 'C:\\w2p\\web2py\\gluon', 'C:\\w2p\\web2py\\library.zip']

 No clue.


There is something weird here. You said that:

module_prefix + '.' + name =
applications.castalia.modules.selfgroup.castalia

super(_Web2pyImporter, self).__call__(
 modules_prefix+.+name, globals, locals, fromlist, level
)


But the error is:

raises the ImportError exception (No module named
castalia.modules.selfgroup.castalia).

I would expect No module named *applications*
.castalia.modules.selfgroup.castalia.

Why is applicaitons missing?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 I really do not know why, but that's the error. A mistery for me.



Can you trace the super call?


 On 6/6/11 15:42 , Pierre Thibault wrote:

 2011/6/6 Alessandro Iob alessandro@gmail.com
 mailto:alessandro@gmail.com


No, it does not work. And the problem is not related to the
*_DateTrackerImporter as I'm not using the track_changes options.*

**I've made some tests and I've found that in
_Web2pyImporter.__call__ the code reaches the import like 'from x
import a, b, ...' section with the vars set to:

name = selfgroup.castalia
caller_file_name =
C:\w2p\web2py\applications\castalia\controllers/default.py
self.web2py_path = C:\w2p\web2py
match_app_dir = _sre.SRE_Match object at 0x018B7420
modules_prefix = applications.castalia.modules
module_prefix + '.' + name =
applications.castalia.modules.selfgroup.castalia
fromlist = ('config',)
level = -1

then the call to

super(_Web2pyImporter, self).__call__(
modules_prefix+.+name, globals, locals, fromlist, level
)

raises the ImportError exception (No module named
castalia.modules.selfgroup.castalia).
The sys.path seems correct:

['', 'C:\\w2p\\web2py\\site-packages', 'C:\\w2p\\web2py',
'C:\\w2p\\web2py\\gluon', 'C:\\w2p\\web2py\\library.zip']

No clue.


 There is something weird here. You said that:

 module_prefix + '.' + name =
 applications.castalia.modules.selfgroup.castalia

 super(_Web2pyImporter, self).__call__(
 modules_prefix+.+name, globals, locals, fromlist, level
 )


 But the error is:

 raises the ImportError exception (No module named
 castalia.modules.selfgroup.castalia).

 I would expect No module named
 *applications*.castalia.modules.selfgroup.castalia.

 Why is applicaitons missing?

 --


 A+

 -
 Pierre
 My blog and profile (http://pierrethibault.posterous.com)
 http://pierrethibault.posterous.com
 YouTube page (http://www.youtube.com/user/tubetib)
 http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2




-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Massimo Di Pierro massimo.dipie...@gmail.com

 I do not understand this line:

 module_prefix + '.' + name =
 applications.castalia.modules.selfgroup.castalia

 does not look like a valid Python statement to me.
 --


I interpreted this as the value of the expression module_prefix + '.' + nameis
applications.castalia.modules.selfgroup.castalia. I think this what
Alessandro wanted to express.

A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 I'll try, but the super is really just the standard __import__ method.



What is the value of name there?
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 the name arg passed to _PYTHON_STANDARD_IMPORTER has value
 applications.castalia.modules.selfgroup.castalia.


OK. If you open a Python console, what does give you:

import sys

sys.path.append(C:\w2p\web2py)

import applications.castalia.modules.selfgroup.castalia

?


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 Found something: the application folder is named 'Castalia' with the first
 char in uppercase, while the importer tries to import it as
 'applications.castalia', in lowercase.

 I've tried from the python shell to import using applications.Castalia.
 and it worked.


Problem solved?


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-06 Thread Pierre Thibault
2011/6/6 Alessandro Iob alessandro@gmail.com

 No, it does not work. And the problem is not related to the 
 *_DateTrackerImporter
 as I'm not using the track_changes options.*

 **I've made some tests and I've found that in _Web2pyImporter.__call__ the
 code reaches the import like 'from x import a, b, ...' section with the
 vars set to:

  name = selfgroup.castalia
 caller_file_name =
 C:\w2p\web2py\applications\castalia\controllers/default.py
 self.web2py_path = C:\w2p\web2py
 match_app_dir = _sre.SRE_Match object at 0x018B7420
 modules_prefix = applications.castalia.modules
 module_prefix + '.' + name =
 applications.castalia.modules.selfgroup.castalia
 fromlist = ('config',)
 level = -1

 then the call to

 super(_Web2pyImporter, self).__call__(
  modules_prefix+.+name, globals, locals, fromlist, level
 )

 raises the ImportError exception (No module named
 castalia.modules.selfgroup.castalia).
 The sys.path seems correct:

  ['', 'C:\\w2p\\web2py\\site-packages', 'C:\\w2p\\web2py',
 'C:\\w2p\\web2py\\gluon', 'C:\\w2p\\web2py\\library.zip']

 No clue.



When you are using Castalia as the name of your application, is all code
values above appears with castalia in lower case?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-05 Thread Pierre Thibault
2011/6/5 Alessandro Iob alessandro@gmail.com

 Hi Pierre,

 this is the output of the code from the web2py application shell:

 web2py Shell Version 1.96.2 (2011-06-03 16:11:39)
 In [1] : from selfgroup.castalia import config

 Traceback (most recent call last):
   File gluon/contrib/shell.py, line 233, in run
   File string, line 1, in module
   File gluon/custom_import.py, line 280, in __call__
   File gluon/custom_import.py, line 125, in __call__
 ImportError: No module named selfgroup.castalia

 In [2] : import os
 In [3] : print
 os.stat(C:\web2py\\applications\Castalia\modules\selfgroup\castalia\__init__.py).st_mtime

 1304593994.0
 .

 Thank you very much,
 Alessandro


That seems OK. I don't know. My power is very limited here because I don't
have a Windows machine. I guess someone else will have to debug it. In that
case, I'll be happy to assist.  What else can I say??

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-04 Thread Pierre Thibault
2011/6/3 Alessandro Iob alessandro@gmail.com

 I have tried the new modules import feature (from mymodule import *, looks
 for mymodule in applications/thisapp/ modules first and then in sys.path. No
 more need for local_import) and it works wonderfully on OS/X but not at all
 on Windows. Below you can find the traceback.

 web2py™Version 1.96.2 (2011-06-03 16:11:39)PythonPython 2.5.4:
 C:\web2py\web2py.exe

 Traceback (most recent call last):
   File gluon/restricted.py, line 184, in restricted
   File C:/web2py/applications/castalia/controllers/default.py 
 http://127.0.0.1:8000/admin/default/edit/castalia/controllers/default.py, 
 line 2, in module
   File gluon/custom_import.py, line 280, in __call__
   File gluon/custom_import.py, line 125, in __call__
 ImportError: No module named selfgroup.castalia


 Any suggestion?

 Thank you



Hello Alessandro,

I wrote this code but I don't have Windows to do testing. I suspect it is a
problem related to os.stat.

Can you run this code on your machine and gave me the result?

import os
print os.stat(*path to the module you want to import*).st_mtime
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: web2py 1.96.1 is OUT

2011-06-01 Thread Pierre Thibault
But there is another cool feature in the trunk. If you look in gluon/
custom_import.py, you will see two new functions: is_tracking_changes and
track_changes. Call track_changes with True and web2py will track the
changes made to all Python module source files you are using. The new
importer will automatically reload the last version available at the next
import statement. Of course, is_tracking_changes() gives the current status.

What could be better? Well, the import tracking feature is generic so you
can use it in any Python project. If you want to use it outside web2py, use
the version available at
http://code.google.com/p/neo-i...http://code.google.com/p/neo-importer/

Take a look at Martin's blog:
http://martin.tecnodoc.com.ar/default/post/2011/05/13/20_optimize-your-web2py-app-using-the-new-import-method
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] What if Massimo got hit by a Bus?

2011-05-26 Thread Pierre Thibault
The bus will be fine. ;-)

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Help in documentation

2011-05-26 Thread Pierre Thibault
2011/5/26 Vinicius Assef vinicius...@gmail.com

 I'd like to help keeping docs up to date.

 How can I do that?

 --
 Vinicius Assef.


I don't know how things are working right now but I believe it would be
great that when I patch is applied, the person who did the patch would also
submit a description of what have been done.

It could be like sending a message on the mailing list with a specific
nomenclature like [web2py][mercurial id]Title of the change. This way
everyone will see the changes and it will keep a record. That same message
can also the description of change for the Mercurial repository.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Help in documentation

2011-05-26 Thread Pierre Thibault
2011/5/26 Bruno Rocha rochacbr...@gmail.com



 PS: What about a wiki on github?


There is already a wiki on Google Code.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Help in documentation

2011-05-26 Thread Pierre Thibault
2011/5/26 Bruno Rocha rochacbr...@gmail.com

 On Thu, May 26, 2011 at 3:08 PM, Pierre Thibault 
 pierre.thibau...@gmail.com wrote:

 There is already a wiki on Google Code


 GitHub has gist to embed code snipets, the github markup is very nice. and
 it is possible to have the posts in files so pull/push.

 I never used Google Code wiki, is it good?


I never used GitHub, is it good?

Well, I like it:

- You can have your repository with svn or Mercurial. No git I think.
- You have a wiki (the wiki is repository too)
- You can manage tickets.
- You can create others repositories for a same project.
- I am able to push my epydoc html documentation as part of the wiki
- You have a download section
- It push my changes to a Google Group so everyone can follow them
- It is possible to configure the tags and fields like I have a set of
fields to support scrum to way I want for my projects

I am very satisfy but it is only for open source projects. With bitbucket
you can host for 5 persons for free even if it is commercial (I believe). I
don't know bitbucket either.

The only thing I dislike is that when I create a new project, I have to copy
manually my configuration from a previous project to stay coherent. Or is it
possible to do otherwise?

See: http://pierrethibault.posterous.com/?tag=pythonpage=2

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: What if Massimo got hit by a Bus?

2011-05-26 Thread Pierre Thibault
2011/5/26 Nite nitese...@gmail.com

 This thread reminds me...

 Old programmers never die. They just decompile.
 Old programmers never die. They just lose their memory.
 Old programmers never die. They just byte it.
 Old programmers never die. They just get bugged with life.
 Old programmers never die. They just go to bits.
 Old programmers never die. They just branch to a new address.
 Old programmers never die. They just can’t C as well
 Old programming wizards never die, they just recurse.
 Old C programmers never die. They are just cast into void*
 Old Java programmers never die. They are garbage collected.
 Old programmers never die. They just terminate and stay resident.

 -- Nite


Or they become zombie process.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Better language support

2011-05-20 Thread Pierre Thibault
2011/5/20 mart msenecal...@gmail.com

 not sure if this applies, but just in case...

 years ago (i think 12, so this may be outdated), i worked in a
 localization team, (although it was a purely windows shop where words
 like dll was all that anyone talked about). Anyways, we adopted a
 method for 1) re-using translations (from translation tool kits (aka.
 TTKs) 2) standardizing on commonly accepted strings (i.e. there aren't
 too many ways to translate a yes/no button ;))  3) the language
 specific string tables would grow over time and served the task very
 well considering... (we only had 4 or 5 languages ;) english, swedish,
 japanese, simplified chinese, and french (fr_ca was deemed unworthy at
 the time ;))

 anyways, the moral is, that all strings going to UI were ripped out of
 the code and replaced with IDs where the users language selection
 would force load the language specific satellite dll @ run time -
 was just a dll with the resource strings in it.

 perhaps adopting something similar (but no dll's ;) ) would be
 beneficial?

 Mart :)



Hi Mart,

Thank you for sharing this experience. I guess you had the professional
resources to do all the translations. If we use a common dictionary for
web2py, we need all the translations for the languages we support for all
the words before doing a new release. Do we have to resources to do that? I
have some doubts.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] web2py messages being copied to other (spam) groups

2011-05-20 Thread Pierre Thibault
2011/5/20 Anthony abasta...@gmail.com

 It appears that messages to the web2py-users group are somehow being copied
 to various other groups, including
 https://groups.google.com/group/fameisfame/search?hl=engroup=fameisfameq=web2py,

 https://groups.google.com/group/fametest/search?hl=engroup=fametestq=web2py,
 and
 https://groups.google.com/group/somanyjobs/search?hl=engroup=somanyjobsq=web2py
 .

 Does anyone know what's going on or how that could be happening? Seems very
 odd.




I believe the Google Groups are corrupted. I had messages that the service
was not available now. I refresh and then the service is back.

Very odd indeed.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Better language support

2011-05-20 Thread Pierre Thibault
You made good points. I think that it is important to have a process that
can support the community we are.

Here is my last idea on the subject:

We can support a global translation repository just like Jonathan was
proposing. But if an application has not for example a custom dictionary for
German, then web2py will not continue its search to try to get another
translation in the global repository.

Also, when a new application is created with the web interface, web2py will
ask what are the languages to be available for the new app. This will avoid
trailing dictionaries.

This way of doing will avoid partial translations where only a word up and
there is translated. Instead, there will be no translation at all and I
think this is a lot nicer.

Sounds good?


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: pythonanywhere

2011-05-20 Thread Pierre Thibault
2011/5/20 Ialejandro ialejandr...@gmail.com

 Well, in fact Resolver One is made with IronPython (asp.net). I read
 it in the book IronPython in action which is written by one of the
 developers of Resolverone.


Too bad. It is Windows only. :-(

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Better language support

2011-05-19 Thread Pierre Thibault
Hello,

I didn't have a lot of feedback on this proposal. I thought it will
help translators but now I am wondering if it would be time well
spent.

Please post a comment if this idea attracts interest.


Re: [web2py] Re: Better language support

2011-05-19 Thread Pierre Thibault
2011/5/19 Massimo Di Pierro massimo.dipie...@gmail.com

 I am for this and for Jonathan idea. I am a little worried about the
 level of complexity this may bring, so I would like to see an
 implementation before committing to it. Too many file look-ups could
 cause a slow down.


This stress seems to hide a deeper problem: the lack of automated tests.
Personally, and others are too, I am not very satisfy with what web2py has
to offer for testing purposes. It an issue I want to explore further before
committing other developments.

I believe that a good layer of tests would remove a lot a stress when
developers are re-factoring the code. It will ensure a smooth evolution with
web2py, improve the design and the quality of its implementation.

Has for the problem of speed, we can cache things in memory. But I think the
first problem to deal with is the stress of re-factoring.



 About Jonathan proposal. It is ok to have a set of global translations
 but we need to brainstorm it more.
 Should global translations just stay global or propagate to apps?
 What if the translation changes in global but not in local app?


I have some second thought on Jonathan proposal. I have some concerns:

- By nature, a change in the global dictionary may affect many applications;
- A single word in English may have to be translated in many different words
in another language;
- Once we are commited to support a language, if you add a new word, we must
add the word in all the languages supported;
- How do we deal with a word that would not be appropriate for a
sub-dialect?

I think the risks are important. I might not be a very good idea after all.


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: Better language support

2011-05-19 Thread Pierre Thibault
2011/5/19 Christopher Steel chris.st...@gmail.com

 Hi Pierre,

 I think you have touched on an important issues and although I am also
 wondering if Jonathan proposal might provide for similar (although
 less blingy)...


Hi Chris,

No, I think mixing translations is not a good thing for the reasons I
mention above.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Very cool new code sharing service: http://chopapp.com/

2011-05-19 Thread Pierre Thibault
2011/5/19 pbreit pbreitenb...@gmail.com

 Very cool new code sharing service: http://chopapp.com/


Not cool for me. No Python. It is just like a pastebin.


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2