Beispiel #1
0
 def run(self):
     """ Go, go, go! """
     mod_info = dict()
     mod_info['base_dir'] = self._get_base_dir(self._directory)
     if mod_info['base_dir'] is None:
         raise ModToolException('{}' if self._python_readable else "No module found.")
     os.chdir(mod_info['base_dir'])
     mod_info['modname'] = get_modname()
     if mod_info['modname'] is None:
         raise ModToolException('{}' if self._python_readable else "No module found.")
     if self._info['version'] == '36' and (
             os.path.isdir(os.path.join('include', mod_info['modname'])) or
             os.path.isdir(os.path.join('include', 'gnuradio', mod_info['modname']))
             ):
         self._info['version'] = '37'
     mod_info['version'] = self._info['version']
     if 'is_component' in self._info.keys():
         mod_info['is_component'] = True
     mod_info['incdirs'] = []
     mod_incl_dir = os.path.join(mod_info['base_dir'], 'include')
     if os.path.isdir(os.path.join(mod_incl_dir, mod_info['modname'])):
         mod_info['incdirs'].append(os.path.join(mod_incl_dir, mod_info['modname']))
     else:
         mod_info['incdirs'].append(mod_incl_dir)
     build_dir = self._get_build_dir(mod_info)
     if build_dir is not None:
         mod_info['build_dir'] = build_dir
         mod_info['incdirs'] += self._get_include_dirs(mod_info)
     if self._python_readable:
         print str(mod_info)
     else:
         self._pretty_print(mod_info)
Beispiel #2
0
 def setup(self):
     """ Initialise all internal variables, such as the module name etc. """
     (options, self.args) = self.parser.parse_args()
     self._dir = options.directory
     if not self._check_directory(self._dir):
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     if options.module_name is not None:
         self._info['modname'] = options.module_name
     else:
         self._info['modname'] = get_modname()
     if self._info['modname'] is None:
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     print "GNU Radio module name identified: " + self._info['modname']
     if self._info['version'] == '36' and os.path.isdir(os.path.join('include', self._info['modname'])):
         self._info['version'] = '37'
     if options.skip_lib or not self._has_subdirs['lib']:
         self._skip_subdirs['lib'] = True
     if options.skip_python or not self._has_subdirs['python']:
         self._skip_subdirs['python'] = True
     if options.skip_swig or self._get_mainswigfile() is None or not self._has_subdirs['swig']:
         self._skip_subdirs['swig'] = True
     if options.skip_occ or not self._has_subdirs['occ']:
         self._skip_subdirs['occ'] = True
     self._info['blockname'] = options.block_name
     self.options = options
     self._setup_files()
     self._info['yes'] = options.yes
Beispiel #3
0
 def setup(self, options, args):
     """ Initialise all internal variables, such as the module name etc. """
     self._dir = options.directory
     if not self._check_directory(self._dir):
         raise ModToolException(
             'No RFNoC module found in the given directory.')
     if options.module_name is not None:
         self._info['modname'] = options.module_name
     else:
         self._info['modname'] = get_modname()
     if self._info['modname'] is None:
         raise ModToolException(
             'No RFNoC module found in the given directory.')
     print "RFNoC module name identified: " + self._info['modname']
     if self._info['version'] == '36' and (
             os.path.isdir(os.path.join('include', self._info['modname']))
             or os.path.isdir(
                 os.path.join('include', 'gnuradio',
                              self._info['modname']))):
         self._info['version'] = '37'
     if options.skip_lib or not self._has_subdirs['lib']:
         self._skip_subdirs['lib'] = True
     if options.skip_python or not self._has_subdirs['python']:
         self._skip_subdirs['python'] = True
     if options.skip_swig or self._get_mainswigfile(
     ) is None or not self._has_subdirs['swig']:
         self._skip_subdirs['swig'] = True
     if options.skip_grc or not self._has_subdirs['grc']:
         self._skip_subdirs['grc'] = True
         ###TODO: add skip for rfnoc?
     self._info['blockname'] = options.block_name
     self._setup_files()
     self._info['yes'] = options.yes
     self.options = options
     self._setup_scm()
Beispiel #4
0
 def setup(self):
     """ Initialise all internal variables, such as the module name etc. """
     (options, self.args) = self.parser.parse_args()
     self._dir = options.directory
     if not self._check_directory(self._dir):
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     if options.module_name is not None:
         self._info['modname'] = options.module_name
     else:
         self._info['modname'] = get_modname()
     if self._info['modname'] is None:
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     print "GNU Radio module name identified: " + self._info['modname']
     if self._info['version'] == '36' and os.path.isdir(
             os.path.join('include', self._info['modname'])):
         self._info['version'] = '37'
     if options.skip_lib or not self._has_subdirs['lib']:
         self._skip_subdirs['lib'] = True
     if options.skip_python or not self._has_subdirs['python']:
         self._skip_subdirs['python'] = True
     if options.skip_swig or self._get_mainswigfile(
     ) is None or not self._has_subdirs['swig']:
         self._skip_subdirs['swig'] = True
     if options.skip_grc or not self._has_subdirs['grc']:
         self._skip_subdirs['grc'] = True
     self._info['blockname'] = options.block_name
     self.options = options
     self._setup_files()
     self._info['yes'] = options.yes
Beispiel #5
0
 def setup(self):
     """ Initialise all internal variables, such as the module name etc. """
     (options, self.args) = self.parser.parse_args()
     self._dir = options.directory
     if not self._check_directory(self._dir):
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     print "Operating in directory " + self._dir
     if options.module_name is not None:
         self._info["modname"] = options.module_name
     else:
         self._info["modname"] = get_modname()
     if self._info["modname"] is None:
         print "No GNU Radio module found in the given directory. Quitting."
         sys.exit(1)
     print "GNU Radio module name identified: " + self._info["modname"]
     if self._info["version"] == "36" and os.path.isdir(os.path.join("include", self._info["modname"])):
         self._info["version"] = "37"
     if options.skip_lib or not self._has_subdirs["lib"]:
         self._skip_subdirs["lib"] = True
     if options.skip_python or not self._has_subdirs["python"]:
         self._skip_subdirs["python"] = True
     if options.skip_swig or self._get_mainswigfile() is None or not self._has_subdirs["swig"]:
         self._skip_subdirs["swig"] = True
     if options.skip_grc or not self._has_subdirs["grc"]:
         self._skip_subdirs["grc"] = True
     self._info["blockname"] = options.block_name
     self.options = options
     self._setup_files()
Beispiel #6
0
 def run(self):
     """ Go, go, go! """
     mod_info = {}
     mod_info['base_dir'] = self._get_base_dir(self.options.directory)
     if mod_info['base_dir'] is None:
         if self.options.python_readable:
             print '{}'
         else:
             print "No module found."
         sys.exit(0)
     os.chdir(mod_info['base_dir'])
     mod_info['modname'] = get_modname()
     if self._info['version'] == '36' and os.path.isdir(os.path.join('include', mod_info['modname'])):
         self._info['version'] = '37'
     mod_info['version'] = self._info['version']
     if 'is_component' in self._info.keys():
         mod_info['is_component'] = True
     mod_info['incdirs'] = []
     mod_incl_dir = os.path.join(mod_info['base_dir'], 'include')
     if os.path.isdir(os.path.join(mod_incl_dir, mod_info['modname'])):
         mod_info['incdirs'].append(os.path.join(mod_incl_dir, mod_info['modname']))
     else:
         mod_info['incdirs'].append(mod_incl_dir)
     build_dir = self._get_build_dir(mod_info)
     if build_dir is not None:
         mod_info['build_dir'] = build_dir
         mod_info['incdirs'] += self._get_include_dirs(mod_info)
     if self.options.python_readable:
         print str(mod_info)
     else:
         self._pretty_print(mod_info)
 def run(self):
     """ Go, go, go! """
     mod_info = dict()
     mod_info['base_dir'] = self._get_base_dir(self._directory)
     if mod_info['base_dir'] is None:
         raise ModToolException(
             '{}' if self._python_readable else "No module found.")
     os.chdir(mod_info['base_dir'])
     mod_info['modname'] = get_modname()
     if mod_info['modname'] is None:
         raise ModToolException(
             '{}' if self._python_readable else "No module found.")
     if self._info['version'] == '36' and (os.path.isdir(
             os.path.join('include', mod_info['modname'])) or os.path.isdir(
                 os.path.join('include', 'gnuradio', mod_info['modname']))):
         self._info['version'] = '37'
     mod_info['version'] = self._info['version']
     if 'is_component' in self._info.keys() and self._info['is_component']:
         mod_info['is_component'] = True
     mod_info['incdirs'] = []
     mod_incl_dir = os.path.join(mod_info['base_dir'], 'include')
     if os.path.isdir(os.path.join(mod_incl_dir, mod_info['modname'])):
         mod_info['incdirs'].append(
             os.path.join(mod_incl_dir, mod_info['modname']))
     else:
         mod_info['incdirs'].append(mod_incl_dir)
     build_dir = self._get_build_dir(mod_info)
     if build_dir is not None:
         mod_info['build_dir'] = build_dir
         mod_info['incdirs'] += self._get_include_dirs(mod_info)
     if self._python_readable:
         print str(mod_info)
     else:
         self._pretty_print(mod_info)
Beispiel #8
0
 def setup(self, options, args):
     """ Initialise all internal variables, such as the module name etc. """
     self._dir = options.directory
     if not self._check_directory(self._dir):
         raise ModToolException('No GNU Radio module found in the given directory.')
     if options.module_name is not None:
         self._info['modname'] = options.module_name
     else:
         self._info['modname'] = get_modname()
     if self._info['modname'] is None:
         raise ModToolException('No GNU Radio module found in the given directory.')
     print "GNU Radio module name identified: " + self._info['modname']
     if self._info['version'] == '36' and (
             os.path.isdir(os.path.join('include', self._info['modname'])) or
             os.path.isdir(os.path.join('include', 'gnuradio', self._info['modname']))
             ):
         self._info['version'] = '37'
     if options.skip_lib or not self._has_subdirs['lib']:
         self._skip_subdirs['lib'] = True
     if options.skip_python or not self._has_subdirs['python']:
         self._skip_subdirs['python'] = True
     if options.skip_swig or self._get_mainswigfile() is None or not self._has_subdirs['swig']:
         self._skip_subdirs['swig'] = True
     if options.skip_grc or not self._has_subdirs['grc']:
         self._skip_subdirs['grc'] = True
     self._info['blockname'] = options.block_name
     self._setup_files()
     self._info['yes'] = options.yes
     self.options = options
     self._setup_scm()
Beispiel #9
0
    def setup(self):
        """ Initialise all internal variables, such as the module name etc. """
        (options, self.args) = self.parser.parse_args()
        self._dir = options.directory
        if not self._check_directory(self._dir):
            print "No GNU Radio module found in the given directory. Quitting."
            sys.exit(1)
        print "Operating in directory " + self._dir

        if options.skip_lib:
            print "Force-skipping 'lib'."
            self._skip_subdirs['lib'] = True
        if options.skip_python:
            print "Force-skipping 'python'."
            self._skip_subdirs['python'] = True
        if options.skip_swig:
            print "Force-skipping 'swig'."
            self._skip_subdirs['swig'] = True

        if options.module_name is not None:
            self._info['modname'] = options.module_name
        else:
            self._info['modname'] = get_modname()
        print "GNU Radio module name identified: " + self._info['modname']
        self._info['blockname'] = options.block_name
        self.options = options
Beispiel #10
0
    def setup(self):
        """ Initialise all internal variables, such as the module name etc. """
        (options, self.args) = self.parser.parse_args()
        self._dir = options.directory
        if not self._check_directory(self._dir):
            print "No GNU Radio module found in the given directory. Quitting."
            sys.exit(1)
        print "Operating in directory " + self._dir

        if options.skip_lib:
            print "Force-skipping 'lib'."
            self._skip_subdirs['lib'] = True
        if options.skip_python:
            print "Force-skipping 'python'."
            self._skip_subdirs['python'] = True
        if options.skip_swig:
            print "Force-skipping 'swig'."
            self._skip_subdirs['swig'] = True

        if options.module_name is not None:
            self._info['modname'] = options.module_name
        else:
            self._info['modname'] = get_modname()
        print "GNU Radio module name identified: " + self._info['modname']
        self._info['blockname'] = options.block_name
        self.options = options
Beispiel #11
0
 def run(self):
     """ Go, go, go! """
     mod_info = {}
     mod_info['base_dir'] = self._get_base_dir(self.options.directory)
     if mod_info['base_dir'] is None:
         if self.options.python_readable:
             print '{}'
         else:
             print "No module found."
         exit(1)
     os.chdir(mod_info['base_dir'])
     mod_info['modname'] = get_modname()
     if mod_info['modname'] is None:
         if self.options.python_readable:
             print '{}'
         else:
             print "No module found."
         exit(1)
     if self._info['version'] == '36' and os.path.isdir(
             os.path.join('include', mod_info['modname'])):
         self._info['version'] = '37'
     mod_info['version'] = self._info['version']
     if 'is_component' in self._info.keys():
         mod_info['is_component'] = True
     mod_info['incdirs'] = []
     mod_incl_dir = os.path.join(mod_info['base_dir'], 'include')
     if os.path.isdir(os.path.join(mod_incl_dir, mod_info['modname'])):
         mod_info['incdirs'].append(
             os.path.join(mod_incl_dir, mod_info['modname']))
     else:
         mod_info['incdirs'].append(mod_incl_dir)
     build_dir = self._get_build_dir(mod_info)
     if build_dir is not None:
         mod_info['build_dir'] = build_dir
         mod_info['incdirs'] += self._get_include_dirs(mod_info)
     if self.options.python_readable:
         print str(mod_info)
     else:
         self._pretty_print(mod_info)