`
cloudhe
  • 浏览: 109004 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Bewildering service names of python application on maemo

阅读更多

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

  • 描述: When installed, our own application can be seen in the menu now.
  • 大小: 80.1 KB
分享到:
评论

相关推荐

    博士研究生英语精读-翻译与原文(中科院).doc

    Michelson, famous for his work on the measurement of the speed of light, stated: "The more the universe seems comprehensible, the more it also seems pointless." This suggests that the pursuit of ...

    Apache Sqoop Cookbook

    This handy cookbook provides dozens of ready-to-use recipes for using Apache Sqoop, the command-line interface application that optimizes data transfers between relational databases and Hadoop. ...

    CSS Mastery(Apress,3ed,2016)

    It sometimes feels like there are a million and one different techniques to master, spread across a bewildering array of websites. The range of possibilities seems endless and makes for a steep and ...

    matlab arrow.m

    The programmer says it draws an "astonishing" number of vectors with a "bewildering" variety of colors in "practically no time at all," and that it "looks real pretty when you twirl 'em around.

    Digital Asset Management

    This book provides the most useful information to those who find themselves in the bewildering position of formulating access control lists, auditing metadata, and consolidating information silos ...

    [Photoshop] Photoshop CS5 实战手册 (英文版)

    With new features such as Content-Aware Fill and Puppet Warp, Photoshop CS5 is more amazing -- and perhaps more bewildering -- than ever. That's where this full-color Missing Manual comes in. It ...

    自考英语本科 高级英语 考点精析.doc

    形容词bewildering和bewildered分别表示令人困惑的和感到困惑的,例如:“What she had said was bewildering to me”和“He was bewildered by her question”。 通过对这些词汇和难句的分析,我们可以看出文章...

    GRE填空模拟题及答案:The politician’s....docx

    即第一空的形容词应该与“account for her high standing”形成对比,而第二空的形容词则应与“continuing assaults on her reputation”相呼应。 对于空白(i),我们看到三个备选词:bewildering(令人迷惑的),...

    写作工具箱(新东方—孙远)2.doc

    "be preferable to"表示更可取,"be subject to"意味着受制于或易受影响,"befuddlement"涵盖迷惑和醉酒,"belie"表示掩饰或证明为假,"benign"形容善良或无害的,"betray"涉及背叛或揭露,"bewildering"表示令人...

Global site tag (gtag.js) - Google Analytics