summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_newmod.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@kit.edu>2013-11-24 16:41:57 +0100
committerMartin Braun <martin.braun@kit.edu>2013-11-27 22:33:44 +0100
commit49ed57c55e01dffe69668ae34deddd619b3486c8 (patch)
tree8c8ba0c0e2c1f4658667aa8aad19eaa167f5447b /gr-utils/python/modtool/modtool_newmod.py
parentfa5480e8bccec39278e9c5f81c09d1e702fd0fd7 (diff)
modtool: Added git support
Diffstat (limited to 'gr-utils/python/modtool/modtool_newmod.py')
-rw-r--r--gr-utils/python/modtool/modtool_newmod.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gr-utils/python/modtool/modtool_newmod.py b/gr-utils/python/modtool/modtool_newmod.py
index 59818b1e62..3e05ecbf48 100644
--- a/gr-utils/python/modtool/modtool_newmod.py
+++ b/gr-utils/python/modtool/modtool_newmod.py
@@ -26,6 +26,7 @@ import re
from optparse import OptionGroup
from gnuradio import gr
from modtool_base import ModTool, ModToolException
+from scm import SCMRepoFactory
class ModToolNewModule(ModTool):
""" Create a new out-of-tree module """
@@ -45,6 +46,7 @@ class ModToolNewModule(ModTool):
return parser
def setup(self, options, args):
+ # Don't call ModTool.setup(), that assumes an existing module.
self._info['modname'] = options.module_name
if self._info['modname'] is None:
if len(args) >= 2:
@@ -67,6 +69,8 @@ class ModToolNewModule(ModTool):
self._srcdir = gr.prefs().get_string('modtool', 'newmod_path', options.srcdir)
if not os.path.isdir(self._srcdir):
raise ModToolException('Could not find gr-newmod source dir.')
+ self.options = options
+ self._setup_scm(mode='new')
def run(self):
"""
@@ -92,5 +96,7 @@ class ModToolNewModule(ModTool):
if os.path.basename(root) == 'howto':
os.rename(root, os.path.join(os.path.dirname(root), self._info['modname']))
print "Done."
+ if self.scm.init_repo(path_to_repo="."):
+ print "Created repository... you might want to commit before continuing."
print "Use 'gr_modtool add' to add a new block to this currently empty module."