We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
scaffolds can be run more than once
```
env/bin/pcreate -s starter myproj
env/bin/pcreate -s alchemy myproj
cd myproj
../env/bin/python setup.py develop
# horrible errors because the dependencies required for the alchemy scaffold
# were not installed because the second pcreate did not overwrite the setup.py file
```

We need to either make the pcreate output more interactive and obvious that you are running a scaffold on top of another scaffold or prevent running pcreate on a directory that already exists.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pyramid/scripts/pcreate.py`
Content:
```
1 # (c) 2005 Ian Bicking and contributors; written for Paste
2 # (http://pythonpaste.org) Licensed under the MIT license:
3 # http://www.opensource.org/licenses/mit-license.php
4 
5 import optparse
6 import os
7 import os.path
8 import pkg_resources
9 import re
10 import sys
11 from pyramid.compat import input_
12 
13 _bad_chars_re = re.compile('[^a-zA-Z0-9_]')
14 
15 def main(argv=sys.argv, quiet=False):
16     command = PCreateCommand(argv, quiet)
17     try:
18         return command.run()
19     except KeyboardInterrupt: # pragma: no cover
20         return 1
21 
22 
23 class PCreateCommand(object):
24     verbosity = 1 # required
25     description = "Render Pyramid scaffolding to an output directory"
26     usage = "usage: %prog [options] -s <scaffold> output_directory"
27     parser = optparse.OptionParser(usage, description=description)
28     parser.add_option('-s', '--scaffold',
29                       dest='scaffold_name',
30                       action='append',
31                       help=("Add a scaffold to the create process "
32                             "(multiple -s args accepted)"))
33     parser.add_option('-t', '--template',
34                       dest='scaffold_name',
35                       action='append',
36                       help=('A backwards compatibility alias for '
37                             '-s/--scaffold.  Add a scaffold to the '
38                             'create process (multiple -t args accepted)'))
39     parser.add_option('-l', '--list',
40                       dest='list',
41                       action='store_true',
42                       help="List all available scaffold names")
43     parser.add_option('--list-templates',
44                       dest='list',
45                       action='store_true',
46                       help=("A backwards compatibility alias for -l/--list.  "
47                             "List all available scaffold names."))
48     parser.add_option('--simulate',
49                       dest='simulate',
50                       action='store_true',
51                       help='Simulate but do no work')
52     parser.add_option('--overwrite',
53                       dest='overwrite',
54                       action='store_true',
55                       help='Always overwrite')
56     parser.add_option('--interactive',
57                       dest='interactive',
58                       action='store_true',
59                       help='When a file would be overwritten, interrogate')
60     parser.add_option('--ignore-conflicting-name',
61                       dest='force_bad_name',
62                       action='store_true',
63                       default=False,
64                       help='Do create a project even if the chosen name '
65                            'is the name of an already existing / importable '
66                            'package.')
67 
68     pyramid_dist = pkg_resources.get_distribution("pyramid")
69 
70     def __init__(self, argv, quiet=False):
71         self.quiet = quiet
72         self.options, self.args = self.parser.parse_args(argv[1:])
73         self.scaffolds = self.all_scaffolds()
74 
75     def run(self):
76         if self.options.list:
77             return self.show_scaffolds()
78         if not self.options.scaffold_name and not self.args:
79             if not self.quiet: # pragma: no cover
80                 self.parser.print_help()
81                 self.out('')
82                 self.show_scaffolds()
83             return 2
84 
85         if not self.validate_input():
86             return 2
87 
88         return self.render_scaffolds()
89 
90     @property
91     def output_path(self):
92         return os.path.abspath(os.path.normpath(self.args[0]))
93 
94     @property
95     def project_vars(self):
96         output_dir = self.output_path
97         project_name = os.path.basename(os.path.split(output_dir)[1])
98         pkg_name = _bad_chars_re.sub(
99             '', project_name.lower().replace('-', '_'))
100         safe_name = pkg_resources.safe_name(project_name)
101         egg_name = pkg_resources.to_filename(safe_name)
102 
103         # get pyramid package version
104         pyramid_version = self.pyramid_dist.version
105 
106         ## map pyramid package version of the documentation branch ##
107         # if version ends with 'dev' then docs version is 'master'
108         if self.pyramid_dist.version[-3:] == 'dev':
109             pyramid_docs_branch = 'master'
110         else:
111             # if not version is not 'dev' find the version.major_version string
112             # and combine it with '-branch'
113             version_match = re.match(r'(\d+\.\d+)', self.pyramid_dist.version)
114             if version_match is not None:
115                 pyramid_docs_branch = "%s-branch" % version_match.group()
116             # if can not parse the version then default to 'latest'
117             else:
118                 pyramid_docs_branch = 'latest'
119 
120         return {
121             'project': project_name,
122             'package': pkg_name,
123             'egg': egg_name,
124             'pyramid_version': pyramid_version,
125             'pyramid_docs_branch': pyramid_docs_branch,
126         }
127 
128 
129     def render_scaffolds(self):
130         props = self.project_vars
131         output_dir = self.output_path
132         for scaffold_name in self.options.scaffold_name:
133             for scaffold in self.scaffolds:
134                 if scaffold.name == scaffold_name:
135                     scaffold.run(self, output_dir, props)
136         return 0
137 
138     def show_scaffolds(self):
139         scaffolds = sorted(self.scaffolds, key=lambda x: x.name)
140         if scaffolds:
141             max_name = max([len(t.name) for t in scaffolds])
142             self.out('Available scaffolds:')
143             for scaffold in scaffolds:
144                 self.out('  %s:%s  %s' % (
145                     scaffold.name,
146                     ' ' * (max_name - len(scaffold.name)), scaffold.summary))
147         else:
148             self.out('No scaffolds available')
149         return 0
150 
151     def all_scaffolds(self):
152         scaffolds = []
153         eps = list(pkg_resources.iter_entry_points('pyramid.scaffold'))
154         for entry in eps:
155             try:
156                 scaffold_class = entry.load()
157                 scaffold = scaffold_class(entry.name)
158                 scaffolds.append(scaffold)
159             except Exception as e: # pragma: no cover
160                 self.out('Warning: could not load entry point %s (%s: %s)' % (
161                     entry.name, e.__class__.__name__, e))
162         return scaffolds
163 
164     def out(self, msg): # pragma: no cover
165         if not self.quiet:
166             print(msg)
167 
168     def validate_input(self):
169         if not self.options.scaffold_name:
170             self.out('You must provide at least one scaffold name: -s <scaffold name>')
171             self.out('')
172             self.show_scaffolds()
173             return False
174         if not self.args:
175             self.out('You must provide a project name')
176             return False
177         available = [x.name for x in self.scaffolds]
178         diff = set(self.options.scaffold_name).difference(available)
179         if diff:
180             self.out('Unavailable scaffolds: %s' % ", ".join(sorted(diff)))
181             return False
182 
183         pkg_name = self.project_vars['package']
184 
185         if pkg_name == 'site' and not self.options.force_bad_name:
186             self.out('The package name "site" has a special meaning in '
187                      'Python. Are you sure you want to use it as your '
188                      'project\'s name?')
189             return self.confirm_bad_name('Really use "{0}"?: '.format(pkg_name))
190 
191         # check if pkg_name can be imported (i.e. already exists in current
192         # $PYTHON_PATH, if so - let the user confirm
193         pkg_exists = True
194         try:
195             __import__(pkg_name, globals(), locals(), [], 0) # use absolute imports
196         except ImportError as error:
197             pkg_exists = False
198         if not pkg_exists:
199             return True
200 
201         if self.options.force_bad_name:
202             return True
203         self.out('A package named "{0}" already exists, are you sure you want '
204                  'to use it as your project\'s name?'.format(pkg_name))
205         return self.confirm_bad_name('Really use "{0}"?: '.format(pkg_name))
206 
207     def confirm_bad_name(self, prompt): # pragma: no cover
208         answer = input_('{0} [y|N]: '.format(prompt))
209         return answer.strip().lower() == 'y'
210 
211 if __name__ == '__main__': # pragma: no cover
212     sys.exit(main() or 0)
213
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py
--- a/pyramid/scripts/pcreate.py
+++ b/pyramid/scripts/pcreate.py
@@ -56,7 +56,9 @@
     parser.add_option('--interactive',
                       dest='interactive',
                       action='store_true',
-                      help='When a file would be overwritten, interrogate')
+                      help='When a file would be overwritten, interrogate '
+                           '(this is the default, but you may specify it to '
+                           'override --overwrite)')
     parser.add_option('--ignore-conflicting-name',
                       dest='force_bad_name',
                       action='store_true',
@@ -70,6 +72,8 @@
     def __init__(self, argv, quiet=False):
         self.quiet = quiet
         self.options, self.args = self.parser.parse_args(argv[1:])
+        if not self.options.interactive and not self.options.overwrite:
+            self.options.interactive = True
         self.scaffolds = self.all_scaffolds()
 
     def run(self):

{"golden_diff": "diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py\n--- a/pyramid/scripts/pcreate.py\n+++ b/pyramid/scripts/pcreate.py\n@@ -56,7 +56,9 @@\n     parser.add_option('--interactive',\n                       dest='interactive',\n                       action='store_true',\n-                      help='When a file would be overwritten, interrogate')\n+                      help='When a file would be overwritten, interrogate '\n+                           '(this is the default, but you may specify it to '\n+                           'override --overwrite)')\n     parser.add_option('--ignore-conflicting-name',\n                       dest='force_bad_name',\n                       action='store_true',\n@@ -70,6 +72,8 @@\n     def __init__(self, argv, quiet=False):\n         self.quiet = quiet\n         self.options, self.args = self.parser.parse_args(argv[1:])\n+        if not self.options.interactive and not self.options.overwrite:\n+            self.options.interactive = True\n         self.scaffolds = self.all_scaffolds()\n \n     def run(self):\n", "issue": "scaffolds can be run more than once\n```\nenv/bin/pcreate -s starter myproj\nenv/bin/pcreate -s alchemy myproj\ncd myproj\n../env/bin/python setup.py develop\n# horrible errors because the dependencies required for the alchemy scaffold\n# were not installed because the second pcreate did not overwrite the setup.py file\n```\n\nWe need to either make the pcreate output more interactive and obvious that you are running a scaffold on top of another scaffold or prevent running pcreate on a directory that already exists.\n\n", "before_files": [{"content": "# (c) 2005 Ian Bicking and contributors; written for Paste\n# (http://pythonpaste.org) Licensed under the MIT license:\n# http://www.opensource.org/licenses/mit-license.php\n\nimport optparse\nimport os\nimport os.path\nimport pkg_resources\nimport re\nimport sys\nfrom pyramid.compat import input_\n\n_bad_chars_re = re.compile('[^a-zA-Z0-9_]')\n\ndef main(argv=sys.argv, quiet=False):\n    command = PCreateCommand(argv, quiet)\n    try:\n        return command.run()\n    except KeyboardInterrupt: # pragma: no cover\n        return 1\n\n\nclass PCreateCommand(object):\n    verbosity = 1 # required\n    description = \"Render Pyramid scaffolding to an output directory\"\n    usage = \"usage: %prog [options] -s <scaffold> output_directory\"\n    parser = optparse.OptionParser(usage, description=description)\n    parser.add_option('-s', '--scaffold',\n                      dest='scaffold_name',\n                      action='append',\n                      help=(\"Add a scaffold to the create process \"\n                            \"(multiple -s args accepted)\"))\n    parser.add_option('-t', '--template',\n                      dest='scaffold_name',\n                      action='append',\n                      help=('A backwards compatibility alias for '\n                            '-s/--scaffold.  Add a scaffold to the '\n                            'create process (multiple -t args accepted)'))\n    parser.add_option('-l', '--list',\n                      dest='list',\n                      action='store_true',\n                      help=\"List all available scaffold names\")\n    parser.add_option('--list-templates',\n                      dest='list',\n                      action='store_true',\n                      help=(\"A backwards compatibility alias for -l/--list.  \"\n                            \"List all available scaffold names.\"))\n    parser.add_option('--simulate',\n                      dest='simulate',\n                      action='store_true',\n                      help='Simulate but do no work')\n    parser.add_option('--overwrite',\n                      dest='overwrite',\n                      action='store_true',\n                      help='Always overwrite')\n    parser.add_option('--interactive',\n                      dest='interactive',\n                      action='store_true',\n                      help='When a file would be overwritten, interrogate')\n    parser.add_option('--ignore-conflicting-name',\n                      dest='force_bad_name',\n                      action='store_true',\n                      default=False,\n                      help='Do create a project even if the chosen name '\n                           'is the name of an already existing / importable '\n                           'package.')\n\n    pyramid_dist = pkg_resources.get_distribution(\"pyramid\")\n\n    def __init__(self, argv, quiet=False):\n        self.quiet = quiet\n        self.options, self.args = self.parser.parse_args(argv[1:])\n        self.scaffolds = self.all_scaffolds()\n\n    def run(self):\n        if self.options.list:\n            return self.show_scaffolds()\n        if not self.options.scaffold_name and not self.args:\n            if not self.quiet: # pragma: no cover\n                self.parser.print_help()\n                self.out('')\n                self.show_scaffolds()\n            return 2\n\n        if not self.validate_input():\n            return 2\n\n        return self.render_scaffolds()\n\n    @property\n    def output_path(self):\n        return os.path.abspath(os.path.normpath(self.args[0]))\n\n    @property\n    def project_vars(self):\n        output_dir = self.output_path\n        project_name = os.path.basename(os.path.split(output_dir)[1])\n        pkg_name = _bad_chars_re.sub(\n            '', project_name.lower().replace('-', '_'))\n        safe_name = pkg_resources.safe_name(project_name)\n        egg_name = pkg_resources.to_filename(safe_name)\n\n        # get pyramid package version\n        pyramid_version = self.pyramid_dist.version\n\n        ## map pyramid package version of the documentation branch ##\n        # if version ends with 'dev' then docs version is 'master'\n        if self.pyramid_dist.version[-3:] == 'dev':\n            pyramid_docs_branch = 'master'\n        else:\n            # if not version is not 'dev' find the version.major_version string\n            # and combine it with '-branch'\n            version_match = re.match(r'(\\d+\\.\\d+)', self.pyramid_dist.version)\n            if version_match is not None:\n                pyramid_docs_branch = \"%s-branch\" % version_match.group()\n            # if can not parse the version then default to 'latest'\n            else:\n                pyramid_docs_branch = 'latest'\n\n        return {\n            'project': project_name,\n            'package': pkg_name,\n            'egg': egg_name,\n            'pyramid_version': pyramid_version,\n            'pyramid_docs_branch': pyramid_docs_branch,\n        }\n\n\n    def render_scaffolds(self):\n        props = self.project_vars\n        output_dir = self.output_path\n        for scaffold_name in self.options.scaffold_name:\n            for scaffold in self.scaffolds:\n                if scaffold.name == scaffold_name:\n                    scaffold.run(self, output_dir, props)\n        return 0\n\n    def show_scaffolds(self):\n        scaffolds = sorted(self.scaffolds, key=lambda x: x.name)\n        if scaffolds:\n            max_name = max([len(t.name) for t in scaffolds])\n            self.out('Available scaffolds:')\n            for scaffold in scaffolds:\n                self.out('  %s:%s  %s' % (\n                    scaffold.name,\n                    ' ' * (max_name - len(scaffold.name)), scaffold.summary))\n        else:\n            self.out('No scaffolds available')\n        return 0\n\n    def all_scaffolds(self):\n        scaffolds = []\n        eps = list(pkg_resources.iter_entry_points('pyramid.scaffold'))\n        for entry in eps:\n            try:\n                scaffold_class = entry.load()\n                scaffold = scaffold_class(entry.name)\n                scaffolds.append(scaffold)\n            except Exception as e: # pragma: no cover\n                self.out('Warning: could not load entry point %s (%s: %s)' % (\n                    entry.name, e.__class__.__name__, e))\n        return scaffolds\n\n    def out(self, msg): # pragma: no cover\n        if not self.quiet:\n            print(msg)\n\n    def validate_input(self):\n        if not self.options.scaffold_name:\n            self.out('You must provide at least one scaffold name: -s <scaffold name>')\n            self.out('')\n            self.show_scaffolds()\n            return False\n        if not self.args:\n            self.out('You must provide a project name')\n            return False\n        available = [x.name for x in self.scaffolds]\n        diff = set(self.options.scaffold_name).difference(available)\n        if diff:\n            self.out('Unavailable scaffolds: %s' % \", \".join(sorted(diff)))\n            return False\n\n        pkg_name = self.project_vars['package']\n\n        if pkg_name == 'site' and not self.options.force_bad_name:\n            self.out('The package name \"site\" has a special meaning in '\n                     'Python. Are you sure you want to use it as your '\n                     'project\\'s name?')\n            return self.confirm_bad_name('Really use \"{0}\"?: '.format(pkg_name))\n\n        # check if pkg_name can be imported (i.e. already exists in current\n        # $PYTHON_PATH, if so - let the user confirm\n        pkg_exists = True\n        try:\n            __import__(pkg_name, globals(), locals(), [], 0) # use absolute imports\n        except ImportError as error:\n            pkg_exists = False\n        if not pkg_exists:\n            return True\n\n        if self.options.force_bad_name:\n            return True\n        self.out('A package named \"{0}\" already exists, are you sure you want '\n                 'to use it as your project\\'s name?'.format(pkg_name))\n        return self.confirm_bad_name('Really use \"{0}\"?: '.format(pkg_name))\n\n    def confirm_bad_name(self, prompt): # pragma: no cover\n        answer = input_('{0} [y|N]: '.format(prompt))\n        return answer.strip().lower() == 'y'\n\nif __name__ == '__main__': # pragma: no cover\n    sys.exit(main() or 0)\n", "path": "pyramid/scripts/pcreate.py"}], "after_files": [{"content": "# (c) 2005 Ian Bicking and contributors; written for Paste\n# (http://pythonpaste.org) Licensed under the MIT license:\n# http://www.opensource.org/licenses/mit-license.php\n\nimport optparse\nimport os\nimport os.path\nimport pkg_resources\nimport re\nimport sys\nfrom pyramid.compat import input_\n\n_bad_chars_re = re.compile('[^a-zA-Z0-9_]')\n\ndef main(argv=sys.argv, quiet=False):\n    command = PCreateCommand(argv, quiet)\n    try:\n        return command.run()\n    except KeyboardInterrupt: # pragma: no cover\n        return 1\n\n\nclass PCreateCommand(object):\n    verbosity = 1 # required\n    description = \"Render Pyramid scaffolding to an output directory\"\n    usage = \"usage: %prog [options] -s <scaffold> output_directory\"\n    parser = optparse.OptionParser(usage, description=description)\n    parser.add_option('-s', '--scaffold',\n                      dest='scaffold_name',\n                      action='append',\n                      help=(\"Add a scaffold to the create process \"\n                            \"(multiple -s args accepted)\"))\n    parser.add_option('-t', '--template',\n                      dest='scaffold_name',\n                      action='append',\n                      help=('A backwards compatibility alias for '\n                            '-s/--scaffold.  Add a scaffold to the '\n                            'create process (multiple -t args accepted)'))\n    parser.add_option('-l', '--list',\n                      dest='list',\n                      action='store_true',\n                      help=\"List all available scaffold names\")\n    parser.add_option('--list-templates',\n                      dest='list',\n                      action='store_true',\n                      help=(\"A backwards compatibility alias for -l/--list.  \"\n                            \"List all available scaffold names.\"))\n    parser.add_option('--simulate',\n                      dest='simulate',\n                      action='store_true',\n                      help='Simulate but do no work')\n    parser.add_option('--overwrite',\n                      dest='overwrite',\n                      action='store_true',\n                      help='Always overwrite')\n    parser.add_option('--interactive',\n                      dest='interactive',\n                      action='store_true',\n                      help='When a file would be overwritten, interrogate '\n                           '(this is the default, but you may specify it to '\n                           'override --overwrite)')\n    parser.add_option('--ignore-conflicting-name',\n                      dest='force_bad_name',\n                      action='store_true',\n                      default=False,\n                      help='Do create a project even if the chosen name '\n                           'is the name of an already existing / importable '\n                           'package.')\n\n    pyramid_dist = pkg_resources.get_distribution(\"pyramid\")\n\n    def __init__(self, argv, quiet=False):\n        self.quiet = quiet\n        self.options, self.args = self.parser.parse_args(argv[1:])\n        if not self.options.interactive and not self.options.overwrite:\n            self.options.interactive = True\n        self.scaffolds = self.all_scaffolds()\n\n    def run(self):\n        if self.options.list:\n            return self.show_scaffolds()\n        if not self.options.scaffold_name and not self.args:\n            if not self.quiet: # pragma: no cover\n                self.parser.print_help()\n                self.out('')\n                self.show_scaffolds()\n            return 2\n\n        if not self.validate_input():\n            return 2\n\n        return self.render_scaffolds()\n\n    @property\n    def output_path(self):\n        return os.path.abspath(os.path.normpath(self.args[0]))\n\n    @property\n    def project_vars(self):\n        output_dir = self.output_path\n        project_name = os.path.basename(os.path.split(output_dir)[1])\n        pkg_name = _bad_chars_re.sub(\n            '', project_name.lower().replace('-', '_'))\n        safe_name = pkg_resources.safe_name(project_name)\n        egg_name = pkg_resources.to_filename(safe_name)\n\n        # get pyramid package version\n        pyramid_version = self.pyramid_dist.version\n\n        ## map pyramid package version of the documentation branch ##\n        # if version ends with 'dev' then docs version is 'master'\n        if self.pyramid_dist.version[-3:] == 'dev':\n            pyramid_docs_branch = 'master'\n        else:\n            # if not version is not 'dev' find the version.major_version string\n            # and combine it with '-branch'\n            version_match = re.match(r'(\\d+\\.\\d+)', self.pyramid_dist.version)\n            if version_match is not None:\n                pyramid_docs_branch = \"%s-branch\" % version_match.group()\n            # if can not parse the version then default to 'latest'\n            else:\n                pyramid_docs_branch = 'latest'\n\n        return {\n            'project': project_name,\n            'package': pkg_name,\n            'egg': egg_name,\n            'pyramid_version': pyramid_version,\n            'pyramid_docs_branch': pyramid_docs_branch,\n        }\n\n\n    def render_scaffolds(self):\n        props = self.project_vars\n        output_dir = self.output_path\n        for scaffold_name in self.options.scaffold_name:\n            for scaffold in self.scaffolds:\n                if scaffold.name == scaffold_name:\n                    scaffold.run(self, output_dir, props)\n        return 0\n\n    def show_scaffolds(self):\n        scaffolds = sorted(self.scaffolds, key=lambda x: x.name)\n        if scaffolds:\n            max_name = max([len(t.name) for t in scaffolds])\n            self.out('Available scaffolds:')\n            for scaffold in scaffolds:\n                self.out('  %s:%s  %s' % (\n                    scaffold.name,\n                    ' ' * (max_name - len(scaffold.name)), scaffold.summary))\n        else:\n            self.out('No scaffolds available')\n        return 0\n\n    def all_scaffolds(self):\n        scaffolds = []\n        eps = list(pkg_resources.iter_entry_points('pyramid.scaffold'))\n        for entry in eps:\n            try:\n                scaffold_class = entry.load()\n                scaffold = scaffold_class(entry.name)\n                scaffolds.append(scaffold)\n            except Exception as e: # pragma: no cover\n                self.out('Warning: could not load entry point %s (%s: %s)' % (\n                    entry.name, e.__class__.__name__, e))\n        return scaffolds\n\n    def out(self, msg): # pragma: no cover\n        if not self.quiet:\n            print(msg)\n\n    def validate_input(self):\n        if not self.options.scaffold_name:\n            self.out('You must provide at least one scaffold name: -s <scaffold name>')\n            self.out('')\n            self.show_scaffolds()\n            return False\n        if not self.args:\n            self.out('You must provide a project name')\n            return False\n        available = [x.name for x in self.scaffolds]\n        diff = set(self.options.scaffold_name).difference(available)\n        if diff:\n            self.out('Unavailable scaffolds: %s' % \", \".join(sorted(diff)))\n            return False\n\n        pkg_name = self.project_vars['package']\n\n        if pkg_name == 'site' and not self.options.force_bad_name:\n            self.out('The package name \"site\" has a special meaning in '\n                     'Python. Are you sure you want to use it as your '\n                     'project\\'s name?')\n            return self.confirm_bad_name('Really use \"{0}\"?: '.format(pkg_name))\n\n        # check if pkg_name can be imported (i.e. already exists in current\n        # $PYTHON_PATH, if so - let the user confirm\n        pkg_exists = True\n        try:\n            __import__(pkg_name, globals(), locals(), [], 0) # use absolute imports\n        except ImportError as error:\n            pkg_exists = False\n        if not pkg_exists:\n            return True\n\n        if self.options.force_bad_name:\n            return True\n        self.out('A package named \"{0}\" already exists, are you sure you want '\n                 'to use it as your project\\'s name?'.format(pkg_name))\n        return self.confirm_bad_name('Really use \"{0}\"?: '.format(pkg_name))\n\n    def confirm_bad_name(self, prompt): # pragma: no cover\n        answer = input_('{0} [y|N]: '.format(prompt))\n        return answer.strip().lower() == 'y'\n\nif __name__ == '__main__': # pragma: no cover\n    sys.exit(main() or 0)\n", "path": "pyramid/scripts/pcreate.py"}]}