mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2025-08-19 21:07:21 +02:00
Compare commits
No commits in common. "f7b8a40b2834ca0beb45276cbdc77848ef189a89" and "46058c82228fd1bd82af7791e4b79f4deb77757a" have entirely different histories.
f7b8a40b28
...
46058c8222
@ -3,7 +3,6 @@ ci:
|
|||||||
# the frequency of unnecessary PRs.
|
# the frequency of unnecessary PRs.
|
||||||
# https://github.com/pre-commit-ci/issues/issues/83
|
# https://github.com/pre-commit-ci/issues/issues/83
|
||||||
autoupdate_schedule: quarterly
|
autoupdate_schedule: quarterly
|
||||||
skip: [pylint]
|
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
@ -11,7 +10,6 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-yaml
|
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
- id: check-shebang-scripts-are-executable
|
- id: check-shebang-scripts-are-executable
|
||||||
- id: destroyed-symlinks
|
- id: destroyed-symlinks
|
||||||
@ -26,30 +24,13 @@ repos:
|
|||||||
- id: doctoc
|
- id: doctoc
|
||||||
# https://github.com/Mikaela/gist/blob/master/doctoc.txt
|
# https://github.com/Mikaela/gist/blob/master/doctoc.txt
|
||||||
args: [--update-only]
|
args: [--update-only]
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
||||||
rev: "v1.3.0"
|
|
||||||
hooks:
|
|
||||||
- id: mypy
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
rev: "v3.0.0-alpha.9-for-vscode"
|
rev: "v3.0.0-alpha.9-for-vscode"
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
exclude_types: [python, pyi, jupyter]
|
|
||||||
- repo: https://github.com/psf/black
|
|
||||||
rev: 23.3.0
|
|
||||||
hooks:
|
|
||||||
- id: black
|
|
||||||
#- id: black-jupyter
|
|
||||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
||||||
rev: "2.7.1"
|
rev: "2.7.1"
|
||||||
hooks:
|
hooks:
|
||||||
- id: editorconfig-checker
|
- id: editorconfig-checker
|
||||||
alias: ec
|
alias: ec
|
||||||
args: [-disable-max-line-length]
|
args: [-disable-max-line-length]
|
||||||
- repo: local
|
|
||||||
hooks:
|
|
||||||
- id: pylint
|
|
||||||
name: pylint
|
|
||||||
entry: pylint
|
|
||||||
language: system
|
|
||||||
types_or: [python, pyi]
|
|
||||||
|
@ -4,6 +4,3 @@ root = false
|
|||||||
# https://peps.python.org/pep-0008/#indentation
|
# https://peps.python.org/pep-0008/#indentation
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
#max_line_length = 79
|
|
||||||
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
|
|
||||||
max_line_length = 88
|
|
||||||
|
@ -9,7 +9,7 @@ except IndexError as noarg:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
for i in range(int(wantedCount)):
|
for i in range(int(wantedCount)):
|
||||||
print(secrets.randbelow(10), end="")
|
print(secrets.randbelow(10),end="")
|
||||||
except NameError as noWantedCount:
|
except NameError as noWantedCount:
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
|
@ -1,23 +1,17 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
'''
|
||||||
This script asks for a SSID name, counts it and tells whether it's of valid
|
This script asks for a SSID name, counts it and tells whether it's of valid
|
||||||
length
|
length
|
||||||
"""
|
'''
|
||||||
|
|
||||||
# Request input or assume "test" on empty.
|
# Request input or assume "test" on empty.
|
||||||
givenssid = str(
|
givenssid = str(input("Please enter the SSID you are thinking of (preferably 26 chars to fit _nomap): ") or "test")
|
||||||
input(
|
|
||||||
"Please enter the SSID you are thinking of (preferably 26 chars to fit _nomap): "
|
|
||||||
)
|
|
||||||
or "test"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Ensure it's UTF-8 and store the size. E.g. åäö are longer than oao
|
# Ensure it's UTF-8 and store the size. E.g. åäö are longer than oao
|
||||||
# TODO: make this a function too
|
# TODO: make this a function too
|
||||||
givenssidlen = len(givenssid.encode("utf8"))
|
givenssidlen = len(givenssid.encode("utf8"))
|
||||||
|
|
||||||
|
|
||||||
# Checking the SSID length is done twice, so thus a function
|
# Checking the SSID length is done twice, so thus a function
|
||||||
def checkssidlen(givenssidlen):
|
def checkssidlen(givenssidlen):
|
||||||
# 32 bytes should be the maximum SSID length
|
# 32 bytes should be the maximum SSID length
|
||||||
@ -26,7 +20,6 @@ def checkssidlen(givenssidlen):
|
|||||||
else:
|
else:
|
||||||
print(givenssid, "is", givenssidlen, "to long, please select a different SSID")
|
print(givenssid, "is", givenssidlen, "to long, please select a different SSID")
|
||||||
|
|
||||||
|
|
||||||
# Checking the SSID without _nomap
|
# Checking the SSID without _nomap
|
||||||
checkssidlen(givenssidlen)
|
checkssidlen(givenssidlen)
|
||||||
# TODO: make this a function too
|
# TODO: make this a function too
|
||||||
|
Loading…
x
Reference in New Issue
Block a user