Refactoring util.py

Christian Ebert blacktrash at gmx.net
Fri Mar 27 07:12:04 CDT 2009


* Matt Mackall on Thursday, March 26, 2009 at 14:15:20 -0500
> I just pushed a big refactoring of util. We now have four files:
> 
> util.py: OS-independent utility functions, which imports:
> posix.py: POSIX implementations of some things
> windows.py: Windows implementations of some things, which imports:
>  win32.py: Windows implementations of some things using pywin32
> 
> As util is still pretty damn big and ugly, I'm planning to go further
> down this path. Candidates include:
> 
> - moving date functions into their own module
> - moving the remainder of the matching functions into match.py
> - moving the string encoding magic to i18n.py

With this "make build", "python setup.py --version",
"python setup.py clean -a" give tracebacks:

[...]
File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/demandimport.py", line 75, in __getattribute__
    self._load()
  File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/demandimport.py", line 47, in _load
    mod = _origimport(head, globals, locals)
  File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/util.py", line 1069, in <module>
    class atomictempfile(posixfile):
NameError: name 'posixfile' is not defined

Is it because demandimport cannot handle "import *"?

if os.name == 'nt':
    from windows import *
else:
    from posix import *


c
-- 
  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]
_F R E E_  _V I D E O S_  http://www.blacktrash.org/underdogma/
                          http://www.blacktrash.org/underdogma/index-en.html


More information about the Mercurial-devel mailing list