Bewildering service names of python application on maemo

本文介绍了如何使用Python为Maemo/N800设备创建并打包应用程序,包括必要的文件结构、配置示例及安装指令等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

A simple file structure of python applications on maemo/n800:

helloword
helloword.desktop
helloword.service
helloword.png
setup.py

Note:
1. Main source file helloworld is written in python, but it must be named without ".py".
2. helloworld.desktop and helloworld.service are used for adding and linking the executable source file helloworld to the application menu of N800.
3. helloworld.png is the icon displayed in application menu.
4. setup.py is used for installing the four files above into N800. It is the only file that you can name it arbitrarily.

Necessary sentences in helloworld:

python 代码
  1. import osso   
  2. osso_c = osso.Context("com.nokia.helloworld", "1.0.0", False)   

All sentences in helloworld.desktop:

Terminal 代码
  1. [Desktop Entry]   
  2. Version=1.0.0   
  3. Encoding=UTF-8   
  4. Type=Application   
  5. Name=Hello world   
  6. Exec=/usr/bin/helloworld   
  7. Icon=helloworld   
  8. X-Osso-Service=helloworld   
  9. X-Osso-Type=application/x-executable  

All sentences in helloworld.service:

Terminal 代码
  1. [D-BUS Service]   
  2. Name=com.nokia.helloworld   
  3. Exec=/usr/bin/helloworld  

All sentences in setup.py:

python 代码
  1. #!/usr/bin/env python2.5   
  2.   
  3. from distutils.core import setup   
  4. setup(   
  5.     name='helloworld',   
  6.     version='1.0.0',   
  7.     scripts=['helloworld'],   
  8.     data_files = [   
  9.             ('share/icons',               ['helloworld.png']),   
  10.             ('share/applications/hildon', ['helloworld.desktop']),   
  11.             ('share/dbus-1/services',     ['helloworld.service']),   
  12.     ]   
  13. )  

Be careful of those service names underlined and in red, which may result in fatel errors due to a little miss of coherence. Meanwhile, you can try any other combinations of those names, which however, is not recommanded. 

What's more, make sure that there is not even one single space at the end of each line in .service and .desktop files.


To install the helloworld application onto maemo:

cpp 代码
  1. [sbox-SDK_X86: ~helloworld-1.0.0] > python2.5 setup.py install  


To install it onto N800 device:

cpp 代码
  1. [sbox-SDK_X86: ~helloworld-1.0.0] dh_make   
  2. [sbox-SDK_X86: ~helloworld-1.0.0] dpkg-buildpackage -rfakeroot -b  

Remember to change debian/control. See article "Installing packages to N800 from sources".

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值