206 import OpenSSL |
206 import OpenSSL |
207 OpenSSL.SSL.Context |
207 OpenSSL.SSL.Context |
208 return True |
208 return True |
209 except ImportError: |
209 except ImportError: |
210 return False |
210 return False |
|
211 |
|
212 def has_windows(): |
|
213 return os.name == 'nt' |
|
214 |
|
215 def has_system_sh(): |
|
216 return os.name != 'nt' |
|
217 |
|
218 def has_serve(): |
|
219 return os.name != 'nt' # gross approximation |
211 |
220 |
212 checks = { |
221 checks = { |
213 "baz": (has_baz, "GNU Arch baz client"), |
222 "baz": (has_baz, "GNU Arch baz client"), |
214 "bzr": (has_bzr, "Canonical's Bazaar client"), |
223 "bzr": (has_bzr, "Canonical's Bazaar client"), |
215 "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"), |
224 "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"), |
229 "mtn": (has_mtn, "monotone client (>= 1.0)"), |
238 "mtn": (has_mtn, "monotone client (>= 1.0)"), |
230 "outer-repo": (has_outer_repo, "outer repo"), |
239 "outer-repo": (has_outer_repo, "outer repo"), |
231 "p4": (has_p4, "Perforce server and client"), |
240 "p4": (has_p4, "Perforce server and client"), |
232 "pyflakes": (has_pyflakes, "Pyflakes python linter"), |
241 "pyflakes": (has_pyflakes, "Pyflakes python linter"), |
233 "pygments": (has_pygments, "Pygments source highlighting library"), |
242 "pygments": (has_pygments, "Pygments source highlighting library"), |
|
243 "serve": (has_serve, "platform and python can manage 'hg serve -d'"), |
234 "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), |
244 "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), |
235 "svn": (has_svn, "subversion client and admin tools"), |
245 "svn": (has_svn, "subversion client and admin tools"), |
236 "svn13": (has_svn13, "subversion client and admin tools >= 1.3"), |
246 "svn13": (has_svn13, "subversion client and admin tools >= 1.3"), |
237 "svn15": (has_svn15, "subversion client and admin tools >= 1.5"), |
247 "svn15": (has_svn15, "subversion client and admin tools >= 1.5"), |
238 "svn-bindings": (has_svn_bindings, "subversion python bindings"), |
248 "svn-bindings": (has_svn_bindings, "subversion python bindings"), |
239 "symlink": (has_symlink, "symbolic links"), |
249 "symlink": (has_symlink, "symbolic links"), |
|
250 "system-sh": (has_system_sh, "system() uses sh"), |
240 "tla": (has_tla, "GNU Arch tla client"), |
251 "tla": (has_tla, "GNU Arch tla client"), |
241 "unix-permissions": (has_unix_permissions, "unix-style permissions"), |
252 "unix-permissions": (has_unix_permissions, "unix-style permissions"), |
|
253 "windows": (has_windows, "Windows"), |
242 } |
254 } |
243 |
255 |
244 def list_features(): |
256 def list_features(): |
245 for name, feature in checks.iteritems(): |
257 for name, feature in checks.iteritems(): |
246 desc = feature[1] |
258 desc = feature[1] |