Thanks to the86hitman! I finally figured out how to create lightblue.sis based on his info.
In the following (long explanation) I show You how to create your own module to be imported
in your applications, and how to create a working lightblue.sis file to be installed on a
phone wiht PyS60 1.9.x
Hope it works for you 
CREATE A MODULE TO USE WITH YOUR .SIS FILES:
--------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mymodule.py:
------------
import appuifw, e32, sys, os, sysinfo # Test various imports
def test():
print "MyModule test OK"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
testMyModule.py:
----------------
import mymodule
mymodule.test()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Create the following folder structure (This is for PyS60 1.9.x)
If you don't know how the folder structure is on your phone, you can
use the following commands in the ScriptShell's interactive console:
___________________________________________________________
import os
os.listdir("c:") # to see if you have the resource directory
os.listdir("c:\\resource")
# If you have the c:\\resource\\python25 folder structure on
# the phone, then use the following folder structure on you PC.
___________________________________________________________
Code:
module-repo
|
|
|__ mymodule
|
|
|__ sys
| |
| |__ bin (.pyd here. If any)
|
|
|__ resource
|
|__ python25 (place .py files here)
Put mymodule.py in
C:\Program Files\PythonForS60\module-repo\mymodule\resource\python25 folder
and nothing in
C:\Program Files\PythonForS60\module-repo\mymodule\sys\bin (we have no .pyd file)
Go to C:\Program Files\PythonForS60\module-repo with a command prompt and write
ensymble.py simplesis -u 0xa1234567 -r 0.0.7 -c "mymodule" mymod
This will create mymod_v0_0_7.sis
Install this file on your phone.
Now use the "PyS60 application packager" to create testMyModule_v1_0_0.sis or use
what ever way you normally create .sis files. Install testMyModule on the phone.
Go to your program folder on the phone and run testMyModule. This will print:
MyModule test OK
That's it.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CREATE lightblue.sis TO IMPORT IN YOUR APPLICATIONS:
----------------------------------------------------
Use os.list as described above to determine the folder structure on the mobile phone.
On my phone the .pyd file are located in c:\\sys\\bin and .py files located in
c:\\resource\\python25
You can maby best determine where to install the module files by using a program like SISXplorer.
I used SISXplorer to open wlantools.sis for PyS60 1.9.x. I know that this version of wlantools runs
fine with my PyS60 1.9.7 installation. In SISXplorer you can see where the .pyd file and .py files
are installed. It says something like this:
EOpInstall( "!:\sys\bin\kf_wlantools.pyd" );
EOpInstall( "c:\resource\python25\wlantools.py" );
We can now create the needed folder structure in C:\Program Files\PythonForS60\module-repo (in my case)
Code:
module-repo
|
|
|__ lightblue
|
|
|__ sys
| |
| |__ bin ( kf__lightblueutil.pyd )
|
|
|__ resource
|
|__ python25 ( __init__.py )
( lightblue.py )
( _lightbluecommon.py )
( obex.py )
( _obex.py )
( _obexcommon.py )
IMPORTANT NOTE: When You download lightblue-0.4_s60-3rdEd-FP2_PyS60-1.9.x.zip the archive contain
_lightblue.py. RENAME this file to lightblue.py
If You don't rename the file, You will get a "no module named lightblue" error when
you try to import lightblue in your application.
Go to C:\Program Files\PythonForS60\module-repo with a command-line tool and write:
ensymble.py simplesis -u 0xa1234567 -r 0.0.7 -c "lightblue" lightblue
This will create lightblue_v0_0_7.sis
Install this file on your phone.
Using SISXplorer to open lightblue_v0_0_7.sis I can now see the following:
EOpInstall( "!:\sys\bin\kf__lightblueutil.pyd" );
EOpInstall( "!:\resource\python25\_lightbluecommon.py" );
EOpInstall( "!:\resource\python25\_obexcommon.py" );
EOpInstall( "!:\resource\python25\obex.py" );
EOpInstall( "!:\resource\python25\_obex.py" );
EOpInstall( "!:\resource\python25\lightblue.py" );
EOpInstall( "!:\resource\python25\__init__.py" );
That's it. I can now import lightblue to an application as follows:
Code:
import lightblue
devices = lightblue.finddevices(getnames=True)
for device, name, dev_id in devices:
print "----------------"
print "Device: " + device
print "Name: " + name
print "Dev_id: " + str(dev_id)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
To finnsmama - I got the same error as you did at some point (can't find the module _lightblueutil).
It seems to be the kf__lightblueutil.pyd - If you look at other dev-modules they have a similar
construct. With the camera module the .pyd file is called kf__camera.pyd and the camera.py uses import _camera. So I think the error is caused because the module .py file can't find the .pyd file.