Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!

Difference between revisions of "BitBake (dev)"

From Openembedded.org
Jump to: navigation, search
(Helloworld using lib bb)
(Helloworld using lib bb)
Line 23: Line 23:
  
 
<pre>
 
<pre>
import os
+
#!/usr/bin/env python
 +
# ex:ts=4:sw=4:sts=4:et
 +
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
 +
 
 +
import os , bb
 
from bb import data
 
from bb import data
  
version = bb.__version__
+
hello = ("Hello from helloworld using lib bb v%s." % ( bb.__version__ ))
HELLO_MSG = "Hello from helloworld using lib bb v%s." % ( version )
+
  
 
d = data.init()
 
d = data.init()
data.setVar('HELLO_MSG', os.getcwd(), d)
+
data.setVar('HELLO_MSG', hello, d)
  
myval = data.getVar('HELLO_MSG', d, 1)
+
mystring = data.getVar('HELLO_MSG', d, 1)
bb.note(myval)
+
bb.note(mystring)
 
</pre>
 
</pre>

Revision as of 12:44, 1 October 2008

Where are all bitbake hot information !!

Helloworld using lib bb

#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-

import bb

version = bb.__version__
bb.note("Hello from helloworld using lib bb v%s." % ( version ))

Same using data class :

#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-

import os , bb
from bb import data

hello = ("Hello from helloworld using lib bb v%s." % ( bb.__version__ ))

d = data.init()
data.setVar('HELLO_MSG', hello, d)

mystring = data.getVar('HELLO_MSG', d, 1)
bb.note(mystring)
Personal tools
Namespaces

Variants
Actions
Navigation
Categories
OE services
Toolbox