mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
Clean up minor warnings from LGTM.com (#7500)
* Clean up minor warnings from LGTM.com LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic linting tasks on code and HTML. Clean up the warnings identified in the latest report: https://lgtm.com/projects/g/esp8266/Arduino/?mode=list No functionality should change, however this may fix some issues with the perl utilities not exiting properly on a Ctrl-C from the command line. * Back out HTML changes and rerun boards.txt.py
This commit is contained in:
committed by
GitHub
parent
a8e35a579c
commit
9afb084159
@ -476,6 +476,6 @@ DOIT ESP-Mx DevKit (ESP8285)
|
||||
----------------------------
|
||||
|
||||
DOIT ESP-Mx DevKit - This is a development board by DOIT, with a DOIT ESP-Mx module (`datasheet <https://github.com/SmartArduino/SZDOITWiKi/wiki/ESP8285---ESP-M2>`__) using a ESP8285 Chip. With the DOIT ESP-Mx module, GPIO pins 9 and 10 are not available. The DOIT ESP-Mx DevKit board has a red power LED and a blue LED connected to GPIO16 and is active low to turn on. It uses a CH340C, USB to Serial converter chip.
|
||||
|
||||
ESP8285 (`datasheet <http://www.espressif.com/sites/default/files/0a-esp8285_datasheet_en_v1.0_20160422.pdf>`__) is a multi-chip package which contains ESP8266 and 1MB flash.
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script pulls the list of Mozilla trusted certificate authorities
|
||||
# from the web at the "mozurl" below, parses the file to grab the PEM
|
||||
@ -14,11 +14,11 @@ import sys
|
||||
from subprocess import Popen, PIPE, call
|
||||
try:
|
||||
from urllib.request import urlopen
|
||||
except:
|
||||
except Exception:
|
||||
from urllib2 import urlopen
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except:
|
||||
except Exception:
|
||||
from io import StringIO
|
||||
|
||||
# Mozilla's URL for the CSV file with included PEM certs
|
||||
@ -42,7 +42,7 @@ del pems[0] # Remove headers
|
||||
# Try and make ./data, skip if present
|
||||
try:
|
||||
os.mkdir("data")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
derFiles = []
|
||||
|
5
package/upload_release.py
Normal file → Executable file
5
package/upload_release.py
Normal file → Executable file
@ -2,11 +2,6 @@
|
||||
|
||||
from github import Github
|
||||
import argparse
|
||||
import collections
|
||||
import glob
|
||||
import json
|
||||
import mimetypes
|
||||
import os
|
||||
|
||||
parser = argparse.ArgumentParser(description='Upload a set of files to a new draft release')
|
||||
parser.add_argument('--user', help="Github username", type=str, required=True)
|
||||
|
@ -907,23 +907,23 @@ boards = collections.OrderedDict([
|
||||
'1M',
|
||||
],
|
||||
'desc': [
|
||||
'ESP8266 based devices from ITEAD: Sonoff SV, Sonoff TH, Sonoff Basic, '
|
||||
'ESP8266 based devices from ITEAD: Sonoff SV, Sonoff TH, Sonoff Basic, ' +
|
||||
'and Sonoff S20',
|
||||
'',
|
||||
'These are not development boards. The development process is '
|
||||
'inconvenient with these devices. When flashing firmware you will '
|
||||
'These are not development boards. The development process is ' +
|
||||
'inconvenient with these devices. When flashing firmware you will ' +
|
||||
'need a Serial Adapter to connect it to your computer.',
|
||||
'',
|
||||
' | Most of these devices, during normal operation, are connected to '
|
||||
'*wall power (AKA Mains Electricity)*. **NEVER** try to flash these '
|
||||
'devices when connected to *wall power*. **ALWAYS** have them '
|
||||
'disconnected from *wall power* when connecting them to your '
|
||||
' | Most of these devices, during normal operation, are connected to ' +
|
||||
'*wall power (AKA Mains Electricity)*. **NEVER** try to flash these ' +
|
||||
'devices when connected to *wall power*. **ALWAYS** have them ' +
|
||||
'disconnected from *wall power* when connecting them to your ' +
|
||||
'computer. Your life may depend on it!',
|
||||
'',
|
||||
'When flashing you will need to hold down the push button connected '
|
||||
'to the GPIO0 pin, while powering up with a safe 3.3 Volt source. Some USB '
|
||||
'Serial Adapters may supply enough power to handle flashing; '
|
||||
'however, it many may not supply enough power to handle the '
|
||||
'When flashing you will need to hold down the push button connected ' +
|
||||
'to the GPIO0 pin, while powering up with a safe 3.3 Volt source. Some USB ' +
|
||||
'Serial Adapters may supply enough power to handle flashing; ' +
|
||||
'however, it many may not supply enough power to handle the ' +
|
||||
'activities when the device reboots.',
|
||||
'',
|
||||
'More product details at the bottom of https://www.itead.cc/wiki/Product/'
|
||||
@ -943,15 +943,14 @@ boards = collections.OrderedDict([
|
||||
'1M',
|
||||
],
|
||||
'desc': [
|
||||
'DOIT ESP-Mx DevKit - This is a development board by DOIT, with a DOIT ESP-Mx module '
|
||||
'(`datasheet <https://github.com/SmartArduino/SZDOITWiKi/wiki/ESP8285---ESP-M2>`__) '
|
||||
'using a ESP8285 Chip. With the DOIT ESP-Mx module, GPIO pins 9 and 10 are not available. '
|
||||
'The DOIT ESP-Mx DevKit board has a red power LED and a blue LED connected to GPIO16 '
|
||||
'and is active low to turn on. It uses a CH340C, USB to Serial converter chip. '
|
||||
'',
|
||||
'ESP8285 (`datasheet <http://www.espressif.com/sites/default/files/0a-esp8285_datasheet_en_v1.0_20160422.pdf>`__) '
|
||||
'is a multi-chip package which contains ESP8266 and 1MB flash. ',
|
||||
'DOIT ESP-Mx DevKit - This is a development board by DOIT, with a DOIT ESP-Mx module ' +
|
||||
'(`datasheet <https://github.com/SmartArduino/SZDOITWiKi/wiki/ESP8285---ESP-M2>`__) ' +
|
||||
'using a ESP8285 Chip. With the DOIT ESP-Mx module, GPIO pins 9 and 10 are not available. ' +
|
||||
'The DOIT ESP-Mx DevKit board has a red power LED and a blue LED connected to GPIO16 ' +
|
||||
'and is active low to turn on. It uses a CH340C, USB to Serial converter chip. ',
|
||||
'',
|
||||
'ESP8285 (`datasheet <http://www.espressif.com/sites/default/files/0a-esp8285_datasheet_en_v1.0_20160422.pdf>`__) ' +
|
||||
'is a multi-chip package which contains ESP8266 and 1MB flash. '
|
||||
],
|
||||
|
||||
})
|
||||
|
@ -57,7 +57,7 @@ def get_segment_size_addr(elf, segment, path):
|
||||
def read_segment(elf, segment, path):
|
||||
fd, tmpfile = tempfile.mkstemp()
|
||||
os.close(fd)
|
||||
p = subprocess.check_call([path + "/xtensa-lx106-elf-objcopy", '-O', 'binary', '--only-section=' + segment, elf, tmpfile], stdout=subprocess.PIPE)
|
||||
subprocess.check_call([path + "/xtensa-lx106-elf-objcopy", '-O', 'binary', '--only-section=' + segment, elf, tmpfile], stdout=subprocess.PIPE)
|
||||
with open(tmpfile, "rb") as f:
|
||||
raw = f.read()
|
||||
os.remove(tmpfile)
|
||||
@ -85,7 +85,7 @@ def write_bin(out, args, elf, segments, to_addr):
|
||||
try:
|
||||
for data in raw:
|
||||
checksum = checksum ^ ord(data)
|
||||
except:
|
||||
except Exception:
|
||||
for data in raw:
|
||||
checksum = checksum ^ data
|
||||
total_size += 1
|
||||
|
@ -77,7 +77,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
try:
|
||||
sock.bind(server_address)
|
||||
sock.listen(1)
|
||||
except:
|
||||
except Exception:
|
||||
logging.error("Listen Failed")
|
||||
return 1
|
||||
|
||||
@ -100,11 +100,11 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
logging.info('Sending invitation to: %s', remoteAddr)
|
||||
sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
remote_address = (remoteAddr, int(remotePort))
|
||||
sent = sock2.sendto(message.encode(), remote_address)
|
||||
sock2.sendto(message.encode(), remote_address)
|
||||
sock2.settimeout(10)
|
||||
try:
|
||||
data = sock2.recv(128).decode()
|
||||
except:
|
||||
except Exception:
|
||||
logging.error('No Answer')
|
||||
sock2.close()
|
||||
return 1
|
||||
@ -123,7 +123,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
sock2.settimeout(10)
|
||||
try:
|
||||
data = sock2.recv(32).decode()
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('FAIL\n')
|
||||
logging.error('No Answer to our Authentication')
|
||||
sock2.close()
|
||||
@ -147,7 +147,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
connection, client_address = sock.accept()
|
||||
sock.settimeout(None)
|
||||
connection.settimeout(None)
|
||||
except:
|
||||
except Exception:
|
||||
logging.error('No response from device')
|
||||
sock.close()
|
||||
return 1
|
||||
@ -173,7 +173,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
if connection.recv(32).decode().find('O') >= 0:
|
||||
# connection will receive only digits or 'OK'
|
||||
received_ok = True
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('\n')
|
||||
logging.error('Error Uploading')
|
||||
connection.close()
|
||||
@ -207,7 +207,7 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
|
||||
if received_ok:
|
||||
return 0
|
||||
return 1
|
||||
except:
|
||||
except Exception:
|
||||
logging.error('No Result!')
|
||||
connection.close()
|
||||
f.close()
|
||||
|
@ -32,7 +32,7 @@ def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"):
|
||||
try:
|
||||
git_ver = git("rev-parse", "--short=8", "HEAD")
|
||||
git_desc = git("describe", "--tags")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver)
|
||||
@ -43,7 +43,7 @@ def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"):
|
||||
old_text = inp.read()
|
||||
if old_text == text:
|
||||
return
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
with open(path, "w") as out:
|
||||
@ -73,7 +73,7 @@ if __name__ == "__main__":
|
||||
include_dir = os.path.join(args.build_path, args.include_dir)
|
||||
try:
|
||||
os.makedirs(include_dir)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
generate(
|
||||
|
@ -78,7 +78,6 @@ def main():
|
||||
f.write(val)
|
||||
return 0
|
||||
elif args.mode == "sign":
|
||||
val = ""
|
||||
if not os.path.isfile(args.privatekey):
|
||||
return
|
||||
try:
|
||||
|
@ -16,7 +16,7 @@ try:
|
||||
sys.path.insert(0, toolspath + "/pyserial") # Add pyserial dir to search path
|
||||
sys.path.insert(0, toolspath + "/esptool") # Add esptool dir to search path
|
||||
import esptool # If this fails, we can't continue and will bomb below
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write("pyserial or esptool directories not found next to this upload.py tool.\n")
|
||||
sys.exit(1)
|
||||
|
||||
|
Reference in New Issue
Block a user