Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Pylons/pyramid
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Oct 13, 2011
2 parents d484fc1 + f57f64e commit c169055
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 12 deletions.
23 changes: 13 additions & 10 deletions pyramid/scaffolds/copydir.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

from pyramid.compat import (
input_,
native_
native_,
url_quote as compat_url_quote,
escape,
)

fsenc = sys.getfilesystemencoding()
Expand Down Expand Up @@ -79,7 +81,7 @@ def out(msg):
if verbosity >= 2:
reason = pad + reason % {'filename': full}
out(reason)
continue
continue # pragma: no cover
if sub_vars:
dest_full = os.path.join(dest, substitute_filename(name, vars))
sub_file = False
Expand Down Expand Up @@ -114,10 +116,10 @@ def out(msg):
content, vars, filename=full,
template_renderer=template_renderer
)
except SkipTemplate:
continue
if content is None:
continue
except SkipTemplate:
continue # pragma: no cover
if content is None:
continue # pragma: no cover
already_exists = os.path.exists(dest_full)
if already_exists:
f = open(dest_full, 'rb')
Expand All @@ -127,15 +129,15 @@ def out(msg):
if verbosity:
out('%s%s already exists (same content)' %
(pad, dest_full))
continue
continue # pragma: no cover
if interactive:
if not query_interactive(
native_(full, fsenc), native_(dest_full, fsenc),
native_(content, fsenc), native_(old_content, fsenc),
simulate=simulate, out_=out_):
continue
elif not overwrite:
continue
continue # pragma: no cover
if verbosity and use_pkg_resources:
out('%sCopying %s to %s' % (pad, full, dest_full))
elif verbosity:
Expand All @@ -160,6 +162,7 @@ def should_skip_file(name):
return 'Skipping backup file %(filename)s'
if name.endswith('.pyc') or name.endswith('.pyo'):
return 'Skipping %s file %(filename)s' % os.path.splitext(name)[1]
# return 'Skipping %s file ' % os.path.splitext(name)[1] + '%(filename)s'
if name.endswith('$py.class'):
return 'Skipping $py.class file %(filename)s'
if name in ('CVS', '_darcs'):
Expand Down Expand Up @@ -262,12 +265,12 @@ def substitute_content(content, vars, filename='<string>',
def html_quote(s):
if s is None:
return ''
return cgi.escape(str(s), 1)
return escape(str(s), 1)

def url_quote(s):
if s is None:
return ''
return urllib.quote(str(s))
return compat_url_quote(str(s))

def test(conf, true_cond, false_cond=None):
if conf:
Expand Down
Empty file.
Empty file.
Loading

0 comments on commit c169055

Please sign in to comment.