mirror of https://gitlab.com/ita1024/waf.git
Cleanup
This commit is contained in:
parent
c967d29e48
commit
43c7891fe5
|
@ -95,8 +95,8 @@ class store_context(type):
|
||||||
Context classes must provide an attribute 'cmd' representing the command name, and a function
|
Context classes must provide an attribute 'cmd' representing the command name, and a function
|
||||||
attribute 'fun' representing the function name that the command uses.
|
attribute 'fun' representing the function name that the command uses.
|
||||||
"""
|
"""
|
||||||
def __init__(cls, name, bases, dict):
|
def __init__(cls, name, bases, dct):
|
||||||
super(store_context, cls).__init__(name, bases, dict)
|
super(store_context, cls).__init__(name, bases, dct)
|
||||||
name = cls.__name__
|
name = cls.__name__
|
||||||
|
|
||||||
if name in ('ctx', 'Context'):
|
if name in ('ctx', 'Context'):
|
||||||
|
|
|
@ -17,6 +17,7 @@ class WafError(Exception):
|
||||||
:param ex: exception causing this error (optional)
|
:param ex: exception causing this error (optional)
|
||||||
:type ex: exception
|
:type ex: exception
|
||||||
"""
|
"""
|
||||||
|
Exception.__init__(self)
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
assert not isinstance(msg, Exception)
|
assert not isinstance(msg, Exception)
|
||||||
|
|
||||||
|
|
|
@ -85,8 +85,7 @@ def configure(conf):
|
||||||
v.MSVC_COMPILER = compiler
|
v.MSVC_COMPILER = compiler
|
||||||
try:
|
try:
|
||||||
v.MSVC_VERSION = float(version)
|
v.MSVC_VERSION = float(version)
|
||||||
except Exception:
|
except TypeError:
|
||||||
raise
|
|
||||||
v.MSVC_VERSION = float(version[:-3])
|
v.MSVC_VERSION = float(version[:-3])
|
||||||
|
|
||||||
conf.find_ifort_win32()
|
conf.find_ifort_win32()
|
||||||
|
|
|
@ -54,14 +54,16 @@ def bibunitscan(self):
|
||||||
for match in re_bibunit.finditer(code):
|
for match in re_bibunit.finditer(code):
|
||||||
path = match.group('file')
|
path = match.group('file')
|
||||||
if path:
|
if path:
|
||||||
|
found = None
|
||||||
for k in ('', '.bib'):
|
for k in ('', '.bib'):
|
||||||
# add another loop for the tex include paths?
|
# add another loop for the tex include paths?
|
||||||
Logs.debug('tex: trying %s%s', path, k)
|
Logs.debug('tex: trying %s%s', path, k)
|
||||||
fi = node.parent.find_resource(path + k)
|
fi = node.parent.find_resource(path + k)
|
||||||
if fi:
|
if fi:
|
||||||
|
found = True
|
||||||
nodes.append(fi)
|
nodes.append(fi)
|
||||||
# no break, people are crazy
|
# no break
|
||||||
else:
|
if not found:
|
||||||
Logs.debug('tex: could not find %s', path)
|
Logs.debug('tex: could not find %s', path)
|
||||||
|
|
||||||
Logs.debug('tex: found the following bibunit files: %s', nodes)
|
Logs.debug('tex: found the following bibunit files: %s', nodes)
|
||||||
|
|
|
@ -35,7 +35,7 @@ def get_data(blob_out):
|
||||||
pbData = blob_out.pbData
|
pbData = blob_out.pbData
|
||||||
buffer = c_buffer(cbData)
|
buffer = c_buffer(cbData)
|
||||||
memcpy(buffer, pbData, cbData)
|
memcpy(buffer, pbData, cbData)
|
||||||
LocalFree(pbData);
|
LocalFree(pbData)
|
||||||
return buffer.raw
|
return buffer.raw
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
|
|
|
@ -214,12 +214,9 @@ def can_retrieve_cache(self):
|
||||||
p = node.abspath()
|
p = node.abspath()
|
||||||
recv_file(conn, ssig, cnt, p)
|
recv_file(conn, ssig, cnt, p)
|
||||||
cnt += 1
|
cnt += 1
|
||||||
else:
|
|
||||||
Logs.debug('netcache: obtained %r from cache', self.outputs)
|
|
||||||
except MissingFile as e:
|
except MissingFile as e:
|
||||||
Logs.debug('netcache: file is not in the cache %r', e)
|
Logs.debug('netcache: file is not in the cache %r', e)
|
||||||
err = True
|
err = True
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Logs.debug('netcache: could not get the files %r', self.outputs)
|
Logs.debug('netcache: could not get the files %r', self.outputs)
|
||||||
if Logs.verbose > 1:
|
if Logs.verbose > 1:
|
||||||
|
@ -229,6 +226,9 @@ def can_retrieve_cache(self):
|
||||||
# broken connection? remove this one
|
# broken connection? remove this one
|
||||||
close_connection(conn)
|
close_connection(conn)
|
||||||
conn = None
|
conn = None
|
||||||
|
else:
|
||||||
|
Logs.debug('netcache: obtained %r from cache', self.outputs)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
release_connection(conn)
|
release_connection(conn)
|
||||||
if err:
|
if err:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
#
|
# encoding: utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from waflib import Task
|
from waflib import Task
|
||||||
|
|
|
@ -150,7 +150,7 @@ its value. However, attributes starting with an underscore _ are ignored
|
||||||
during that process and allows you to store arbitray values that are not supposed
|
during that process and allows you to store arbitray values that are not supposed
|
||||||
to be written out.
|
to be written out.
|
||||||
"""
|
"""
|
||||||
class XCodeNode:
|
class XCodeNode(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._id = newid()
|
self._id = newid()
|
||||||
self._been_written = False
|
self._been_written = False
|
||||||
|
|
Loading…
Reference in New Issue