Anonymous avatar Anonymous committed caef162

Added ability not to add .py extension to files that are copied, why is this the default behavious anyway?

Comments (0)

Files changed (1)


         self.template_vars = template_vars
         self.source_dir = source_dir
-    def copy_file(self, template, dest, filename=None):
+    def copy_file(self, template, dest, filename=None, add_py=True):
         Copy a file from the source location to somewhere in the
         base_package, cdir = self.find_dir(dest)
         self.template_vars['base_package'] = base_package
         content = self.load_content(base_package, cdir, filename, template)
-        dest = os.path.join(cdir, '' % filename)
+        if add_py:
+            # @@: Why is it a default to add a .py extension? 
+            filename = '' % filename
+        dest = os.path.join(cdir, filename)
         self.ensure_file(dest, content)
     def copy_dir(self, template_dir, dest, destname=None):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.