web2py on windows mobile?

43 views
Skip to first unread message

Iceberg

unread,
Dec 8, 2009, 10:22:46 AM12/8/09
to web2py-users
Just curious after I bought a Windows Mobile device recently. Google
search "web2py windows mobile" provides many articles saying web2py
can run on Windows Mobile system. However, same words can not be found
on official http://www.web2py.com

I even try it by myself. But my cellphone, after installing a
PythonCE, can run a naive script with only "print 'hello world'"
inside, and can not run web2py.py, which results in an error trace
screen but no detail inside.

I am not going to write some serious web2py app on my mobile (yet).
Just curious to know whether web2py can run on windows mobile device.
Does anyone try that before?

Thanks in advance.

Sincerely,
Iceberg

mdipierro

unread,
Dec 8, 2009, 10:31:34 AM12/8/09
to web2py-users
it used to work on windowsCE. I have not tested it recently because I
do not have windowsCE any more (I was so fed up with its bugs that I
gave it away for free).
Anyway, it should work unless some module is missing.
Can you tell us more about the python version you are using and the
stack trace?

Massimo

On Dec 8, 9:22 am, Iceberg <iceb...@21cn.com> wrote:
> Just curious after I bought a Windows Mobile device recently. Google
> search "web2py windows mobile" provides many articles saying web2py
> can run on Windows Mobile system. However, same words can not be found
> on officialhttp://www.web2py.com

Iceberg

unread,
Dec 8, 2009, 1:10:37 PM12/8/09
to web2py-users
I am using pythonce from here: http://sourceforge.net/projects/pythonce/files/

Mmm, firstly I deploy web2py in my SD card which has a default name in
non-ascii charactors, this seems to be the reason that web2py can not
even generate proper error trace. (The stack trace just flash and then
stop at a screen with NO meaningful file names inside.)

After moving web2py into the very root directory of my cellphone's
builtin memory, this time I see the error stack trace:
File "\WEB2PY\WEB2PY.PY", line 16, in <module>
import gluon.import_all
<type 'exceptions.ImportError'>: No module named gluon.import_all

I am running web2py 1.72.3 source code distribution.

Later I tried using a copy of trunk-edition web2py, almost latest
trunk, and still encounter same problem.

mdipierro

unread,
Dec 8, 2009, 1:28:03 PM12/8/09
to web2py-users
I think the problem is that it is running from the python.exe folder
and not the web2py folder therefore it is not finding the libraries.
As a test. try edit web2py.py and append the full web2py path to
sys.path

SergeyPo

unread,
Dec 9, 2009, 12:38:48 AM12/9/09
to web2py-users
Sorry guys I pressed 'Report as spam' unintentionally! Please restore
if possible.

Iceberg

unread,
Dec 9, 2009, 9:26:24 AM12/9/09
to web2py-users
Feedback: made little progress, but no victory so far.

1. The import gluon.import_all error I mentioned in my previous post,
is not relevant to sys.path, but about case-sensitivity. When I attach
my cellphone to my PC in a "usb-disk" mode and manually copy web2py/*
into it, all directorys and files with a name shorter than 8.3 format
result in UPPER CASE. No wonder fail to import gluon codes when it is
actually GLUON/__INIT__.PY. The workaround is relative simple albeit
not always convenient: do not copy and paste web2py/* directly, but
setup MS ActiveSync to "sync" them into the cellphone, this way the
file names remain in lower case somehow.


2. Then the other issue is about subprocess.py. It contains:
import sys
mswindows = (sys.platform == "win32")
...
if mswindows:
import msvcrt

But in PythonCE running on WinCE, there is no msvcrt lib. Perhaps the
official subprocess.py should use:
mswindows = (os.name == "nt")
to exclude Windows Mobile, which os.name == 'ce'.

Thinking I'd better not touch the official subprocess.py, I tried to
adjust contrib/cron.py:
try: from subprocess import Popen,PIPE
except: logging.exception('Ignore, do not need it anyway')

and I also change last line of web2py.py into:
sys.argv.extend(['-a1','-N'])
gluon.widget.start(cron= os.name!='ce')


3. However, web2py still breaks somewhere during starting up, the
break point seems to be in bind() of gluon/wsgiserver.py:
prevent_socket_inheritance(self.socket)

Don't know what to do, so I just stop here. Maybe all these info are
useful to someone who really need a web2py on windows mobile. :-)

mdipierro

unread,
Dec 9, 2009, 12:08:17 PM12/9/09
to web2py-users
3) can you try comment that line?

Iceberg

unread,
Dec 10, 2009, 12:46:18 PM12/10/09
to web2py-users
Thanks. Define a dummy prevent_socket_inheritance() can bypass that
problem. But, another error trace:
...
File "\My Documents\web2pygluon\wsgis...
self.requests.start()
File "\My Documents\web2pygluon\wsgis...
worker.start()
File "C:\development\opensource\PythonCE...
error: can't start new thread

I even tried comment out "self.requests.start()" for test. Don't think
this will work but just trying. This time, web2py outputs all normal
logs in console, however it does not serve any web request (because no
worker threads at all)?
Reply all
Reply to author
Forward
0 new messages