Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions commstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,22 @@ def oscheck(self):
pios = "aarch64"
winos = "Windows"
linuxos = "Linux"
macos = "macOS"
if pios in (platform.platform()):
print("Commstat this is Pi 64bit OS")
OS = "pi"
bull1 = 0
bull2 = 4
if winos in (platform.platform()):
elif winos in (platform.platform()):
print("Commstat this is Windows OS")
OS_Directed = "\DIRECTED.TXT"
# sudo apt install ./python-pyqt5.qtwebengine_5.15.2-2_arm64.deb
if linuxos in (platform.platform()):
elif linuxos in (platform.platform()):
print("Commstat this is Linux OS")
OS_Directed = "/DIRECTED.TXT"
elif macos in (platform.platform()):
print("Commstat this is MacOS")
OS_Directed = "/DIRECTED.TXT"

else:
# print("This is not 64bit PiOS")
Expand Down Expand Up @@ -813,7 +817,7 @@ def directedpi(self):

def directed(self):
global directedcounter
with open(path) as f, open('output.txt', 'w') as fout:
with open(path, 'r', encoding='utf-8', errors='ignore') as f, open('output.txt', 'w') as fout:
fout.writelines(reversed(f.readlines()))
text = open('output.txt').read()
text_edit_widget = QPlainTextEdit(text)
Expand Down
11 changes: 8 additions & 3 deletions datareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,23 @@ def oscheck():
pios = "aarch64"
winos = "Windows"
linuxos = "Linux"
macos = "macOS"

if pios in (platform.platform()):
print("Datareader this is Pi 64bit OS")
OS = "pi"
bull1 = 0
bull2 = 4
if winos in (platform.platform()):
elif winos in (platform.platform()):
print("Datareader this is Windows OS")
OS_Directed = "\DIRECTED.TXT"
# sudo apt install ./python-pyqt5.qtwebengine_5.15.2-2_arm64.deb
if linuxos in (platform.platform()):
elif linuxos in (platform.platform()):
print("Datareader this is Linux OS")
OS_Directed = "/DIRECTED.TXT"
elif macos in (platform.platform()):
print("Datareader this is macOS")
OS_Directed = "/DIRECTED.TXT"

else:
# print("This is not 64bit PiOS")
Expand Down Expand Up @@ -124,7 +129,7 @@ def parseDirected():

conn = sqlite3.connect("traffic.db3")
cur = conn.cursor()
datafile = open("copyDIRECTED.TXT", "r")
datafile = open("copyDIRECTED.TXT", "r",encoding='utf-8', errors='ignore')
lines = datafile.readlines()
last_lines = lines[-50:]
for num, str1 in enumerate(last_lines, 1):
Expand Down
15 changes: 15 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def oscheck():
pios = "aarch64"
lin = "Linux"
win = "Windows"
mac = "macOS"
if pios in (platform.platform()):
print("This is Pi 64bit OS")
osver = "pi"
Expand All @@ -38,6 +39,10 @@ def oscheck():
print("This is Windows")
osver = win
test_python()
elif mac in (platform.platform()):
osver = mac
print("This is macOS")
test_python()
else:
print("Commstat does not recognize this operating system and cannot proceed.")
return
Expand Down Expand Up @@ -88,6 +93,9 @@ def test_python():
elif "pi" or "Linux" in osver:
print("Installing for Linux Mint 20-21 Mate or Pi4 Bullseye 64bit")
lininstall()
elif "macOS" in osver:
print("Installing for macOS")
macinstall()
else:
print("system not recognized")

Expand Down Expand Up @@ -127,6 +135,13 @@ def wininstall():
install(seventhmodule)
runsettings()

def macinstall():
modules = ["pyqt5", "PyQtWebEngine", "feedparser", "file-read-backwards", "folium", "pandas", "maidenhead","psutil"]
for module in modules:
install(module)
runsettings()



oscheck()

Expand Down
9 changes: 7 additions & 2 deletions netmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from configparser import ConfigParser
import re
from time import strftime
from webbrowser import MacOSXOSAScript
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QDateTime, Qt, QDate
from PyQt5.QtWidgets import QMessageBox
Expand Down Expand Up @@ -493,16 +494,20 @@ def oscheck(self):
pios = "aarch64"
winos = "Windows"
linuxos = "Linux"
macos = "macOS"
if pios in (platform.platform()):
#print("Commstat this is Pi 64bit OS")
OS = "pi"
bull1 = 0
bull2 = 4
if winos in (platform.platform()):
elif winos in (platform.platform()):
#print("Commstat this is Windows OS")
OS_Reports = "reports\\"
# sudo apt install ./python-pyqt5.qtwebengine_5.15.2-2_arm64.deb
if linuxos in (platform.platform()):
elif linuxos in (platform.platform()):
#print("Commstat this is Linux OS")
OS_Reports = "reports/"
elif macos in (platform.platform()):
#print("Commstat this is Linux OS")
OS_Reports = "reports/"

Expand Down
12 changes: 9 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,23 @@ def oscheck(self):
pios = "aarch64"
winos = "Windows"
linuxos = "Linux"
macos = "macOS"

if pios in (platform.platform()):
print("This is Pi 64bit OS")
OS = "pi"
bull1 = 0
bull2 = 4
if winos in (platform.platform()):
elif winos in (platform.platform()):
print("This is Windows OS")
OS_Directed = "\DIRECTED.TXT"
# sudo apt install ./python-pyqt5.qtwebengine_5.15.2-2_arm64.deb
if linuxos in (platform.platform()):
elif linuxos in (platform.platform()):
print("This is Linux OS")
OS_Directed = "/DIRECTED.TXT"

elif macos in (platform.platform()):
print("This is macOS")
OS_Directed = "/DIRECTED.TXT"
else:
# print("This is not 64bit PiOS")
# OS = "Mint"
Expand Down Expand Up @@ -615,6 +619,8 @@ def setInfo(self):


path_to_file = (path+""+OS_Directed)
print(path_to_file)

if not os.path.exists(path_to_file):
msg = QMessageBox()
msg.setWindowTitle("CommStatX error")
Expand Down