18 import errno, re, shutil, sys, tempfile, traceback |
18 import errno, re, shutil, sys, tempfile, traceback |
19 import os, time, calendar, textwrap, unicodedata, signal |
19 import os, time, calendar, textwrap, unicodedata, signal |
20 import imp, socket, urllib |
20 import imp, socket, urllib |
21 |
21 |
22 if os.name == 'nt': |
22 if os.name == 'nt': |
23 from windows import * |
23 import windows as platform |
24 else: |
24 else: |
25 from posix import * |
25 import posix as platform |
|
26 |
|
27 checkexec = platform.checkexec |
|
28 checklink = platform.checklink |
|
29 executablepath = platform.executablepath |
|
30 expandglobs = platform.expandglobs |
|
31 explainexit = platform.explainexit |
|
32 findexe = platform.findexe |
|
33 gethgcmd = platform.gethgcmd |
|
34 getuser = platform.getuser |
|
35 groupmembers = platform.groupmembers |
|
36 groupname = platform.groupname |
|
37 hidewindow = platform.hidewindow |
|
38 isexec = platform.isexec |
|
39 isowner = platform.isowner |
|
40 localpath = platform.localpath |
|
41 lookupreg = platform.lookupreg |
|
42 makedir = platform.makedir |
|
43 nlinks = platform.nlinks |
|
44 normpath = platform.normpath |
|
45 nulldev = platform.nulldev |
|
46 openhardlinks = platform.openhardlinks |
|
47 oslink = platform.oslink |
|
48 parsepatchoutput = platform.parsepatchoutput |
|
49 pconvert = platform.pconvert |
|
50 popen = platform.popen |
|
51 posixfile = platform.posixfile |
|
52 quotecommand = platform.quotecommand |
|
53 realpath = platform.realpath |
|
54 rename = platform.rename |
|
55 samedevice = platform.samedevice |
|
56 samefile = platform.samefile |
|
57 samestat = platform.samestat |
|
58 setbinary = platform.setbinary |
|
59 setflags = platform.setflags |
|
60 setsignalhandler = platform.setsignalhandler |
|
61 shellquote = platform.shellquote |
|
62 spawndetached = platform.spawndetached |
|
63 sshargs = platform.sshargs |
|
64 statfiles = platform.statfiles |
|
65 termwidth = platform.termwidth |
|
66 testpid = platform.testpid |
|
67 umask = platform.umask |
|
68 unlink = platform.unlink |
|
69 unlinkpath = platform.unlinkpath |
|
70 username = platform.username |
26 |
71 |
27 # Python compatibility |
72 # Python compatibility |
28 |
73 |
29 def sha1(s): |
74 def sha1(s): |
30 return _fastsha1(s) |
75 return _fastsha1(s) |