Herc commited on
Commit
a9ca7ec
·
verified ·
1 Parent(s): 6427d95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -11
app.py CHANGED
@@ -12,11 +12,24 @@ def random_date():
12
  # Function to load and cache the product catalog
13
  @st.cache_data
14
  def load_catalog():
15
- review_statuses = [random.choice(["Approved", "Under Review", "Not Approved"]) for _ in range(50)]
16
- not_approved_reasons = [
17
- None if status != "Not Approved" else random.choice(["Security Concern", "Licensing Issue", "Privacy Issue", "Compliance Requirement"])
18
- for status in review_statuses
19
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  products = {
21
  "Product Name": [
22
  "Notepad++", "WinRAR", "7-Zip", "CCleaner", "TeamViewer",
@@ -42,12 +55,12 @@ def load_catalog():
42
  "Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software",
43
  "Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software"
44
  ],
45
- "Cyber Approved": [random.choice([True, False]) for _ in range(50)],
46
- "Accessibility Approved": [random.choice([True, False]) for _ in range(50)],
47
- "Privacy Approved": [random.choice([True, False]) for _ in range(50)],
48
- "Review Date": [random_date() for _ in range(50)],
49
- "Review Status": review_statuses,
50
- "Not Approved Reason": not_approved_reasons
51
  }
52
  return pd.DataFrame(products)
53
 
 
12
  # Function to load and cache the product catalog
13
  @st.cache_data
14
  def load_catalog():
15
+ # Generate approval attributes
16
+ cyber_approved = [random.choice([True, False]) for _ in range(50)]
17
+ accessibility_approved = [random.choice([True, False]) for _ in range(50)]
18
+ privacy_approved = [random.choice([True, False]) for _ in range(50)]
19
+
20
+ review_statuses = []
21
+ not_approved_reasons = []
22
+ for cyber, accessibility, privacy in zip(cyber_approved, accessibility_approved, privacy_approved):
23
+ if cyber and accessibility and privacy: # All approvals are True
24
+ review_statuses.append("Approved")
25
+ not_approved_reasons.append(None)
26
+ elif not cyber and not accessibility and not privacy: # All approvals are False
27
+ review_statuses.append("Not Approved")
28
+ not_approved_reasons.append(random.choice(["Security Concern", "Licensing Issue", "Privacy Issue", "Compliance Requirement"]))
29
+ else: # Mixed approvals
30
+ review_statuses.append("Under Review")
31
+ not_approved_reasons.append(None)
32
+
33
  products = {
34
  "Product Name": [
35
  "Notepad++", "WinRAR", "7-Zip", "CCleaner", "TeamViewer",
 
55
  "Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software",
56
  "Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software"
57
  ],
58
+ "Cyber Approved": cyber_approved,
59
+ "Accessibility Approved": accessibility_approved,
60
+ "Privacy Approved": privacy_approved,
61
+ "Review Date": [random_date() for _ in range(50)],
62
+ "Review Status": review_statuses,
63
+ "Not Approved Reason": not_approved_reasons
64
  }
65
  return pd.DataFrame(products)
66