targets/__init__.py
changeset 1680 6db967480b7d
parent 1571 486f94a8032c
child 1730 64d8f52bc8c8
--- a/targets/__init__.py	Wed Apr 12 10:20:01 2017 +0000
+++ b/targets/__init__.py	Thu Apr 20 13:01:45 2017 +0300
@@ -5,6 +5,7 @@
 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
 #
 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov
 #
 # See COPYING file for copyrights details.
 #
@@ -34,8 +35,9 @@
 """
 
 from os import listdir, path
+import util.paths as paths
 
-_base_path = path.split(__file__)[0]
+_base_path = paths.AbsDir(__file__)
 def _GetLocalTargetClassFactory(name):
     return lambda:getattr(__import__(name,globals(),locals()), name+"_target")
 
@@ -78,10 +80,10 @@
     return code
 
 def GetHeader():
-    filename = path.join(path.split(__file__)[0],"beremiz.h")
+    filename = paths.AbsNeighbourFile(__file__,"beremiz.h")
     return open(filename).read()
 
 def GetCode(name):
-    filename = path.join(path.split(__file__)[0],name)
+    filename = paths.AbsNeighbourFile(__file__,name)
     return open(filename).read()