Skip to content

Commit

Permalink
Tasmota changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Feb 8, 2024
1 parent 1d93190 commit 481495b
Show file tree
Hide file tree
Showing 18 changed files with 1,629 additions and 181 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/dangerjs.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/dev_release_esptool_pypi.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/issue_comment.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/new_issues.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/new_prs.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/release_esptool_pypi.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/test_esptool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout ref commit
Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
pytest -m host_test
pytest test/test_espsecure_hsm.py
- name: Build stub (Python 3.7 only)
if: matrix.python-version == 3.7
- name: Build stub (Python 3.9 only)
if: matrix.python-version == 3.9
run: |
export TOOLCHAIN_DIR=$HOME/toolchain
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ local.mk
report.xml

docs/_build/
.DS_Store
3 changes: 1 addition & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ ignore = ["E203"]
# Assume Python 3.7
target-version = "py37"

[per-file-ignores]

[lint.per-file-ignores]

# tests often manipulate sys.path before importing the main tools, so ignore import order violations
"test/*.py" = ["E402"]
Expand Down
2 changes: 1 addition & 1 deletion esptool/bin_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tempfile
from typing import BinaryIO, Optional

from intelhex import HexRecordError, IntelHex
from esptool.intelhex import HexRecordError, IntelHex

from .loader import ESPLoader
from .targets import (
Expand Down
2 changes: 1 addition & 1 deletion esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import time
import zlib

from intelhex import IntelHex
from esptool.intelhex import IntelHex

from .bin_image import ELFFile, ImageSegment, LoadFirmwareImage
from .bin_image import (
Expand Down
161 changes: 161 additions & 0 deletions esptool/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Copyright (c) 2011, Bernhard Leiner
# Copyright (c) 2013-2018 Alexander Belchenko
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain
# the above copyright notice, this list of conditions
# and the following disclaimer.
# * Redistributions in binary form must reproduce
# the above copyright notice, this list of conditions
# and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the author nor the names
# of its contributors may be used to endorse
# or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

'''Compatibility functions for python 2 and 3.
@author Bernhard Leiner (bleiner AT gmail com)
@author Alexander Belchenko (alexander belchenko AT gmail com)
'''

# ruff: noqa
__docformat__ = "javadoc"


import sys, array


if sys.version_info[0] >= 3:
# Python 3
Python = 3

def asbytes(s):
if isinstance(s, bytes):
return s
return s.encode('latin1')
def asstr(s):
if isinstance(s, str):
return s
return s.decode('latin1')

# for python >= 3.2 use 'tobytes', otherwise 'tostring'
array_tobytes = array.array.tobytes if sys.version_info[1] >= 2 else array.array.tostring

IntTypes = (int,)
StrType = str
UnicodeType = str

range_g = range # range generator
def range_l(*args): # range list
return list(range(*args))

def dict_keys(dikt): # dict keys list
return list(dikt.keys())
def dict_keys_g(dikt): # dict keys generator
return dikt.keys()
def dict_items_g(dikt): # dict items generator
return dikt.items()

from io import StringIO, BytesIO

def get_binary_stdout():
return sys.stdout.buffer

def get_binary_stdin():
return sys.stdin.buffer

else:
# Python 2
Python = 2

asbytes = str
asstr = str

array_tobytes = array.array.tostring

IntTypes = (int, long)
StrType = basestring
UnicodeType = unicode

#range_g = xrange # range generator
def range_g(*args):
# we want to use xrange here but on python 2 it does not work with long ints
try:
return xrange(*args)
except OverflowError:
start = 0
stop = 0
step = 1
n = len(args)
if n == 1:
stop = args[0]
elif n == 2:
start, stop = args
elif n == 3:
start, stop, step = args
else:
raise TypeError('wrong number of arguments in range_g call!')
if step == 0:
raise ValueError('step cannot be zero')
if step > 0:
def up(start, stop, step):
while start < stop:
yield start
start += step
return up(start, stop, step)
else:
def down(start, stop, step):
while start > stop:
yield start
start += step
return down(start, stop, step)

range_l = range # range list

def dict_keys(dikt): # dict keys list
return dikt.keys()
def dict_keys_g(dikt): # dict keys generator
return dikt.keys()
def dict_items_g(dikt): # dict items generator
return dikt.items()

from cStringIO import StringIO
BytesIO = StringIO

import os
def _force_stream_binary(stream):
"""Force binary mode for stream on Windows."""
if os.name == 'nt':
f_fileno = getattr(stream, 'fileno', None)
if f_fileno:
fileno = f_fileno()
if fileno >= 0:
import msvcrt
msvcrt.setmode(fileno, os.O_BINARY)
return stream

def get_binary_stdout():
return _force_stream_binary(sys.stdout)

def get_binary_stdin():
return _force_stream_binary(sys.stdin)
Loading

0 comments on commit 481495b

Please sign in to comment.