comparison mercurial/util.py @ 14926:4e7e63fc685a

util: eliminate wildcard imports
author Adrian Buehlmann <adrian@cadifra.com>
date Sat, 23 Jul 2011 12:29:52 +0200
parents ebdfdba0faaf
children 2aa3e07b2f07
comparison
equal deleted inserted replaced
14925:ab545a15d807 14926:4e7e63fc685a
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)
480 return _("filename ends with '%s', which is not allowed " 525 return _("filename ends with '%s', which is not allowed "
481 "on Windows") % t 526 "on Windows") % t
482 527
483 if os.name == 'nt': 528 if os.name == 'nt':
484 checkosfilename = checkwinfilename 529 checkosfilename = checkwinfilename
530 else:
531 checkosfilename = platform.checkosfilename
485 532
486 def makelock(info, pathname): 533 def makelock(info, pathname):
487 try: 534 try:
488 return os.symlink(info, pathname) 535 return os.symlink(info, pathname)
489 except OSError, why: 536 except OSError, why: