public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
* [PATCH] doc/bitbake-user-manual-metadata.rst: fix python task example
@ 2025-04-04 15:17 Antonin Godard
  0 siblings, 0 replies; only message in thread
From: Antonin Godard @ 2025-04-04 15:17 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Robert Berger, Antonin Godard

Fix the old Python 2 print statement, replace it by a bb.plain() call
instead. Also replace time by datetime for a slightly simpler example.

[YOCTO #14670]

Reported-by: Robert Berger <pokylinux@reliableembeddedsystems.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 415fbf6d6..db1749178 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -1405,8 +1405,8 @@ the task and other tasks. Here is an example that shows how to define a
 task and declare some dependencies::
 
    python do_printdate () {
-       import time
-       print time.strftime('%Y%m%d', time.gmtime())
+       import datetime
+       bb.plain('Date: %s' % (datetime.date.today()))
    }
    addtask printdate after do_fetch before do_build
 

---
base-commit: 136c06e251de68ed64355ec6b47a522ff3a372e3
change-id: 20250404-fix-python-task-example-de3508554c22

Best regards,
-- 
Antonin Godard <antonin.godard@bootlin.com>



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-04 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04 15:17 [PATCH] doc/bitbake-user-manual-metadata.rst: fix python task example Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox