copy_files.py: Show current timestamp in the build output

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Kim_Panda
Normal user
Posts: 41
Joined: 25 Jan 2021, 17:03

copy_files.py: Show current timestamp in the build output

#1 Post by Kim_Panda » 28 Mar 2021, 18:05

During my recent development I found it helpful to see the current timestamp at the end of the build process.
Timestamp.png
Timestamp.png (40.86 KiB) Viewed 3893 times
This makes it more save to allocate the related .bin file, specially if you do several consecutive builds.
Currently only the duration of the build is shown.

I achived that by simply adding the following two lines right at the end of "copy_files.py"

import datetime
print("\u001b[33m Timestamp:\u001b[0m", datetime.datetime.now())

Code: Select all

    for suff in [".elf", ".bin", ".bin.gz", "-factory.bin", ".env.txt"]:
        copy_to_build_output(split_path[0], variant, suff)

    import datetime
    print("\u001b[33m Timestamp:\u001b[0m", datetime.datetime.now())

env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_elf_copy])
This could be helpful for others, too.
Would you mind taking it over in the official ESPEasy build?

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: copy_files.py: Show current timestamp in the build output

#2 Post by Ath » 28 Mar 2021, 18:11

That is a fine idea.
You can add that in a separate PR, but if you find that too much of a hassle, I'll do that for us :D
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: copy_files.py: Show current timestamp in the build output

#3 Post by Ath » 28 Mar 2021, 18:26

Created PR #3562 for this improvement.
/Ton (PayPal.me)

Kim_Panda
Normal user
Posts: 41
Joined: 25 Jan 2021, 17:03

Re: copy_files.py: Show current timestamp in the build output

#4 Post by Kim_Panda » 01 Apr 2021, 17:23

Thanks a lot.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests