2 # -*- coding: utf-8 -*-
4 #This file is part of CanFestival, a library implementing CanOpen Stack.
6 #Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD
8 #See COPYING file for copyrights details.
10 #This library is free software; you can redistribute it and/or
11 #modify it under the terms of the GNU Lesser General Public
12 #License as published by the Free Software Foundation; either
13 #version 2.1 of the License, or (at your option) any later version.
15 #This library is distributed in the hope that it will be useful,
16 #but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #Lesser General Public License for more details.
20 #You should have received a copy of the GNU Lesser General Public
21 #License along with this library; if not, write to the Free Software
22 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 from nodemanager import *
30 print "\nUsage of objdictgen.py :"
31 print "\n %s XMLFilePath CFilePath\n"%sys.argv[0]
34 opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
35 except getopt.GetoptError:
36 # print help information and exit:
41 if o in ("-h", "--help"):
54 if __name__ == '__main__':
55 if fileIn != "" and fileOut != "":
56 manager = NodeManager()
57 if os.path.isfile(fileIn):
58 print "Parsing input file"
59 result = manager.OpenFileInCurrent(fileIn)
60 if type(result) != UnicodeType:
66 print "%s is not a valid file!"%fileIn
68 print "Writing output file"
69 result = manager.ExportCurrentToCFile(fileOut)
70 if type(result) == UnicodeType: