-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sswallace
committed
Dec 10, 2022
1 parent
685053b
commit 1554e10
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import rov | ||
| import csv | ||
| from pathlib import * | ||
|
|
||
| manrs_asns = [] | ||
| manrs_csv_filename = "manrs.csv" | ||
|
|
||
| def read_manrs_participant_file(filename): | ||
| global manrs_asns | ||
| read_manrs_participant = Path.cwd() / filename | ||
| with open(read_manrs_participant) as csvfile: | ||
| fi_reader = csv.DictReader(csvfile, delimiter=',', quotechar='"') | ||
| for row in fi_reader: | ||
| for asn in row['ASNs'].split(','): | ||
| asn = asn.strip() | ||
| manrs_asns.append(asn) | ||
|
|
||
|
|
||
| def is_manrs_participant(asn): | ||
| global manrs_asns | ||
| if len(manrs_asns) == 0: | ||
| read_manrs_participant_file(manrs_csv_filename) | ||
| if asn.strip() in manrs_asns: | ||
| return True | ||
| else: | ||
| return False | ||
|
|
||
|
|
||
| # This is a sample Python script. | ||
|
|
||
| # Press ⌃R to execute it or replace it with your code. | ||
| # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. | ||
|
|
||
|
|
||
| def print_hi(name): | ||
| # Use a breakpoint in the code line below to debug your script. | ||
| print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint. | ||
|
|
||
|
|
||
| # Press the green button in the gutter to run the script. | ||
| if __name__ == '__main__': | ||
| print(f"is ASN 123 {is_manrs_participant('123')}") | ||
| print_hi('PyCharm') | ||
|
|
||
| # See PyCharm help at https://www.jetbrains.com/help/pycharm/ |