Skip to content

Commit

Permalink
indentation (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
swethalohith2 authored May 14, 2024
1 parent 6938ce8 commit 11b9dd6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions synctl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,18 @@ def pop_cost_estimate(self):
def print_estimated_pop_size(self):

pop_estimate_size = self.pop_size_estimate()
max_label_length = max(len(str(pop_estimate_size["api_simple"]["testCount"])), len(str(pop_estimate_size["api_script"]["testCount"])), len(str(pop_estimate_size["browser_script"]["testCount"])), len(str(pop_estimate_size["agent"])))

test_counts = [format(pop_estimate_size[test_type]["testCount"], ',') for test_type in ["api_simple", "api_script", "browser_script", ]]
max_commas = max(str(test_count).count(',') for test_count in test_counts)
max_label_length = max(len(str(pop_estimate_size["api_simple"]["testCount"])), len(str(pop_estimate_size["api_script"]["testCount"])),
len(str(pop_estimate_size["browser_script"]["testCount"])), len(pop_estimate_size["agent"])+2) + max_commas

print("\nYour requirement is:")
print(f' API Simple: {pop_estimate_size["api_simple"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["api_simple"]["frequency"]}min' if pop_estimate_size["api_simple"]["testCount"] > 0 else f' API Simple: {pop_estimate_size["api_simple"]["testCount"]:<{max_label_length}}')
print(f' API Script: {pop_estimate_size["api_script"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["api_script"]["frequency"]}min' if pop_estimate_size["api_script"]["testCount"] > 0 else f' API Script: {pop_estimate_size["api_script"]["testCount"]:<{max_label_length}}')
print(f' Browser Test: {pop_estimate_size["browser_script"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["browser_script"]["frequency"]}min' if pop_estimate_size["browser_script"]["testCount"] > 0 else f' Browser Test: {pop_estimate_size["browser_script"]["testCount"]:<{max_label_length}}')
print(f' API Simple: {pop_estimate_size["api_simple"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["api_simple"]["frequency"]}min' if pop_estimate_size["api_simple"]["testCount"] > 0 else f' API Simple: {pop_estimate_size["api_simple"]["testCount"]:<{max_label_length}}')
print(f' API Script: {pop_estimate_size["api_script"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["api_script"]["frequency"]}min' if pop_estimate_size["api_script"]["testCount"] > 0 else f' API Script: {pop_estimate_size["api_script"]["testCount"]:<{max_label_length}}')
print(f' Browser Test: {pop_estimate_size["browser_script"]["testCount"]:<{max_label_length},} Frequency: {pop_estimate_size["browser_script"]["frequency"]}min' if pop_estimate_size["browser_script"]["testCount"] > 0 else f' Browser Test: {pop_estimate_size["browser_script"]["testCount"]:<{max_label_length}}')
agent_yes = "Yes" if pop_estimate_size["agent"] in ["y", "Y"] else "No"
print(f' Install Agent: {agent_yes:<{max_label_length}} Worker Nodes: {pop_estimate_size["worker_nodes"]}' if pop_estimate_size["agent"].upper() == "Y" else f' Install Agent: {agent_yes:<{max_label_length}}')
print(f' Install Agent: {agent_yes:<{max_label_length}} Worker Nodes: {pop_estimate_size["worker_nodes"]}' if pop_estimate_size["agent"].upper() == "Y" else f' Install Agent: {agent_yes:<{max_label_length}}')

print("\nThe estimated sizing is:")
print(f' CPU: {pop_estimate_size["cpu"]:,}m')
Expand Down

0 comments on commit 11b9dd6

Please sign in to comment.