diff --git a/Project/rw_device_params.py b/Project/rw_device_params.py deleted file mode 100644 index bf44fb0..0000000 --- a/Project/rw_device_params.py +++ /dev/null @@ -1,33 +0,0 @@ -# Dict for all devices params - -all_params = {'func': 0, 'status': 1, 'name': 2, - 'id': 3, 'type_of_connection': 4, 'baud_rate': 5} - -# Read device params from .dat device file - - -def read_device_params(name): - file = open('data/{}.dat'.format(name), 'r') - params = file.readline().split() - file.close() - return params - -# Change device params in .dat device file - - -def write_device_params(name, param, value): - - try: - file = open('data/{}.dat'.format(name), 'r+') - params = file.readline().split() - if value != '': - params[all_params[param]] = str(value) - else: - params[all_params[param]] = 'none' - file.seek(0) - file.truncate() - file.write(' '.join(params)) - file.close() - - except IndexError: - print('ErrorType = FileError: File.dat for this device does not exist') \ No newline at end of file