1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 15:22:24 +01:00

Use copy for custom includes (#568)

This commit is contained in:
Otto Winter
2019-05-29 19:30:35 +02:00
committed by GitHub
parent 02d34a0238
commit f35f6d2348
5 changed files with 51 additions and 15 deletions

View File

@@ -157,6 +157,12 @@ def copy_file_if_changed(src, dst):
write_file(dst, src_text)
def walk_files(path):
for root, _, files in os.walk(path):
for name in files:
yield os.path.join(root, name)
def read_file(path):
try:
with codecs.open(path, 'r', encoding='utf-8') as f_handle: