-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
26 lines (22 loc) · 829 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
import configparser
from common import copy_file
from data import data_pattern
from control import control_pattern
from ack import ack_pattern
config = configparser.ConfigParser()
config.read('config.ini')
dnb = config.get('Data', 'num_of_bits')
dnp = config.get('Data', 'num_of_ports')
dpn = config.get('Data', 'port_names')
cnb = config.get('Control', 'num_of_bits')
cnp = config.get('Control', 'num_of_ports')
cpn = config.get('Control', 'port_names')
if __name__ == "__main__":
# Get the input file name and output file name from command line arguments
input_file = "venv/include/common_pattern.txt"
output_file = "output.txt"
copy_file(input_file, output_file)
data_pattern(dnb, dnp, dpn, output_file)
control_pattern(cnb, cnp, cpn, output_file)
ack_pattern(dnp, dpn, output_file)