Mercurial > p > roundup > code
comparison roundup/dist/command/build_scripts.py @ 5381:0942fe89e82e
Python 3 preparation: change "x.has_key(y)" to "y in x".
(Also likewise "not in" where appropriate.) Tool-generated patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 22:08:17 +0000 |
| parents | 64c4e43fbb84 |
| children | 12baa5b9b597 |
comparison
equal
deleted
inserted
replaced
| 5380:64c4e43fbb84 | 5381:0942fe89e82e |
|---|---|
| 44 | 44 |
| 45 # find the target platform | 45 # find the target platform |
| 46 if self.target_platform: | 46 if self.target_platform: |
| 47 # TODO? allow explicit setting from command line | 47 # TODO? allow explicit setting from command line |
| 48 target = self.target_platform | 48 target = self.target_platform |
| 49 if cmdopt.has_key("bdist_wininst"): | 49 if "bdist_wininst" in cmdopt: |
| 50 target = "win32" | 50 target = "win32" |
| 51 elif cmdopt.get("bdist", {}).has_key("formats"): | 51 elif "formats" in cmdopt.get("bdist", {}): |
| 52 formats = cmdopt["bdist"]["formats"][1].split(",") | 52 formats = cmdopt["bdist"]["formats"][1].split(",") |
| 53 if formats[0] == "wininst": | 53 if formats[0] == "wininst": |
| 54 target = "win32" | 54 target = "win32" |
| 55 else: | 55 else: |
| 56 target = sys.platform | 56 target = sys.platform |
| 80 #self.scripts = list(self.scripts) + [script + ".bat" | 80 #self.scripts = list(self.scripts) + [script + ".bat" |
| 81 # for script in self.scripts] | 81 # for script in self.scripts] |
| 82 self.scripts = [script + ".bat" for script in self.scripts] | 82 self.scripts = [script + ".bat" for script in self.scripts] |
| 83 | 83 |
| 84 # tweak python path for installations outside main python library | 84 # tweak python path for installations outside main python library |
| 85 if cmdopt.get("install", {}).has_key("prefix"): | 85 if "prefix" in cmdopt.get("install", {}): |
| 86 prefix = os.path.expanduser(cmdopt['install']['prefix'][1]) | 86 prefix = os.path.expanduser(cmdopt['install']['prefix'][1]) |
| 87 version = '%d.%d'%sys.version_info[:2] | 87 version = '%d.%d'%sys.version_info[:2] |
| 88 self.script_preamble = """ | 88 self.script_preamble = """ |
| 89 import sys | 89 import sys |
| 90 sys.path.insert(1, "%s/lib/python%s/site-packages") | 90 sys.path.insert(1, "%s/lib/python%s/site-packages") |
