def add_project(self):
        @dont_close_windows_when_empty
        def close_all_files():
            self.window.run_command("close_all")

        def add_callback(project):
            pd = self.window.project_data()
            f = os.path.join(self.primary_dir, "%s.sublime-project" % project)
            if pd:
                JsonFile(f).save(pd)
            else:
                JsonFile(f).save({})
            JsonFile(f.replace(".sublime-project", ".sublime-workspace")).save({})
            self.close_project_by_window(self.window)
            self.window.run_command("close_project")
            close_all_files()

            # reload projects info
            self.__init__(self.window)
            self.switch_project(project)

        def show_input_panel():
            project = "New Project"
            pd = self.window.project_data()
            pf = self.window.project_file_name()
            try:
                path = pd["folders"][0]["path"]
                if pf:
                    project = os.path.basename(expand_folder(path, pf))
                else:
                    project = os.path.basename(path)
            except:
                pass

            v = self.window.show_input_panel("Project name:", project, add_callback, None, None)
            v.run_command("select_all")

        sublime.set_timeout(show_input_panel, 100)
dataset/ETHPy150Open randy3k/Project-Manager/pm.py/Manager.add_project/original