Commits

darren.hoo  committed 384114f

ask user before creating new project

  • Participants
  • Parent commits 172c394

Comments (0)

Files changed (1)

File ropemode/interface.py

             root = self.env.ask_directory('Rope project root folder: ')
         if self.project is not None:
             self.close_project()
+        address = rope.base.project._realpath(os.path.join(root,
+                                                           '.ropeproject'))
+        if not os.path.exists(address):
+            if not self.env.y_or_n('Project not exists in %s, ' \
+                                   'create one?' % root):
+                self.env.message("Project creation aborted")
+                return
         progress = self.env.create_progress('Opening [%s] project' % root)
         self.project = rope.base.project.Project(root)
         if self.env.get('enable_autoimport'):