Giter VIP home page Giter VIP logo

mr.bob's Introduction

Mister Bob the Builder creates directory skeletons.

Documentation

http://mrbob.readthedocs.org/

TODO

  • [medium] refactor Python API
  • [medium] gittip
  • [medium] add +var+ folder in template_sample
  • [medium] Check how one would implement multi-namespace python package with current mr.bob api
  • [low] Ability to configure what to ignore when copying templates in bobconfig (as a hook?)
  • [low] better format print questions output (keep order of questions -> use order information like for asking questions)
  • [low] document we don't need local commands once answers are remembered (just issue another template on top of current)
  • [low] ability to specify variables/defaults to questions from cli
  • [maybe] ability to simulate rendering (dry-run)
  • [maybe] ability to update/patch templates

mr.bob's People

Contributors

disko avatar domenkozar avatar encolpe avatar fgimian avatar gawel avatar gforcada avatar glenfant avatar gotcha avatar jpcw avatar mauritsvanrees avatar mbaechtold avatar pbauer avatar sashahart avatar sbidoul avatar thet avatar tomster avatar zupo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mr.bob's Issues

exception with no readline on windows

C:\Users\rsyring\dev\projects\level12-src>mrbob --help
Traceback (most recent call last):
  File "c:\python27\scripts\mrbob-script.py", line 9, in <module>
    load_entry_point('mr.bob==0.1a7', 'console_scripts', 'mrbob')()
  File "c:\python27\lib\site-packages\distribute-0.6.25-py2.7.egg\pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "c:\python27\lib\site-packages\distribute-0.6.25-py2.7.egg\pkg_resources.py", line 2283, in load_entry_point
    return ep.load()
  File "c:\python27\lib\site-packages\distribute-0.6.25-py2.7.egg\pkg_resources.py", line 1993, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "c:\python27\lib\site-packages\mrbob\cli.py", line 11, in <module>
    from .configurator import Configurator
  File "c:\python27\lib\site-packages\mrbob\configurator.py", line 6, in <module>
    import readline
ImportError: No module named readline

Bob templates fall with remote configuration and remote package

This command should use mrbob with remote configuration:

mrbob -O interlegis.portalmodelo.policy --config https://raw.github.com/plonegovbr/bobtemplates.plonegovbr/master/test_answers_addon.ini https://github.com/plonegovbr/bobtemplates.plonegovbr/zipball/master#bobtemplates/plonegovbr/addon

but it is getting some erros

usage: mrbob [-h] [-O TARGET_DIRECTORY] [-v] [-c CONFIG] [-V] [-l] [-w] [-n]
             [-q]
             [template]
mrbob: error: TemplateConfigurationError: Config not found: /tmp/tmpkiFRWj/bobtemplates/plonegovbr/addon/.mrbob.ini

and the errors are invalid since the file .mrbob.ini exists:

https://github.com/plonegovbr/bobtemplates.plonegovbr/blob/master/bobtemplates/plonegovbr/addon/.mrbob.ini

Allow to clone a template instead of copying or extracting

If I'm informed correctly, it is possible to use a template via file system copy, or to specify the URL of an archive to be extracted.

What I'd like to be able to do, is: to clone my template. That way I could update my generated bobtemplates.plone packages when the template has improved.

Git

The template would be used by git clone <source.git> <dest-dir>.

Subversion

The template would be created by some svn copy <svn-url> <dest-url> command.

The dest-url could be constructed using the given dest-dir and a configured projects base url.
The commit message could be generated, e.g. as mr.bob: creating <dest-dir> and an information about the command used.

By default, the .../trunk of the source template would be copied (unless configured otherwise) to the trunk of the new package, and tags and branches would be created via svn mkdir <svn-url>... (it is possible to create more than one in one commit); the trunk would be used for the svn checkout ... <dest-dir>.

There would be several svn commits in the process; no problem, if you ask me.

When svn resources are copied this way, .svn folders in the copy are no problem anymore (#43).

Others

Once one is implemented, it shouldn't be difficult to add more.

Any SCM tool

Renamings would need to be done using the rename or mv command of the respective SCM tool; there are git mv and svn mv (which is an alias for svn move), for example.

mr.bob versions?

Hi - I'm getting a bit confused about the versions of mr.bob.

In pypi there are two modules: mr.bob and mr.bob2.
The mr.bob2 latest version is 0.2.3, but there is no changelog for that, and i cannot see any tags matching the 0.2.x line here in this git repo.

Is this repo the place where mr.bob development takes place? Where is the 0.2.x line?

Kind regards, and thank you for all the good work!
Sune

mr.bob truncates content/__init__.py

Hi,

we are using mr.bob in version 0.1.2 with Python 3.6 and Plone 5.2.1. Everytime we add a new content type like you can see in the following block the __init__.py file inside my.app/src/my/app/content/ gets truncated.

$ mrbob bobtemplates.plone:content_type
Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.
Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.
--> Please commit your changes, before using a sub-template! Continue anyway? [n/y] [n]: y
--> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: my_keyword
--> Content type description: A widget for keywords.
--> Use XML Model [y]: n
--> Dexterity base class (Container/Item) [Container]: 
--> Should the content type globally addable? [y]: n
--> Parent container portal_type name: my_frontpage
--> Should we filter content types to be added to this container? [n]: n
--> Create a content type class [y]: y
--> Activate default behaviors? [y]: y
>>> reading Plone version from bobtemplate.cfg
profile-plone.app.dexterity:default already in metadata.xml, skip adding!
Generated file structure at /home/user/plone/zeocluster/src/my.addon

Also the addon creates a XML schema inside the content folder even if the question about using a XML model was answered with no.

Conditional Questions

For many needs, asking questions or not depends on answers to previous questions. For example, in the Kotti addon template, code for a content type is written by default. But perhaps the content type questions could be marked with something like:

ask_if     [(package.include_content_type, True), ]

And there could be an ini section for directory and file entries that are similarly marked with:

[conditionals]
    +content_type.classname+.pt.bob     [(package.include_content_type, True), ]

If a directory or file is not listed in the [conditionals] section, it is written by default.

Support for Windows

On windows at least, trying to activate mrbob from an url fail with a I/O error 13, permission denied from urlretrieve in configurator.py / parse_template.

The reason is that urlretrieve expect to open in write mode the file name passed in and fail since tempfile.NamedTemporaryFile already did that.

it seems that (temp_file_name, heasers)= urlretrieve(url) is enough to get a tempfile with the downloaded content in it. (from http://docs.python.org/2/library/urllib.html)

Something like this seems to do the job

(temp_file_name, _ )= urlretrieve(url)
if not is_zipfile(temp_file_name):
    raise ConfigurationError("Not a zip file: %s" % temp_file_name)
zf = ZipFile(temp_file_name)
try:
   path = tempfile.mkdtemp()
   zf.extractall(path)
   return os.path.join(path, subpath), True
finally:
    zf.close()

unicode escape exception with windows paths

I received the following exception:

Traceback (most recent call last):
  File "c:\python27\scripts\mrbob-script.py", line 9, in <module>
    load_entry_point('mr.bob==0.1a7', 'console_scripts', 'mrbob')()
  File "c:\python27\lib\site-packages\mrbob\cli.py", line 173, in main
    c.render()
  File "c:\python27\lib\site-packages\mrbob\configurator.py", line 205, in render
    self.renderer)
  File "c:\python27\lib\site-packages\mrbob\rendering.py", line 58, in render_structure
    fs_source_root = six.u(fs_source_root)
  File "c:\python27\lib\site-packages\six.py", line 275, in u
    return unicode(s, "unicode_escape")
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 2-4: truncated \uXXXX escape

The problem is that my path is:

c:\users\rsyring\dev\projects\level12-src\lev12\mrbob\blazeweb

so the first "\u" is seen as a unicode escape. Fixed by adding repr();

def render_structure(fs_source_root, fs_target_root, variables, verbose, renderer):
    # ...
    if not isinstance(fs_source_root, six.text_type):  # pragma: no cover
        fs_source_root = six.u(repr(fs_source_root)) # <-- added repr() here

Registering templates with setuptools (entry_points) and pkg_resources

Hi,

Adding mr.bob specific entry points in template packages that registers templates would be helpful for auto discovery and documentation on installed templates.

In example:

mrbob --list-templates
flask: a bootstrap for a Flask application
package: a (possibliy namespaced) python package with nose and Sphinx support
buildout: a minimal zc.buildout based application
etc. etc.

This is easier for the end user than remembering (and googling for) which package has which template.

files created with mrbob do not have a newline character (pep8)

If you define a template file with the .bob suffix on its name it gets processed by mrbob, but somehow the file strips the last newline character.

It would be nice if it was kept (or even added unconditionally). This would make parsers like pep8 happier and so the users that run it :)

Case sensitive files in repo pose problem on Mac

My filesystem on Mac is case insensitive. So filename foo and FOO point to the same file, and they cannot coexist as two files.
So when I clone this repo, I get this:

$ git clone [email protected]:collective/mr.bob.git
Cloning into 'mr.bob'...
...
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'mrbob/tests/templates/encodingč/mapča/ća.bob'
  'mrbob/tests/templates/encodingč/mapča/ća.bob'

I don't even see a difference in file name. Actually, I don't see a difference on GitHub either, although I do see a slightly different history, with the first file being last changed in 73abeb9, and the last one in ecf4ad6:

@domenkozar and @jpcw You handled these files? Can you explain what is going on here? Would it be okay to remove these files? In that someone other than me should do it, because I probably cannot actually remove them.
No big deal, I guess.

Test directories with Unicode names break install on Windows

If I do pip install mr.bob with Python 3.4 on I get Unicode decoding errors. This appears to be somehow related to Unicode filename handling. I haven't worked out the details, but I can confirm that removing the directory encodingč from mrbob/tests/templates fixes the install problem.

I don't follow the tests well enough to propose a patch, but I would suggest that the test that uses a Unicode directory builds the test files in a temporary location during tests setup, rather than shipping them in the sdist. This would avoid the issue - I have used this approach in the past.

[Later] It's a distutils bug ultimately, the --record option writes filenames using the system codepage, which is CP1252 on my Windows box, and that doesn't include the filename characters used here.

Take name of package from -O parameter

I'd like to have an option to tell mr.bob that "whatever is passed as -O on the command-line should be the default value for the 'name' variable (or some other variable)".

Dependencies between templates

Goals:

  • Ability to use multiple templates at the same time and depend on them (similar to Templer structures, but uses templates as structures you can depend on)
  • Ability to have logic that decides what files get rendered

Implementation:

  • variables and defaults are passed to all templates and all questions are collected from the dependency templates
  • issue Configurator for each template given global settings
  • keep ordered Configurator.dependencies list of templates
  • provide include/exclude options for files
  • pre/post hooks for executing dependencies
  • document local commands can be used as simple as just commands inside a project
  • test for multi inheritance
  • specify [templates] section something like::
    [template]
    dependency.foobar.template = bobtemplates.foobar/
    dependency.foobar.destination = foobar/
    dependency.foobar.include = **
    dependency.foobar.pre_render_dependency = ....
    dependency.foobar.post_render_dependency = ....
    dependency.licenses.template = bobtemplates.licenses
    dependency.licenses.destination = .

Should variables specified in config provide defaults or answers?

@zupo suggested we should use variables to feed defaults, not answers.

This has important implication that user will be asked all questions and answer only those he doesn't like the default.

If user wishes to skip questions, --non-interactive will skip prompt and fail if a question is not answered.

mr.bob should not overwrite files by default, option can be added to force overwriting?

Hey Domen,

mr.bob can currently be very destructive as it overwrites files by default. This is particularly dangerous when the -O option is not specified.

Here are my suggestions for solutions to this problem:

  • Make the -O flag mandatory
  • Disable overwriting of files by default (mr.bob should stop as soon as it encounters a file that it will overwrite) and provide a --force option or similar to force overwriting

Cheers
Fotis

datetime_format error

[questions]
project.question = What year was the project started?
project.pre_ask_question = mrbob.hooks:set_current_datetime
project.datetime_format = %Y

results into:

configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%Y'

Provide recursive directory generation from dotted names

My source lives under a src/ folder which contains subdirectories each tied to the canonical dotted package name portion. This is like in java.

Example:

Package Name: mycompany.product.technology.component
File System: src/mycompany/product/technology/component/

I'd expect some magic like the +package.dottedname+

Proposal:

+functionname:param1,param2, paramN+

Example:

+split_on('.', package.dottedname)+

This would need a preprocessing phase for the template variables.To distinguish functions even more from plain variable substitutions you could use another prefix or an another like:

$split_on('.', package.dottedname)$
+%split_on('.', package.dottedname)%+
%split_on('.', package.dottedname)%

or mor lisp like with prefix notation:
+(split_on '.' package.dottedname)+
$(split_on '.' package.dottedname)$
%(split_on '.' package.dottedname)%

This would have to advantage of being easier to parse. The first parameter after the opening bracket is the function name and the rest are the parameters. Or you just use pythons evel to do the function evaluation without further parsing and supplying the variables and args.

This would need some basic functions supplied like the split_on and provide new or unknown ones in the hook.py from the package used.

Installing mr.bob as requirement raises UnicodeError

Hi,

I made a package named bobtemplates.gillux that (tries to) install mr.bob as requirement. But when pip installs mr.bob as requirement, it fails with a UnicodeError.

$ pip install bobtemplates.gillux
Downloading/unpacking bobtemplates.gillux
  Downloading bobtemplates.gillux-1.1.0.tar.gz
  Running setup.py (path:/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/build/bobtemplates.gillux/setup.py) egg_info for package bobtemplates.gillux
    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'extra_requires'
      warnings.warn(msg)

Requirement already satisfied (use --upgrade to upgrade): setuptools in ./lib/python2.7/site-packages (from bobtemplates.gillux)
Downloading/unpacking mr.bob (from bobtemplates.gillux)
  Downloading mr.bob-0.1.1.zip (43kB): 43kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/req.py", line 1197, in prepare_files
    do_download,
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/req.py", line 1375, in unpack_url
    self.session,
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/download.py", line 582, in unpack_http_url
    unpack_file(temp_location, location, content_type, link)
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/util.py", line 621, in unpack_file
    unzip_file(filename, location, flatten=not filename.endswith(('.pybundle', '.whl')))
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/lib/python2.7/site-packages/pip/util.py", line 499, in unzip_file
    fn = os.path.join(location, fn)
  File "/Users/glenfant/.virtualenvs/tmp-c6c81cbdcc2345de/bin/../lib/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 31: ordinal not in range(128)

Storing debug log for failure in /Users/glenfant/.pip/pip.log

Although my setup.py is "regular"
https://github.com/glenfant/bobtemplates.gillux/blob/master/setup.py#L35
When replacing in line 35 "mr.bob" by any other package ("unidecode", "lxml", anything, ...) it works, so I don't think this line is the source of the issue.

The only workaround is to :

pip install mr.bob
pip install bobtemplates.gillux

But I can't say at this stage if the source of that issue is in pip or mr.bob.

python32: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 273: ordinal not in range(128)

Running setup.py -q bdist_egg --dist-dir /tmp/nix-build-python-mrbob-0.1a9.drv-1/mr.bob-0.1a9/egg-dist-tmp-yf_99f
Traceback (most recent call last):
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/bin/.easy_install-wrapped", line 9, in
load_entry_point('setuptools==0.9.8', 'console_scripts', 'easy_install')()
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 1992, in main
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 1979, in with_ei_usage
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 1996, in
File "/nix/store/zi0cp1vpf3yhsdpghmcmmjbmhnridf3x-python-offline-distutils-3.2.5/lib/python3.2/site-packages/distutils/core.py", line 148, in setup
dist.run_commands()
File "/nix/store/zi0cp1vpf3yhsdpghmcmmjbmhnridf3x-python-offline-distutils-3.2.5/lib/python3.2/site-packages/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/nix/store/zi0cp1vpf3yhsdpghmcmmjbmhnridf3x-python-offline-distutils-3.2.5/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 380, in run
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 604, in easy_install
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 653, in install_item
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 849, in install_eggs
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 1130, in build_and_install
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/command/easy_install.py", line 1115, in run_setup
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/sandbox.py", line 69, in run_setup
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/sandbox.py", line 120, in run
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/sandbox.py", line 71, in
File "/nix/store/av8jkp5ncdwjhwvzf7lhvjdfjaddvxzf-python3.2m-setuptools-0.9.8/lib/python3.2/site-packages/setuptools-0.9.8-py3.2.egg/setuptools/compat.py", line 92, in execfile
File "setup.py", line 37, in
long_description=read('README.rst') + "\n" + read('HISTORY.rst'),
File "setup.py", line 31, in read
return open(os.path.join(os.path.dirname(file), *rnames)).read()
File "/nix/store/w06yrasm3v9f0rfi6k89fyhp71pympdd-python3-3.2.5/lib/python3.2/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 273: ordinal not in range(128)
note: keeping build directory /tmp/nix-build-python-mrbob-0.1a9.drv-1' builder for/nix/store/ghbbmhd71rax4fy4hxgvmvhpdszjn2dl-python-mrbob-0.1a9.drv' failed with exit code 1
error: build of `/nix/store/ghbbmhd71rax4fy4hxgvmvhpdszjn2dl-python-mrbob-0.1a9.drv' failed

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

When I execute mr.bob, it fails because my name is José

Traceback (most recent call last):
  File "/usr/local/bin/mrbob", line 9, in <module>
    load_entry_point('mr.bob==0.1.2', 'console_scripts', 'mrbob')()
  File "/Library/Python/2.7/site-packages/mrbob/cli.py", line 172, in main
    c.ask_questions()
  File "/Library/Python/2.7/site-packages/mrbob/configurator.py", line 231, in ask_questions
    self.variables[question.name] = question.ask(self)
  File "/Library/Python/2.7/site-packages/mrbob/configurator.py", line 303, in ask
    question = six.u("--> %s [%s]: ") % (self.question, self.default)

The code:

                # mrbob/configurator,py:301
                # prepare question
                if self.default:
                    question = six.u("--> %s [%s]: ") % (self.question, self.default)
                else:
                    question = six.u("--> %s: ") % self.question

The question is "Author's name" and the default is "José Dinuncio", which can't be converted to unicode, since six.u requires ASCII.

mrbob: option to suppress question text or disable questions

I am using the mrbob script directly to simply render a template, without any interactivity. (Previously I have used my own command line utility directly using render_structure but this seems redundant when mr.bob provides the mrbob script; perhaps it will be more maintainable or instructive if I reuse the existing command-line interface).

I get lots of output that I don't have any use for and would like to suppress, without having to swallow stdout entirely.

Sample:

> vim mrbob -O flup skeleton
Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.

Answer with a question mark to display help.
Value in square brackets at the end of the questions present default value if there is no answer.



Generated file structure at /home/sasha/code/shoring/flup

Although omitting the 'extra' output when there are no questions would be fine, I think it would be nicest to have a command line to suppress interactive prompts entirely (and bail with an error code if prompting would be required). e.g.: --no-prompts or whatever makes sense.

(Then, if people want a --quiet option which simply doesn't write to stdout, they can ask for that as a separate thing. I don't especially need that.)

Is it possible?

mr.bob is meant to replace previous tools such as paster (PasteScript) and templer.

Why? I.e. Why is it meant to replace those tools and what feature(s) does mr.bob provide that are not provided by PasteScript? You will be asked this question approximately FIVE MILLION TIMES, so I thought I'd save you the trouble of having to answer it over and over, by suggesting that you add an explanation to your README now. You're welcome. :-)

UnicodeEncodeError: 'charmap' codec can't encode character '\u030c' in position 50: character maps to <undefined>

hello,
I try to install mr.bob on Windows 10 with python 3.6.4 and 3.6.3 but it doen't work:

`pip3 install mr.bob
Collecting mr.bob
Using cached mr.bob-0.1.2.tar.gz
Requirement already satisfied: setuptools in c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages (from mr.bob)
Requirement already satisfied: six>=1.2.0 in c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages (from mr.bob)
Requirement already satisfied: Jinja2>=2.5.0 in c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages (from mr.bob)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages (from Jinja2>=2.5.0->mr.bob)
Installing collected packages: mr.bob
Running setup.py install for mr.bob ... error
Complete output from command c:\users\krl91\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\krl91\AppData\Local\Temp\pip-build-exg5brph\mr.bob\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\krl91\AppData\Local\Temp\pip-3wr9ewbx-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\mrbob
copying mrbob\bobexceptions.py -> build\lib\mrbob
copying mrbob\cli.py -> build\lib\mrbob
copying mrbob\configurator.py -> build\lib\mrbob
copying mrbob\hooks.py -> build\lib\mrbob
copying mrbob\parsing.py -> build\lib\mrbob
copying mrbob\rendering.py -> build\lib\mrbob
copying mrbob_init_.py -> build\lib\mrbob
creating build\lib\mrbob\tests
copying mrbob\tests\test_cli.py -> build\lib\mrbob\tests
copying mrbob\tests\test_configurator.py -> build\lib\mrbob\tests
copying mrbob\tests\test_hooks.py -> build\lib\mrbob\tests
copying mrbob\tests\test_parsing.py -> build\lib\mrbob\tests
copying mrbob\tests\test_rendering.py -> build\lib\mrbob\tests
copying mrbob\tests_init_.py -> build\lib\mrbob\tests
running egg_info
writing mr.bob.egg-info\PKG-INFO
writing dependency_links to mr.bob.egg-info\dependency_links.txt
writing entry points to mr.bob.egg-info\entry_points.txt
writing requirements to mr.bob.egg-info\requires.txt
writing top-level names to mr.bob.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'mr.bob.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mr.bob.egg-info\SOURCES.txt'
creating build\lib\mrbob\template_sample
copying mrbob\template_sample\.mrbob.ini -> build\lib\mrbob\template_sample
copying mrbob\template_sample\sample.txt.bob -> build\lib\mrbob\template_sample
creating build\lib\mrbob\template_starter
copying mrbob\template_starter\.mrbob.ini -> build\lib\mrbob\template_starter
copying mrbob\template_starter\sample.txt.bob -> build\lib\mrbob\template_starter
copying mrbob\tests\example.ini -> build\lib\mrbob\tests
copying mrbob\tests\example2.ini -> build\lib\mrbob\tests
copying mrbob\tests\example3.ini -> build\lib\mrbob\tests
copying mrbob\tests\example4.ini -> build\lib\mrbob\tests
copying mrbob\tests\example5.ini -> build\lib\mrbob\tests
copying mrbob\tests\example6.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored_dirs.ini -> build\lib\mrbob\tests
copying mrbob\tests\question_order.ini -> build\lib\mrbob\tests
copying mrbob\tests\unbound.ini -> build\lib\mrbob\tests
creating build\lib\mrbob\tests\templates
copying mrbob\tests\templates\strict_undefined.bob -> build\lib\mrbob\tests\templates
creating build\lib\mrbob\tests\templates\ask_hooks
copying mrbob\tests\templates\ask_hooks\.mrbob.ini -> build\lib\mrbob\tests\templates\ask_hooks
creating build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store\.DS_Store -> build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store\.mrbob.ini -> build\lib\mrbob\tests\templates\ds_store
creating build\lib\mrbob\tests\templates\empty
copying mrbob\tests\templates\empty\.mrbob.ini -> build\lib\mrbob\tests\templates\empty
creating build\lib\mrbob\tests\templates\empty2
copying mrbob\tests\templates\empty2\.mrbob.ini -> build\lib\mrbob\tests\templates\empty2
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\krl91\AppData\Local\Temp\pip-build-exg5brph\mr.bob\setup.py", line 79, in <module>
    zip_safe=False,
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\build_py.py", line 53, in run
    self.build_package_data()
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\build_py.py", line 121, in build_package_data
    self.mkpath(os.path.dirname(target))
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 338, in mkpath
    dir_util.mkpath(name, mode, dry_run=self.dry_run)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\dir_util.py", line 66, in mkpath
    log.info("creating %s", head)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\log.py", line 44, in info
    self._log(INFO, msg, args)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\distutils\log.py", line 34, in _log
    stream.write('%s\n' % msg)
  File "c:\users\krl91\appdata\local\programs\python\python36-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u030c' in position 50: character maps to <undefined>`

Failed building wheel for mr.bob

Hello,

Not sure what the error is, since I am pretty new to Python. I am getting the following error when installing mrbob (pip install mr.bob). I am using Windows 10, python 3.5.2, and pip 9.0.1.

Let me know if you need anything else or if this is a newbie issue. I was trying to install Flask-Diamond to walk through the tutorials originally when I got this error, then I just tried to install mr.bob from pip to see if that was issue and got the below error.

Thanks,

C:\Users\mrstu>pip install mr.bob
Collecting mr.bob
Using cached mr.bob-0.1.2.tar.gz
Requirement already satisfied: setuptools in c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages (from mr.bob)
Requirement already satisfied: six>=1.2.0 in c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages (from mr.bob)
Requirement already satisfied: Jinja2>=2.5.0 in c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages (from mr.bob)
Requirement already satisfied: MarkupSafe in c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages (from Jinja2>=2.5.0->mr.bob)
Building wheels for collected packages: mr.bob
Running setup.py bdist_wheel for mr.bob ... error
Complete output from command c:\users\mrstu\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\mrstu\AppData\Local\Temp\tmpxrxv5ebkpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\mrbob
copying mrbob\bobexceptions.py -> build\lib\mrbob
copying mrbob\cli.py -> build\lib\mrbob
copying mrbob\configurator.py -> build\lib\mrbob
copying mrbob\hooks.py -> build\lib\mrbob
copying mrbob\parsing.py -> build\lib\mrbob
copying mrbob\rendering.py -> build\lib\mrbob
copying mrbob_init_.py -> build\lib\mrbob
creating build\lib\mrbob\tests
copying mrbob\tests\test_cli.py -> build\lib\mrbob\tests
copying mrbob\tests\test_configurator.py -> build\lib\mrbob\tests
copying mrbob\tests\test_hooks.py -> build\lib\mrbob\tests
copying mrbob\tests\test_parsing.py -> build\lib\mrbob\tests
copying mrbob\tests\test_rendering.py -> build\lib\mrbob\tests
copying mrbob\tests_init_.py -> build\lib\mrbob\tests
running egg_info
writing top-level names to mr.bob.egg-info\top_level.txt
writing requirements to mr.bob.egg-info\requires.txt
writing entry points to mr.bob.egg-info\entry_points.txt
writing mr.bob.egg-info\PKG-INFO
writing dependency_links to mr.bob.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'mr.bob.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mr.bob.egg-info\SOURCES.txt'
creating build\lib\mrbob\template_sample
copying mrbob\template_sample.mrbob.ini -> build\lib\mrbob\template_sample
copying mrbob\template_sample\sample.txt.bob -> build\lib\mrbob\template_sample
creating build\lib\mrbob\template_starter
copying mrbob\template_starter.mrbob.ini -> build\lib\mrbob\template_starter
copying mrbob\template_starter\sample.txt.bob -> build\lib\mrbob\template_starter
copying mrbob\tests\example.ini -> build\lib\mrbob\tests
copying mrbob\tests\example2.ini -> build\lib\mrbob\tests
copying mrbob\tests\example3.ini -> build\lib\mrbob\tests
copying mrbob\tests\example4.ini -> build\lib\mrbob\tests
copying mrbob\tests\example5.ini -> build\lib\mrbob\tests
copying mrbob\tests\example6.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored_dirs.ini -> build\lib\mrbob\tests
copying mrbob\tests\question_order.ini -> build\lib\mrbob\tests
copying mrbob\tests\unbound.ini -> build\lib\mrbob\tests
creating build\lib\mrbob\tests\templates
copying mrbob\tests\templates\strict_undefined.bob -> build\lib\mrbob\tests\templates
creating build\lib\mrbob\tests\templates\ask_hooks
copying mrbob\tests\templates\ask_hooks.mrbob.ini -> build\lib\mrbob\tests\templates\ask_hooks
creating build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store.DS_Store -> build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store.mrbob.ini -> build\lib\mrbob\tests\templates\ds_store
creating build\lib\mrbob\tests\templates\empty
copying mrbob\tests\templates\empty.mrbob.ini -> build\lib\mrbob\tests\templates\empty
creating build\lib\mrbob\tests\templates\empty2
copying mrbob\tests\templates\empty2.mrbob.ini -> build\lib\mrbob\tests\templates\empty2
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\setup.py", line 79, in
zip_safe=False,
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\wheel\bdist_wheel.py", line 175, in run
self.run_command('build')
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\setuptools\command\build_py.py", line 52, in run
self.build_package_data()
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\setuptools\command\build_py.py", line 110, in build_package_data
self.mkpath(os.path.dirname(target))
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 339, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dir_util.py", line 66, in mkpath
log.info("creating %s", head)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\log.py", line 44, in info
self._log(INFO, msg, args)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\log.py", line 34, in _log
stream.write('%s\n' % msg)
File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u030c' in position 50: character maps to


Failed building wheel for mr.bob
Running setup.py clean for mr.bob
Failed to build mr.bob
Installing collected packages: mr.bob
Running setup.py install for mr.bob ... error
Complete output from command c:\users\mrstu\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\mrstu\AppData\Local\Temp\pip-qhncuzfq-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\mrbob
copying mrbob\bobexceptions.py -> build\lib\mrbob
copying mrbob\cli.py -> build\lib\mrbob
copying mrbob\configurator.py -> build\lib\mrbob
copying mrbob\hooks.py -> build\lib\mrbob
copying mrbob\parsing.py -> build\lib\mrbob
copying mrbob\rendering.py -> build\lib\mrbob
copying mrbob_init_.py -> build\lib\mrbob
creating build\lib\mrbob\tests
copying mrbob\tests\test_cli.py -> build\lib\mrbob\tests
copying mrbob\tests\test_configurator.py -> build\lib\mrbob\tests
copying mrbob\tests\test_hooks.py -> build\lib\mrbob\tests
copying mrbob\tests\test_parsing.py -> build\lib\mrbob\tests
copying mrbob\tests\test_rendering.py -> build\lib\mrbob\tests
copying mrbob\tests_init_.py -> build\lib\mrbob\tests
running egg_info
writing dependency_links to mr.bob.egg-info\dependency_links.txt
writing entry points to mr.bob.egg-info\entry_points.txt
writing requirements to mr.bob.egg-info\requires.txt
writing mr.bob.egg-info\PKG-INFO
writing top-level names to mr.bob.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'mr.bob.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mr.bob.egg-info\SOURCES.txt'
creating build\lib\mrbob\template_sample
copying mrbob\template_sample\.mrbob.ini -> build\lib\mrbob\template_sample
copying mrbob\template_sample\sample.txt.bob -> build\lib\mrbob\template_sample
creating build\lib\mrbob\template_starter
copying mrbob\template_starter\.mrbob.ini -> build\lib\mrbob\template_starter
copying mrbob\template_starter\sample.txt.bob -> build\lib\mrbob\template_starter
copying mrbob\tests\example.ini -> build\lib\mrbob\tests
copying mrbob\tests\example2.ini -> build\lib\mrbob\tests
copying mrbob\tests\example3.ini -> build\lib\mrbob\tests
copying mrbob\tests\example4.ini -> build\lib\mrbob\tests
copying mrbob\tests\example5.ini -> build\lib\mrbob\tests
copying mrbob\tests\example6.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored.ini -> build\lib\mrbob\tests
copying mrbob\tests\ignored_dirs.ini -> build\lib\mrbob\tests
copying mrbob\tests\question_order.ini -> build\lib\mrbob\tests
copying mrbob\tests\unbound.ini -> build\lib\mrbob\tests
creating build\lib\mrbob\tests\templates
copying mrbob\tests\templates\strict_undefined.bob -> build\lib\mrbob\tests\templates
creating build\lib\mrbob\tests\templates\ask_hooks
copying mrbob\tests\templates\ask_hooks\.mrbob.ini -> build\lib\mrbob\tests\templates\ask_hooks
creating build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store\.DS_Store -> build\lib\mrbob\tests\templates\ds_store
copying mrbob\tests\templates\ds_store\.mrbob.ini -> build\lib\mrbob\tests\templates\ds_store
creating build\lib\mrbob\tests\templates\empty
copying mrbob\tests\templates\empty\.mrbob.ini -> build\lib\mrbob\tests\templates\empty
creating build\lib\mrbob\tests\templates\empty2
copying mrbob\tests\templates\empty2\.mrbob.ini -> build\lib\mrbob\tests\templates\empty2
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\setup.py", line 79, in <module>
    zip_safe=False,
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\command\install.py", line 539, in run
    self.run_command('build')
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\setuptools\command\build_py.py", line 52, in run
    self.build_package_data()
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\site-packages\setuptools\command\build_py.py", line 110, in build_package_data
    self.mkpath(os.path.dirname(target))
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\cmd.py", line 339, in mkpath
    dir_util.mkpath(name, mode, dry_run=self.dry_run)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\dir_util.py", line 66, in mkpath
    log.info("creating %s", head)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\log.py", line 44, in info
    self._log(INFO, msg, args)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\distutils\log.py", line 34, in _log
    stream.write('%s\n' % msg)
  File "c:\users\mrstu\appdata\local\programs\python\python35-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u030c' in position 50: character maps to <undefined>

----------------------------------------

Command "c:\users\mrstu\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\mrstu\AppData\Local\Temp\pip-qhncuzfq-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\mrstu\AppData\Local\Temp\pip-build-0nmkyinp\mr.bob\

mrbobError.txt

mrbod fails: TypeError: expected str, bytes or os.PathLike object, not NoneType

When I try to setup a template using mrbob, mrbob crashes with (full traceback see below):

TypeError: expected str, bytes or os.PathLike object, not NoneType

How to reproduce (taken from https://training.plone.org/5/theming/theme-package.html)

virtualenv --python /usr/bin/python3.7 /tmp/mrbobvenv
cd /tmp/mrbobvenv
bin/pip install mr.bob bobtemplates.plone
bin/mrbob -O plonetheme.tango bobtemplates:plone_addon

Traceback:

Traceback (most recent call last):
  File "bin/mrbob", line 10, in <module>
    sys.exit(main())
  File "/tmp/mrbobvenv/lib/python3.7/site-packages/mrbob/cli.py", line 155, in main
    defaults=defaults)
  File "/tmp/mrbobvenv/lib/python3.7/site-packages/mrbob/configurator.py", line 138, in __init__
    self.template_dir, self.is_tempdir = parse_template(template)
  File "/tmp/mrbobvenv/lib/python3.7/site-packages/mrbob/configurator.py", line 92, in parse_template
    path = resolve_dotted_path(template_name)
  File "/tmp/mrbobvenv/lib/python3.7/site-packages/mrbob/configurator.py", line 40, in resolve_dotted_path
    return os.path.join(os.path.dirname(module.__file__), dir_name)
  File "/tmp/mrbobvenv/lib64/python3.7/posixpath.py", line 156, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Full flake8 compliance, are you interested?

Hello, just wanted to open up an issue on this to discuss the possibility of making all of mr.bob's code fully flake8 compliant (no exclusions).

Particularly the long lines were a bit unusual to work with when updating the code (having gotten used to the 79 character limit that PEP8 dictates).

I understand that everyone naturally has their own preferences about code style, but just thought I'd throw this out there for discussion.

I'm happy to put the work in to do this if you're interested 😄

Cheers
Fotis

Questions ordering (how to...)

Hi, and thanks again for this very valuable tool,

Could you please write in the doc how to order the questions ?

Many thanks by advance.

On windows the expression re.compile("\+[^+" + os.sep + "]+\+") does not compile

Because os.sep on window happens to be ... "" ...

variables_regex = re.compile("+[^+" + os.sep + "]++")

I am not really sure of what pattern you try to capture with regex at the moment, so I can't fix it in a general way (doing os.sep*2 when on windows is a ugly patch and I am not even sure it is what you wanted to do).

Is that regex about that:
Variables can also be used on folder and file names. Surround variables with plus signs. For example foo/+author+/+age+.bob given variables author being Foo and age being 12, foo/Foo/12 will be rendered.

recent pips won't install mr.bob without --pre flag

I ran across this one on my project so thought I'd mention it.

Recent versions of pip return the following error when attempting to install mr.bob:

$ pip install mr.bob
Downloading/unpacking mr.bob
  Could not find a version that satisfies the requirement mr.bob (from versions: 0.1a1, 0.1a2, 0.1a3, 0.1a4, 0.1a5, 0.1a6, 0.1a7, 0.1a8, 0.1a9)

The quick fix is to add the --pre (pre-release) flag on the command line:

$ pip install --pre mr.bob
Downloading/unpacking mr.bob
  Downloading mr.bob-0.1a9.zip
  Running setup.py egg_info for package mr.bob
  ...

Since version 1.4, pip ignores "pre-release" versions when looking for a package to install. http://www.pip-installer.org/en/latest/news.html#id2

This is handy if you also have a stable release in PyPI, but can be very confusing for users when there are only pre-release versions and the install just fails without explanation. Unfortunately pip doesn't suggest the --pre flag when it finds no stable versions.

On my project, I just removed the 'a9' suffix from my version string (was 'b1' in my case).

Rename "exceptions.py" (potential issues)

It will mask the regular Python "exceptions" module from everywhere in "mrbob".
file:///Users/glenfant/Documents/docpub/python/python-2.6.5-docs-html/library/exceptions.html#module-exceptions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.