Wei-1 commented on a change in pull request #44: Marvin engine delete command
URL: https://github.com/apache/incubator-marvin/pull/44#discussion_r386795354
 
 

 ##########
 File path: python-toolbox/marvin_python_toolbox/management/engine.py
 ##########
 @@ -474,6 +474,56 @@ def generate(name, description, mantainer, email, 
package, dest, no_env, no_git,
             shutil.rmtree(dest)
 
 
+
[email protected]('engine-delete', help='Delete an existing marvin engine project.')
[email protected]('--name', '-n', prompt='Project name', help='Project name')
[email protected]('--dest', '-d', envvar='MARVIN_HOME', 
type=click.Path(exists=True), help='Root folder path for the creation')
+def delete_engine(name,dest):
+    type_ = 'python-engine'
+    # Process package name
+    package = _slugify(name)
+
+    # Make sure package name starts with "marvin"
+    if not package.startswith('marvin'):
+        package = 'marvin_{}'.format(package)
+
+    # Remove "lib" prefix from package name
+    if type_ == 'lib' and package.endswith('lib'):
+        package = package[:-3]
+    # Custom strip to remove underscores
+    package = package.strip('_')
+
+    # Append project type to services
+
+    if type_ in TEMPLATE_BASES and not package.endswith('engine'):
+        package = '{}_engine'.format(package)
+
+    # Process directory/virtualenv name
+
+    # Directory name should use '-' instead of '_'
+    dir_ = package.replace('_', '-')
 
 Review comment:
   Since we are applying the same naming process as line 410, should we make it 
a function so that generate and delete will always point to the same 
environment?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to