Compare commits

..

No commits in common. 'dadaed4288d446e509f630fd0be0c21b3e31222a' and '9bfa03f6bdf9c1368036358348201169c31891ca' have entirely different histories.

  1. 8
      bootstrap.ps1
  2. 0
      setup.bat
  3. 10
      setup.py
  4. 6
      speedtest.py

8
bootstrap.ps1

@ -1,4 +1,4 @@
$url = "https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe" $url = "https://www.python.org/ftp/python/3.11.5/python-3.11.5-amd64.exe"
$output = "python311_installer.exe" $output = "python311_installer.exe"
$install_dir = "C:\Python311" $install_dir = "C:\Python311"
@ -27,11 +27,5 @@ Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install packaging"
Write-Output "Installing setuptools" Write-Output "Installing setuptools"
Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install setuptools" -Wait Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install setuptools" -Wait
Write-Output "Installing requests"
Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install requests" -Wait
Write-Output "Installing chardet"
Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install chardet" -Wait
Write-Output "Installing py2exe" Write-Output "Installing py2exe"
Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install py2exe" -Wait Start-Process "$install_dir\python.exe" -ArgumentList "-m pip install py2exe" -Wait

10
setup.py

@ -15,8 +15,6 @@ sys.argv.append("py2exe")
PYTHON_PATH = r"C:\Python311" PYTHON_PATH = r"C:\Python311"
WINDOWS_PATH = r"C:\Windows"
SETUP_DICT = { SETUP_DICT = {
"console": [{ "console": [{
@ -32,18 +30,14 @@ SETUP_DICT = {
("", glob(os.path.join(WINDOWS_PATH, r"SYSTEM32\msvcp100.dll"))), ("", glob(os.path.join(WINDOWS_PATH, r"SYSTEM32\msvcp100.dll"))),
("", glob(os.path.join(WINDOWS_PATH, r"SYSTEM32\msvcr100.dll"))), ("", glob(os.path.join(WINDOWS_PATH, r"SYSTEM32\msvcr100.dll"))),
("", glob(os.path.join(os.getcwd(), r"speedtest.ini"))),
("", glob(os.path.join(os.getcwd(), r"urls.txt"))),
("library", glob(os.path.join(os.getcwd(), r"library/commons.py"))),
("library", glob(os.path.join(os.getcwd(), r"library/inputimeout.py"))),
], ],
"options": { "options": {
"py2exe": { "py2exe": {
"bundle_files": 3, "bundle_files": 3,
"includes": ["charset_normalizer"], "excludes": ["tcl", "tk", "tkinter", "idna", "lib2to3", "xmlrpc", "multiprocessing", "urllib3", "chardet",
"excludes": ["tcl", "tk", "tkinter", "lib2to3", "xmlrpc", "multiprocessing", "asyncio", "pydoc_data", "unittest", "pydoc", "lzma", "bz2"], "asyncio", "pydoc_data", "requests", "unittest", "pydoc", "lzma", "bz2"],
"dll_excludes": ["tcl86.dll", "tk86.dll"], "dll_excludes": ["tcl86.dll", "tk86.dll"],
"compressed": True, "compressed": True,
"optimize": 2 "optimize": 2

6
speedtest.py

@ -75,8 +75,9 @@ def get_client(config: ConfigParser):
return client return client
def send_data(config: ConfigParser, email_content: str, messages: list): def send_data(config: ConfigParser, body: str, messages: list):
client = get_client(config) client = get_client(config)
email_content = ""
for message in messages: for message in messages:
if not message.contents: if not message.contents:
continue continue
@ -92,6 +93,7 @@ def send_data(config: ConfigParser, email_content: str, messages: list):
texts = body.text texts = body.text
for text in texts: for text in texts:
content_, args = text.content, text.args content_, args = text.content, text.args
print("args", args)
email_content += content_.format(*text.args) email_content += content_.format(*text.args)
email_content += "\n" email_content += "\n"
@ -228,7 +230,7 @@ def main():
raise RuntimeError("No tests performed!") raise RuntimeError("No tests performed!")
client = get_client(mail_section) client = get_client(mail_section)
body = "# User name: %s; ISP: %s\n" % (name, isp) body = "User name: %s; ISP: %s" % (name, isp)
send_data(mail_section, body, messages) send_data(mail_section, body, messages)
logger.info("Done! You're amazing!") logger.info("Done! You're amazing!")

Loading…
Cancel
Save