plcopen/structures.py
changeset 2459 21164625b393
parent 2456 7373e3048167
child 3750 f62625418bff
--- a/plcopen/structures.py	Fri Nov 23 11:01:20 2018 +0100
+++ b/plcopen/structures.py	Fri Nov 23 12:13:24 2018 +0100
@@ -24,9 +24,9 @@
 
 
 from __future__ import absolute_import
-import string
 import re
 from collections import OrderedDict
+from functools import reduce
 
 from plcopen.plcopen import LoadProject
 from plcopen.definitions import *
@@ -104,7 +104,10 @@
     """
     take a .csv file and translate it it a "csv_table"
     """
-    return [map(string.strip, line.split(';')) for line in file.xreadlines()]
+    table = [[column.strip()
+              for column in line.split(';')]
+             for line in file.readlines()]
+    return table
 
 
 def find_section(section_name, table):
@@ -264,7 +267,7 @@
                             Function_decl_copy = Function_decl.copy()
                             Current_section["list"].append(Function_decl_copy)
             else:
-                raise "First function must be in a category"
+                raise ValueError("First function must be in a category")
 
     return Standard_Functions_Decl