Skip to content

Commit

Permalink
move git_support_enabled into base.py and fix theme_package config
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTango committed Apr 10, 2018
1 parent 9534b1c commit db886d3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 0 additions & 6 deletions bobtemplates/plone/addon.py
Expand Up @@ -3,17 +3,11 @@
from bobtemplates.plone.base import git_commit
from bobtemplates.plone.base import git_init
from bobtemplates.plone.base import make_path
from mrbob.bobexceptions import SkipQuestion

import os
import shutil


def git_support_enabled(configurator, question):
if configurator.variables.get('package.git.disabled'):
raise SkipQuestion(u'GIT support is disabled!.')


def pre_render(configurator):
"""Some variables to make templating easier.
"""
Expand Down
2 changes: 1 addition & 1 deletion bobtemplates/plone/addon/.mrbob.ini
Expand Up @@ -21,7 +21,7 @@ package.description.help = One-liner describing what this package does. Should b
package.git.init.question = Do you want me to initialze a GIT repository in your new package? (y/n)
package.git.init.help = It's highly recommended to use GIT to track changes in your package.
package.git.init.default = y
package.git.init.pre_ask_question = bobtemplates.plone.addon:git_support_enabled
package.git.init.pre_ask_question = bobtemplates.plone.base:git_support_enabled
package.git.init.post_ask_question = mrbob.hooks:validate_choices mrbob.hooks:to_boolean
package.git.init.choices = y|n
package.git.init.choices_delimiter = |
Expand Down
5 changes: 5 additions & 0 deletions bobtemplates/plone/base.py
Expand Up @@ -21,6 +21,11 @@
from configparser import ConfigParser


def git_support_enabled(configurator, question):
if configurator.variables.get('package.git.disabled'):
raise SkipQuestion(u'GIT support is disabled!.')


def echo(msg, msg_type=None):
msg = str(msg)
if msg_type == 'warning':
Expand Down
2 changes: 1 addition & 1 deletion bobtemplates/plone/theme_package.py
Expand Up @@ -159,7 +159,7 @@ def pre_ask(configurator):

def post_render(configurator):
_cleanup_package(configurator)
if configurator.variables['package.git.init']:
if configurator.variables.get('package.git.init'):
git_init(configurator)
git_commit(
configurator,
Expand Down
13 changes: 7 additions & 6 deletions bobtemplates/plone/theme_package/.mrbob.ini
Expand Up @@ -27,12 +27,13 @@ package.description.required = True
package.description.default = A theme add-on for Plone
package.description.help = One-liner describing what this package does. Should be something like 'Plone add-on that ...'.
package.git.question = Do you want me to initialze a GIT repository in your new package? (y/n)
package.git.help = It's highly recommended to use GIT to track changes in your package.
package.git.default = y
package.git.post_ask_question = mrbob.hooks:validate_choices mrbob.hooks:to_boolean
package.git.choices = y|n
package.git.choices_delimiter = |
package.git.init.question = Do you want me to initialze a GIT repository in your new package? (y/n)
package.git.init.help = It's highly recommended to use GIT to track changes in your package.
package.git.init.default = y
package.git.init.pre_ask_question = bobtemplates.plone.base:git_support_enabled
package.git.init.post_ask_question = mrbob.hooks:validate_choices mrbob.hooks:to_boolean
package.git.init.choices = y|n
package.git.init.choices_delimiter = |

plone.version.question = Plone version
plone.version.help = Which Plone version would you like to use?
Expand Down

0 comments on commit db886d3

Please sign in to comment.