summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2022-07-02 03:01:24 -0400
committerseth <[email protected]>2022-07-02 03:01:24 -0400
commita6be3128690e5d012382de8eeb2e5e6634a0bde8 (patch)
treec18cd4b09a9c143e5f8e2d69b542af76f7d30036
parentb491e255945f055c26bfefc9d0526f1a36e7a554 (diff)
run through flake8HEADmain
-rwxr-xr-xcountdistros.py6
-rwxr-xr-xcountdistros_pichart.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/countdistros.py b/countdistros.py
index ccdb19c..08b242e 100755
--- a/countdistros.py
+++ b/countdistros.py
@@ -5,7 +5,9 @@ import re
import sys
# array of distro names (EDIT THIS AND PROBABLY USE CAPITALIZATION)
-arr = [ 'Ubuntu', 'Linux Mint', 'Pop!_OS', 'Debian', 'Arch Linux', 'Manjaro Linux', 'Fedora' ]
+arr = ['Ubuntu', 'Linux Mint', 'Pop!_OS', 'Debian', 'Arch Linux',
+ 'Manjaro Linux', 'Fedora']
+
def get_count(distro, db, data):
# print how many times distro appears in report
@@ -30,7 +32,7 @@ def get_data(filename='reports_piiremoved.json'):
try:
with open(filename) as file:
db = json.load(file)
- except:
+ except Exception:
err = filename + ' doesn\'t exist or isn\'t valid json!'
print(err)
sys.exit(1)
diff --git a/countdistros_pichart.py b/countdistros_pichart.py
index ed66d71..09d19bb 100755
--- a/countdistros_pichart.py
+++ b/countdistros_pichart.py
@@ -3,9 +3,10 @@
import countdistros as countd
import matplotlib.pyplot as plt
+
def run():
data = countd.get_data()
-
+
labels = []
values = []
for x, y in data.items():
@@ -16,5 +17,6 @@ def run():
plt.axis('equal')
plt.show()
+
if __name__ == '__main__':
run()