Revision: 8454
http://playerstage.svn.sourceforge.net/playerstage/?rev=8454&view=rev
Author: thjc
Date: 2009-12-13 11:46:45 +0000 (Sun, 13 Dec 2009)
Log Message:
-----------
applied fixed version of 2898272: Allowing Playerinterfacegen.py to accemp
multile files
Modified Paths:
--------------
code/player/trunk/libplayerinterface/playerinterfacegen.py
Modified: code/player/trunk/libplayerinterface/playerinterfacegen.py
===================================================================
--- code/player/trunk/libplayerinterface/playerinterfacegen.py 2009-12-08
01:17:37 UTC (rev 8453)
+++ code/player/trunk/libplayerinterface/playerinterfacegen.py 2009-12-13
11:46:45 UTC (rev 8454)
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
#/*
# * Player - One Hell of a Robot Server
@@ -33,7 +34,7 @@
PLUGIN_MODE = "--plugin"
-USAGE = "USAGE: playerinterfacegen.py [%s | %s | %s] [%s] [<interface
file>|<interface dir>]" % (HEADER_MODE, FUNCTIONTABLE_MODE, UTILS_MODE,
PLUGIN_MODE)
+USAGE = "USAGE: playerinterfacegen.py [%s | %s | %s] [%s] [<interface
files>|<interface dirs>]" % (HEADER_MODE, FUNCTIONTABLE_MODE, UTILS_MODE,
PLUGIN_MODE)
class msg:
pass
@@ -210,7 +211,7 @@
if __name__ == '__main__':
mode = HEADER_MODE
- targetfile = "interfaces"
+ targets = []
plugin = False
for option in sys.argv[1:]:
@@ -222,7 +223,10 @@
elif option == PLUGIN_MODE:
plugin = True
else:
- targetfile = option
+ targets.append(option)
+
+ if targets == []:
+ targets = ["interfaces"]
print "/* START OF AUTOGENERATED CODE */"
if plugin:
@@ -231,20 +235,21 @@
print "/* This file or section was automatically generated by
playerinterfacegen.py"
print "To modify the interfaces in this file please edit their interface
definition in libplayerinterface/interfaces/ */"
- if mode == UTILS_MODE:
- process_for_utils(targetfile)
- else:
- if os.path.isdir(targetfile):
- files = glob.glob(os.path.join(targetfile ,"*.def"))
- # It is important that we sort this file list, to ensure that the
- # structure definitions are output in increasing numerical order, to
- # support the use of earlier messages structures in later ones.
- files.sort()
- for file in files:
- if not os.path.isdir(file):
- processfile(mode, file, plugin)
+ for target in targets:
+ if mode == UTILS_MODE:
+ process_for_utils(target)
else:
- processfile(mode, targetfile, plugin)
+ if os.path.isdir(target):
+ files = glob.glob(os.path.join(target ,"*.def"))
+ # It is important that we sort this file list, to ensure that the
+ # structure definitions are output in increasing numerical order, to
+ # support the use of earlier messages structures in later ones.
+ files.sort()
+ for f in files:
+ if not os.path.isdir(f):
+ processfile(mode, f, plugin)
+ else:
+ processfile(mode, target, plugin)
print "/* END OF AUTOGENERATED CODE */"
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit