Changeset 3306
- Timestamp:
- 07/18/07 17:41:59 (1 year ago)
- Files:
-
- website/newdocs/download/tgsetup.py (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
website/newdocs/download/tgsetup.py
r2996 r3306 4 4 from distutils import log 5 5 6 TGVERSION = "1.0. 2.2"6 TGVERSION = "1.0.3" 7 7 TGDOWNLOAD = "http://www.turbogears.org/download/" 8 8 … … 23 23 """ 24 24 import sys 25 DEFAULT_VERSION = "0.6c 5"25 DEFAULT_VERSION = "0.6c6" 26 26 DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] 27 27 … … 48 48 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', 49 49 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', 50 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', 51 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', 52 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', 50 53 } 51 54 … … 53 56 54 57 # TGBEGIN 58 win32 = """ 59 The recommended Python for TurboGears is Python 2.5.1. You can download 60 it here: 61 62 http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi 63 """ 64 65 darwin = """ 66 The recommended Python for TurboGears is Python 2.5.1. You can download 67 a Universal build here: 68 69 http://www.python.org/ftp/python/2.5.1/python-2.5.1-macosx.dmg 70 """ 71 72 other = """ 73 The recommended Python for TurboGears is Python 2.5.1. This version of 74 Python is often available in your operating system's native package 75 format (via apt-get or yum, for instance). You can also easily build 76 Python from source on Unix-like systems. Here is the source download 77 link for Python: 78 79 http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tar.bz2 80 """ 55 81 56 82 def get_python(): … … 59 85 it may actually download Python if you want it to (in which case, it 60 86 would return True).""" 87 61 88 if sys.platform == "darwin": 62 print """ 63 The recommended Python for TurboGears is Python 2.4.4. You can download 64 a Universal build here: 65 66 http://www.python.org/download/releases/2.4.4/ 67 """ 89 print darwin 90 68 91 elif sys.platform == "win32": 69 print """ 70 The recommended Python for TurboGears is Python 2.4.4. You can download 71 it here: 72 73 http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi 74 """ 92 print win32 93 75 94 else: 76 print """ 77 The recommended Python for TurboGears is Python 2.4.4. This version of 78 Python is often available in your operating system's native package 79 format (via apt-get or yum, for instance). You can also easily build 80 Python from source on Unix-like systems. Here is the source download 81 link for Python: 82 83 http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tgz 84 """ 95 print other 96 85 97 return False 86 98 … … 100 112 def check_python(): 101 113 if sys.version_info < (2,3): 102 print """ 103 Python 2.3 or higher is required to run TurboGears. 104 """ 114 print "Python 2.3 or higher is required to run TurboGears." 115 105 116 if not get_python(): 106 117 sys.exit(1) 107 elif sys.version_info > (2,5): 118 119 elif sys.version_info < (2,4): 120 print "TurboGears supports Python 2.3, but 2.4 is strongly recommended." 121 108 122 if not get_python(): 109 print """Would you like to continue with a Python 2.5 install?yes/no[y]""" 110 c = get_yesno(default="y") 111 if c == "n": 112 print """You can rerun the installer later.""" 113 sys.exit(1) 114 elif sys.version_info < (2,4): 115 print """ 116 TurboGears supports Python 2.3, but 2.4 is strongly recommended. 117 """ 118 if not get_python(): 119 print """Would you like to continue with a Python 2.3 install?yes/no[n]""" 123 print "Would you like to continue with a Python 2.3 install?yes/no[n]" 120 124 c = get_yesno(default="n") 121 125 if c == "n": 122 print " ""You can rerun the installer once you have an updated Python."""126 print "You can rerun the installer once you have an updated Python." 123 127 sys.exit(1) 124 128 … … 126 130 """Ensures that the current directory does not contain a TurboGears 127 131 directory that setuptools will attempt to install from.""" 132 128 133 if os.path.exists("turbogears") or os.path.exists("TurboGears"): 129 134 print """There is a 'turbogears' directory in the current directory. 130 135 EasyInstall will normally try to install from this directory rather 131 136 than picking up the installation package from the net.""" 137 132 138 if os.access("..", os.W_OK) and not \ 133 139 os.path.exists(os.path.join("..", "turbogears")) and not \ … … 137 143 package to do its work. The parent directory of this one is writeable. 138 144 Should the installation proceed from there ('n' to exit)?""" 145 139 146 upone = get_yesno() 140 147 if upone == "n": 141 148 sys.exit(1) 142 149 os.chdir("..") 150 143 151 else: 144 152 print """ … … 156 164 print "Beginning setuptools/EasyInstall installation and TurboGears " \ 157 165 "download\n" 166 158 167 if len(sys.argv) > 1: 159 168 args = sys.argv[1:] 169 160 170 else: 161 171 args = [] 172 162 173 main(args) 174 163 175 if post_install_msgs: 164 176 print """ … … 173 185 try: 174 186 from setuptools.command import easy_install as eimodule 187 175 188 except ImportError: 176 189 import easy_install as eimodule … … 210 223 you install. To do that on Windows: 211 224 212 Go to System Properties -> Advanced -> Environment Variables and add or edit the PATH variable to have ;C:\Python2 4;C:\Python24\Scripts, assuming you installed Python to the default location.""")225 Go to System Properties -> Advanced -> Environment Variables and add or edit the PATH variable to have ;C:\Python25;C:\Python25\Scripts, assuming you installed Python to the default location.""") 213 226 214 227 if self.find_links is None: … … 327 340 try: 328 341 import setuptools 342 329 343 except ImportError: 330 344 egg = None … … 345 359 use_setuptools(version) 346 360 347 req = "setuptools>=" +version361 req = "setuptools>=" + version 348 362 import pkg_resources 349 363 try: 350 364 pkg_resources.require(req) 365 351 366 except pkg_resources.VersionConflict: 352 367 try: … … 399 414 400 415 if __name__=='__main__': 401 if len(sys.argv) >2 and sys.argv[1]=='--md5update':416 if len(sys.argv) > 2 and sys.argv[1] == '--md5update': 402 417 update_md5(sys.argv[2:]) 418 403 419 else: 404 420 tg_main()