ProjectDjango/Project.py

changeset 122
eb1311184f6f
parent 121
2346aa3fffcc
child 125
d280acf98fb5
equal deleted inserted replaced
121:2346aa3fffcc 122:eb1311184f6f
1727 title = self.tr("Start Django Project") 1727 title = self.tr("Start Django Project")
1728 1728
1729 # remove the project directory if it exists already 1729 # remove the project directory if it exists already
1730 ppath = os.path.join(path, projectName) 1730 ppath = os.path.join(path, projectName)
1731 if os.path.exists(ppath): 1731 if os.path.exists(ppath):
1732 okToRemove = E5MessageBox.yesNo(
1733 self.__ui,
1734 title,
1735 self.tr("""<p>The Django project path <b>{0}</b> exists"""
1736 """ already. Shall it be removed and recreated?"""
1737 """</p>""").format(ppath))
1738 if not okToRemove:
1739 E5MessageBox.information(
1740 self.__ui,
1741 title,
1742 self.tr("""<p>Please add the files to the eric project"""
1743 """ manually.</p>"""))
1744 return True
1745
1732 shutil.rmtree(ppath, ignore_errors=True) 1746 shutil.rmtree(ppath, ignore_errors=True)
1733 1747
1734 args = [] 1748 args = []
1735 if Utilities.isWindowsPlatform(): 1749 if Utilities.isWindowsPlatform():
1736 args.append(self.__getPythonExecutable()) 1750 args.append(self.__getPythonExecutable())
1743 E5MessageBox.critical( 1757 E5MessageBox.critical(
1744 self.__ui, 1758 self.__ui,
1745 title, 1759 title,
1746 self.tr("""<p>The <b>django-admin.py</b> script is""" 1760 self.tr("""<p>The <b>django-admin.py</b> script is"""
1747 """ not in the path. Aborting...</p>""")) 1761 """ not in the path. Aborting...</p>"""))
1748 return 1762 return False
1749 1763
1750 args.append("startproject") 1764 args.append("startproject")
1751 args.append(projectName) 1765 args.append(projectName)
1752 1766
1753 dia = DjangoDialog( 1767 dia = DjangoDialog(

eric ide

mercurial