commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/08: volk: add/remove ORC protokernels in


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/08: volk: add/remove ORC protokernels in volk_modtool
Date: Fri, 7 Mar 2014 00:24:06 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit 05161c9f48acf448d31abd88a5378608213e3574
Author: Nathan West <address@hidden>
Date:   Sun Feb 9 21:24:40 2014 -0600

    volk: add/remove ORC protokernels in volk_modtool
---
 volk/python/volk_modtool/volk_modtool_generate.py | 24 +++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/volk/python/volk_modtool/volk_modtool_generate.py 
b/volk/python/volk_modtool/volk_modtool_generate.py
index 80c2aed..637d489 100644
--- a/volk/python/volk_modtool/volk_modtool_generate.py
+++ b/volk/python/volk_modtool/volk_modtool_generate.py
@@ -20,6 +20,7 @@
 # 
 
 import os
+import glob
 import sys
 import re
 import glob
@@ -150,12 +151,24 @@ class volk_modtool:
         newrelpath = re.sub(oldvolk, 'volk_' + self.my_dict['name'], relpath); 
   
         dest = os.path.join(self.my_dict['destination'], 'volk_' + 
self.my_dict['name'], os.path.dirname(newrelpath), newname);        
                               
-
-
         if not os.path.exists(os.path.dirname(dest)):
             os.makedirs(os.path.dirname(dest))
         open(dest, 'w+').write(outstring);
 
+        # copy orc proto-kernels if they exist
+        for orcfile in glob.glob(inpath + '/orc/' + top + name + '*.orc'):
+            if os.path.isfile(orcfile):
+                instring = open(orcfile, 'r').read();
+                outstring = re.sub(oldvolk, 'volk_' + self.my_dict['name'], 
instring);
+                newname = 'volk_' + self.my_dict['name'] + '_' + name + '.orc';
+                relpath = os.path.relpath(orcfile, base);
+                newrelpath = re.sub(oldvolk, 'volk_' + self.my_dict['name'], 
relpath);
+                dest = os.path.join(self.my_dict['destination'], 'volk_' + 
self.my_dict['name'], os.path.dirname(newrelpath), newname);
+                if not os.path.exists(os.path.dirname(dest)):
+                    os.makedirs(os.path.dirname(dest));
+                open(dest, 'w+').write(outstring)
+
+
     def remove_kernel(self, name):
         basename = self.my_dict['name'];
         if len(basename) > 0:
@@ -215,6 +228,13 @@ class volk_modtool:
             print "Removing kernel %s"%(kernel.pattern)
             if os.path.exists(infile):
                 os.remove(infile);
+        # remove the orc proto-kernels if they exist. There are no puppets here
+        # so just need to glob for files matching kernel name
+        print glob.glob(inpath + '/orc/' + top + name + '*.orc');
+        for orcfile in glob.glob(inpath + '/orc/' + top + name + '*.orc'):
+            print orcfile
+            if(os.path.exists(orcfile)):
+                os.remove(orcfile);
     
     def import_kernel(self, name, base):
         if not (base):



reply via email to

[Prev in Thread] Current Thread [Next in Thread]