Classes | Functions | Variables
fabricate Namespace Reference

Classes

class  _after
 
class  _Groups
 
class  _running
 
class  _todo
 
class  AlwaysRunner
 
class  AtimesRunner
 
class  Builder
 
class  ExecutionError
 
class  MultiprocessingModule
 
class  PathError
 
class  PickleJson
 
class  Runner
 
class  RunnerUnsupportedException
 
class  SmartRunner
 
class  StraceProcess
 
class  StraceRunner
 

Functions

def printerr (message)
 
def args_to_list (args)
 
def shell (args, kwargs)
 
def _shell (args, input=None, silent=True, shell=False, ignore_status=False, kwargs)
 
def md5_hasher (filename)
 
def mtime_hasher (filename)
 
def _call_strace (self, args, kwargs)
 
def _results_handler (builder, delay=0.01)
 
def setup (builder=None, default=None, kwargs)
 
def _set_default_builder ()
 
def run (args, kwargs)
 
def after (args)
 
def autoclean ()
 
def memoize (command, kwargs)
 
def outofdate (command)
 
def parse_options (usage=_usage, extra_options=None, command_line=None)
 
def fabricate_version (min=None, max=None)
 
def main (globals_dict=None, build_dir=None, extra_options=None, builder=None, default=None, jobs=1, command_line=None, kwargs)
 

Variables

string __version__ = '1.29.3'
 
int deps_version = 2
 
 multiprocessing
 
int PY3 = 3
 
 string_types = str
 
 threading_condition = threading.Condition
 
list __all__
 
int FAT_atime_resolution = 24
 
int FAT_mtime_resolution = 2
 
float NTFS_atime_resolution = 0.0002048
 
float NTFS_mtime_resolution = 0.0002048
 
 md5func = hashlib.md5
 
 json
 
 _pool = None
 
 _groups = _Groups()
 
 _results = None
 
 _stop_results = threading.Event()
 
 default_builder = None
 
string default_command = 'build'
 
 _setup_builder = None
 
 _setup_default = None
 
dictionary _setup_kwargs = {}
 
 _parsed_options = None
 
string _usage = '[options] build script functions to run'
 
 parser
 
 options
 
 args
 
int status = 0
 

Detailed Description

Build tool that finds dependencies automatically for any language.

fabricate is a build tool that finds dependencies automatically for any
language. It's small and just works. No hidden stuff behind your back. It was
inspired by Bill McCloskey's make replacement, memoize, but fabricate works on
Windows as well as Linux.

Read more about how to use it and how it works on the project page:
https://github.com/SimonAlfie/fabricate/

Like memoize, fabricate is released under a "New BSD license". fabricate is
copyright (c) 2009 Brush Technology. Full text of the license is here:
https://github.com/SimonAlfie/fabricate/wiki/License

To get help on fabricate functions:
from fabricate import *
help(function)

Function Documentation

def fabricate._call_strace (   self,
  args,
  kwargs 
)
private
Top level function call for Strace that can be run in parallel 

Definition at line 499 of file fabricate.py.

499 def _call_strace(self, *args, **kwargs):
500  """ Top level function call for Strace that can be run in parallel """
501  return self(*args, **kwargs)
502 
def _call_strace(self, args, kwargs)
Definition: fabricate.py:499
def fabricate._results_handler (   builder,
  delay = 0.01 
)
private
Body of thread that stores results in .deps and handles 'after'
    conditions
   "builder" the builder used 

Definition at line 917 of file fabricate.py.

References printerr(), runNovaSAM.str, and sum.

917 def _results_handler( builder, delay=0.01):
918  """ Body of thread that stores results in .deps and handles 'after'
919  conditions
920  "builder" the builder used """
921  try:
922  while not _stop_results.isSet():
923  # go through the lists and check any results available
924  for id in _groups.ids():
925  if id is False: continue # key of False is _afters not _runnings
926  for r in _groups.item_list(id):
927  if r.results is None and r.async.ready():
928  try:
929  d, o = r.async.get()
930  except ExecutionError as e:
931  r.results = e
932  _groups.set_ok(id, False)
933  message, data, status = e
934  printerr("fabricate: " + message)
935  else:
936  builder.done(r.command, d, o) # save deps
937  r.results = (r.command, d, o)
938  _groups.dec_count(id)
939  # check if can now schedule things waiting on the after queue
940  for a in _groups.item_list(False):
941  still_to_do = sum(_groups.get_count(g) for g in a.afters)
942  no_error = all(_groups.get_ok(g) for g in a.afters)
943  if False in a.afters:
944  still_to_do -= 1 # don't count yourself of course
945  if still_to_do == 0:
946  if isinstance(a.do, _todo):
947  if no_error:
948  async = _pool.apply_async(_call_strace, a.do.arglist,
949  a.do.kwargs)
950  _groups.add_for_blocked(a.do.group, _running(async, a.do.command))
951  else:
952  # Mark the command as not done due to errors
953  r = _running(None, a.do.command)
954  _groups.add_for_blocked(a.do.group, r)
955  r.results = False
956  _groups.set_ok(a.do.group, False)
957  _groups.dec_count(a.do.group)
958  elif isinstance(a.do, threading_condition):
959  # is this only for threading_condition in after()?
960  a.do.acquire()
961  # only mark as done if there is no error
962  a.done = no_error
963  a.do.notify()
964  a.do.release()
965  # else: #are there other cases?
966  _groups.remove_item(False, a)
967  _groups.dec_count(False)
968 
969  _stop_results.wait(delay)
970  except Exception:
971  etype, eval, etb = sys.exc_info()
972  printerr("Error: exception " + repr(etype) + " at line " + str(etb.tb_lineno))
973  traceback.print_tb(etb)
974  finally:
975  if not _stop_results.isSet():
976  # oh dear, I am about to die for unexplained reasons, stop the whole
977  # app otherwise the main thread hangs waiting on non-existant me,
978  # Note: sys.exit() only kills me
979  printerr("Error: unexpected results handler exit")
980  os._exit(1)
981 
def _results_handler(builder, delay=0.01)
Definition: fabricate.py:917
def printerr(message)
Definition: fabricate.py:118
Double_t sum
Definition: plot.C:31
def fabricate._set_default_builder ( )
private
Set default builder to Builder() instance if it's not yet set. 

Definition at line 1399 of file fabricate.py.

Referenced by after(), autoclean(), memoize(), outofdate(), and run().

1400  """ Set default builder to Builder() instance if it's not yet set. """
1401  global default_builder
1402  if default_builder is None:
1403  default_builder = Builder()
1404 
def _set_default_builder()
Definition: fabricate.py:1399
def fabricate._shell (   args,
  input = None,
  silent = True,
  shell = False,
  ignore_status = False,
  kwargs 
)
private

Definition at line 176 of file fabricate.py.

References args_to_list().

Referenced by shell().

176 def _shell(args, input=None, silent=True, shell=False, ignore_status=False, **kwargs):
177  if input:
178  stdin = subprocess.PIPE
179  else:
180  stdin = None
181  if silent:
182  stdout = subprocess.PIPE
183  else:
184  stdout = None
185  arglist = args_to_list(args)
186  if not arglist:
187  raise TypeError('shell() takes at least 1 argument (0 given)')
188  if shell:
189  # handle subprocess.Popen quirk where subsequent args are passed
190  # to bash instead of to our command
191  command = subprocess.list2cmdline(arglist)
192  else:
193  command = arglist
194  try:
195  proc = subprocess.Popen(command, stdin=stdin, stdout=stdout,
196  stderr=subprocess.STDOUT, shell=shell, **kwargs)
197  except OSError as e:
198  # Work around the problem that Windows Popen doesn't say what file it couldn't find
199  if platform.system() == 'Windows' and e.errno == 2 and e.filename is None:
200  e.filename = arglist[0]
201  raise e
202  output, stderr = proc.communicate(input)
203  status = proc.wait()
204  if status and not ignore_status:
205  raise ExecutionError('%r exited with status %d'
206  % (os.path.basename(arglist[0]), status),
207  output, status)
208  if silent:
209  return output
210 
def _shell(args, input=None, silent=True, shell=False, ignore_status=False, kwargs)
Definition: fabricate.py:176
def args_to_list(args)
Definition: fabricate.py:129
def fabricate.after (   args)
wait until after the specified command groups complete and return
    results, or None if not parallel 

Definition at line 1416 of file fabricate.py.

References _set_default_builder().

Referenced by ana::CovMxSurface.CovMxSurface(), and main().

1416 def after(*args):
1417  """ wait until after the specified command groups complete and return
1418  results, or None if not parallel """
1420  if getattr(default_builder, 'parallel_ok', False):
1421  if len(args) == 0:
1422  args = _groups.ids() # wait on all
1423  cond = threading.Condition()
1424  cond.acquire()
1425  a = _after(args, cond)
1426  _groups.add(False, a)
1427  cond.wait()
1428  if not a.done:
1429  sys.exit(1)
1430  results = []
1431  ids = _groups.ids()
1432  for a in args:
1433  if a in ids and a is not False:
1434  r = []
1435  for i in _groups.item_list(a):
1436  r.append(i.results)
1437  results.append((a,r))
1438  return results
1439  else:
1440  return None
1441 
def after(args)
Definition: fabricate.py:1416
def _set_default_builder()
Definition: fabricate.py:1399
def fabricate.args_to_list (   args)
Return a flat list of the given arguments for shell(). 

Definition at line 129 of file fabricate.py.

Referenced by fabricate.Builder._run(), _shell(), and fabricate.Builder.memoize().

129 def args_to_list(args):
130  """ Return a flat list of the given arguments for shell(). """
131  arglist = []
132  for arg in args:
133  if arg is None:
134  continue
135  if isinstance(arg, (list, tuple)):
136  arglist.extend(args_to_list(arg))
137  else:
138  if not isinstance(arg, string_types):
139  arg = str(arg)
140  arglist.append(arg)
141  return arglist
142 
def args_to_list(args)
Definition: fabricate.py:129
def fabricate.autoclean ( )
Automatically delete all outputs of the default build. 

Definition at line 1442 of file fabricate.py.

References _set_default_builder().

Referenced by build_template.clean(), and build_test.clean().

1443  """ Automatically delete all outputs of the default build. """
1445  default_builder.autoclean()
1446 
def _set_default_builder()
Definition: fabricate.py:1399
def autoclean()
Definition: fabricate.py:1442
def fabricate.fabricate_version (   min = None,
  max = None 
)
If min is given, assert that the running fabricate is at least that
    version or exit with an error message. If max is given, assert that
    the running fabricate is at most that version. Return the current
    fabricate version string. This function was introduced in v1.14;
    for prior versions, the version string is available only as module
    local string fabricate.__version__ 

Definition at line 1495 of file fabricate.py.

References check_time_usage.float, and main().

1495 def fabricate_version(min=None, max=None):
1496  """ If min is given, assert that the running fabricate is at least that
1497  version or exit with an error message. If max is given, assert that
1498  the running fabricate is at most that version. Return the current
1499  fabricate version string. This function was introduced in v1.14;
1500  for prior versions, the version string is available only as module
1501  local string fabricate.__version__ """
1502 
1503  if min is not None and float(__version__) < min:
1504  sys.stderr.write(("fabricate is version %s. This build script "
1505  "requires at least version %.2f") % (__version__, min))
1506  sys.exit()
1507  if max is not None and float(__version__) > max:
1508  sys.stderr.write(("fabricate is version %s. This build script "
1509  "requires at most version %.2f") % (__version__, max))
1510  sys.exit()
1511  return __version__
1512 
def fabricate_version(min=None, max=None)
Definition: fabricate.py:1495
def fabricate.main (   globals_dict = None,
  build_dir = None,
  extra_options = None,
  builder = None,
  default = None,
  jobs = 1,
  command_line = None,
  kwargs 
)
Run the default function or the function(s) named in the command line
    arguments. Call this at the end of your build script. If one of the
    functions returns nonzero, main will exit with the last nonzero return
    value as its status code.

    "builder" is the class of builder to create, default (None) is the
    normal builder
    "command_line" is an optional list of command line arguments that can
    be used to prevent the default parsing of sys.argv. Used to intercept
    and modify the command line passed to the build script.
    "default" is the default user script function to call, None = 'build'
    "extra_options" is an optional list of options created with
    optparse.make_option(). The pseudo-global variable main.options
    is set to the parsed options list.
    "kwargs" is any other keyword arguments to pass to the builder 

Definition at line 1514 of file fabricate.py.

References after(), makeTrainCVSamples.int, parse_options(), print, printerr(), and split().

Referenced by fabricate_version().

1514  default=None, jobs=1, command_line=None, **kwargs):
1515  """ Run the default function or the function(s) named in the command line
1516  arguments. Call this at the end of your build script. If one of the
1517  functions returns nonzero, main will exit with the last nonzero return
1518  value as its status code.
1519 
1520  "builder" is the class of builder to create, default (None) is the
1521  normal builder
1522  "command_line" is an optional list of command line arguments that can
1523  be used to prevent the default parsing of sys.argv. Used to intercept
1524  and modify the command line passed to the build script.
1525  "default" is the default user script function to call, None = 'build'
1526  "extra_options" is an optional list of options created with
1527  optparse.make_option(). The pseudo-global variable main.options
1528  is set to the parsed options list.
1529  "kwargs" is any other keyword arguments to pass to the builder """
1530  global default_builder, default_command, _pool
1531 
1532  kwargs.update(_setup_kwargs)
1533  if _parsed_options is not None and command_line is None:
1534  parser, options, actions = _parsed_options
1535  else:
1536  parser, options, actions = parse_options(extra_options=extra_options, command_line=command_line)
1537  kwargs['quiet'] = options.quiet
1538  kwargs['debug'] = options.debug
1539  if options.time:
1540  kwargs['hasher'] = mtime_hasher
1541  if options.dir:
1542  kwargs['dirs'] = options.dir
1543  if options.keep:
1544  StraceRunner.keep_temps = options.keep
1545  main.options = options
1546  if options.jobs is not None:
1547  jobs = options.jobs
1548  if default is not None:
1549  default_command = default
1550  if default_command is None:
1551  default_command = _setup_default
1552  if not actions:
1553  actions = [default_command]
1554 
1555  original_path = os.getcwd()
1556  if None in [globals_dict, build_dir]:
1557  try:
1558  frame = sys._getframe(1)
1559  except:
1560  printerr("Your Python version doesn't support sys._getframe(1),")
1561  printerr("call main(globals(), build_dir) explicitly")
1562  sys.exit(1)
1563  if globals_dict is None:
1564  globals_dict = frame.f_globals
1565  if build_dir is None:
1566  build_file = frame.f_globals.get('__file__', None)
1567  if build_file:
1568  build_dir = os.path.dirname(build_file)
1569  if build_dir:
1570  if not options.quiet and os.path.abspath(build_dir) != original_path:
1571  print("Entering directory '%s'" % build_dir)
1572  os.chdir(build_dir)
1573  if _pool is None and jobs > 1:
1574  _pool = multiprocessing.Pool(jobs)
1575 
1576  use_builder = Builder
1577  if _setup_builder is not None:
1578  use_builder = _setup_builder
1579  if builder is not None:
1580  use_builder = builder
1581  default_builder = use_builder(**kwargs)
1582 
1583  if options.clean:
1584  default_builder.autoclean()
1585 
1586  status = 0
1587  try:
1588  for action in actions:
1589  if '(' not in action:
1590  action = action.strip() + '()'
1591  name = action.split('(')[0].split('.')[0]
1592  if name in globals_dict:
1593  this_status = eval(action, globals_dict)
1594  if this_status:
1595  status = int(this_status)
1596  else:
1597  printerr('%r command not defined!' % action)
1598  sys.exit(1)
1599  after() # wait till the build commands are finished
1600  except ExecutionError as exc:
1601  message, data, status = exc.args
1602  printerr('fabricate: ' + message)
1603  finally:
1604  _stop_results.set() # stop the results gatherer so I don't hang
1605  if not options.quiet and os.path.abspath(build_dir) != original_path:
1606  print("Leaving directory '%s' back to '%s'" % (build_dir, original_path))
1607  os.chdir(original_path)
1608  sys.exit(status)
1609 
void split(double tt, double *fr)
def after(args)
Definition: fabricate.py:1416
def printerr(message)
Definition: fabricate.py:118
def parse_options(usage=_usage, extra_options=None, command_line=None)
Definition: fabricate.py:1464
bool print
def fabricate.md5_hasher (   filename)
Return MD5 hash of given filename if it is a regular file or
    a symlink with a hashable target, or the MD5 hash of the
    target_filename if it is a symlink without a hashable target,
    or the MD5 hash of the filename if it is a directory, or None
    if file doesn't exist.

    Note: Pyhton versions before 3.2 do not support os.readlink on
    Windows so symlinks without a hashable target fall back to
    a hash of the filename if the symlink target is a directory,
    or None if the symlink is broken

Definition at line 211 of file fabricate.py.

References md5func, and open().

211 def md5_hasher(filename):
212  """ Return MD5 hash of given filename if it is a regular file or
213  a symlink with a hashable target, or the MD5 hash of the
214  target_filename if it is a symlink without a hashable target,
215  or the MD5 hash of the filename if it is a directory, or None
216  if file doesn't exist.
217 
218  Note: Pyhton versions before 3.2 do not support os.readlink on
219  Windows so symlinks without a hashable target fall back to
220  a hash of the filename if the symlink target is a directory,
221  or None if the symlink is broken"""
222  if not isinstance(filename, bytes):
223  filename = filename.encode('utf-8')
224  try:
225  f = open(filename, 'rb')
226  try:
227  return md5func(f.read()).hexdigest()
228  finally:
229  f.close()
230  except IOError:
231  if hasattr(os, 'readlink') and os.path.islink(filename):
232  return md5func(os.readlink(filename)).hexdigest()
233  elif os.path.isdir(filename):
234  return md5func(filename).hexdigest()
235  return None
236 
def md5_hasher(filename)
Definition: fabricate.py:211
procfile open("FD_BRL_v0.txt")
def fabricate.memoize (   command,
  kwargs 
)

Definition at line 1447 of file fabricate.py.

References _set_default_builder().

1447 def memoize(command, **kwargs):
1449  return default_builder.memoize(command, **kwargs)
1450 
1451 memoize.__doc__ = Builder.memoize.__doc__
1452 
def memoize(command, kwargs)
Definition: fabricate.py:1447
def _set_default_builder()
Definition: fabricate.py:1399
def fabricate.mtime_hasher (   filename)
Return modification time of file, or None if file doesn't exist. 

Definition at line 237 of file fabricate.py.

237 def mtime_hasher(filename):
238  """ Return modification time of file, or None if file doesn't exist. """
239  try:
240  st = os.stat(filename)
241  return repr(st.st_mtime)
242  except (IOError, OSError):
243  return None
244 
def mtime_hasher(filename)
Definition: fabricate.py:237
def fabricate.outofdate (   command)
Return True if given command is out of date and needs to be run. 

Definition at line 1453 of file fabricate.py.

References _set_default_builder().

1453 def outofdate(command):
1454  """ Return True if given command is out of date and needs to be run. """
1456  return default_builder.outofdate(command)
1457 
1458 # save options for use by main() if parse_options called earlier by user script
def outofdate(command)
Definition: fabricate.py:1453
def _set_default_builder()
Definition: fabricate.py:1399
def fabricate.parse_options (   usage = _usage,
  extra_options = None,
  command_line = None 
)
Parse command line options and return (parser, options, args). 

Definition at line 1464 of file fabricate.py.

Referenced by main().

1464 def parse_options(usage=_usage, extra_options=None, command_line=None):
1465  """ Parse command line options and return (parser, options, args). """
1466  parser = optparse.OptionParser(usage='Usage: %prog '+usage,
1467  version='%prog '+__version__)
1468  parser.disable_interspersed_args()
1469  parser.add_option('-t', '--time', action='store_true',
1470  help='use file modification times instead of MD5 sums')
1471  parser.add_option('-d', '--dir', action='append',
1472  help='add DIR to list of relevant directories')
1473  parser.add_option('-c', '--clean', action='store_true',
1474  help='autoclean build outputs before running')
1475  parser.add_option('-q', '--quiet', action='store_true',
1476  help="don't echo commands, only print errors")
1477  parser.add_option('-D', '--debug', action='store_true',
1478  help="show debug info (why commands are rebuilt)")
1479  parser.add_option('-k', '--keep', action='store_true',
1480  help='keep temporary strace output files')
1481  parser.add_option('-j', '--jobs', type='int',
1482  help='maximum number of parallel jobs')
1483  if extra_options:
1484  # add any user-specified options passed in via main()
1485  for option in extra_options:
1486  parser.add_option(option)
1487  if command_line is not None:
1488  options, args = parser.parse_args(command_line)
1489  else:
1490  options, args = parser.parse_args()
1491  global _parsed_options
1492  _parsed_options = (parser, options, args)
1493  return _parsed_options
1494 
def parse_options(usage=_usage, extra_options=None, command_line=None)
Definition: fabricate.py:1464
def fabricate.printerr (   message)
Print given message to stderr with a line feed. 

Definition at line 118 of file fabricate.py.

References print.

Referenced by fabricate.StraceRunner._match_line(), _results_handler(), main(), and fabricate.Builder.read_deps().

118 def printerr(message):
119  """ Print given message to stderr with a line feed. """
120  print(message, file=sys.stderr)
121 
def printerr(message)
Definition: fabricate.py:118
bool print
def fabricate.run (   args,
  kwargs 
)
Run the given command, but only if its dependencies have changed. Uses
    the default Builder. Return value as per Builder.run(). If there is
    only one positional argument which is an iterable treat each element
    as a command, returns a list of returns from Builder.run().

Definition at line 1405 of file fabricate.py.

References _set_default_builder().

1405 def run(*args, **kwargs):
1406  """ Run the given command, but only if its dependencies have changed. Uses
1407  the default Builder. Return value as per Builder.run(). If there is
1408  only one positional argument which is an iterable treat each element
1409  as a command, returns a list of returns from Builder.run().
1410  """
1412  if len(args) == 1 and isinstance(args[0], (list, tuple)):
1413  return [default_builder.run(*a, **kwargs) for a in args[0]]
1414  return default_builder.run(*args, **kwargs)
1415 
def _set_default_builder()
Definition: fabricate.py:1399
def run(args, kwargs)
Definition: fabricate.py:1405
def fabricate.setup (   builder = None,
  default = None,
  kwargs 
)
NOTE: setup functionality is now in main(), setup() is kept for
    backward compatibility and should not be used in new scripts.

    Setup the default Builder (or an instance of given builder if "builder"
    is not None) with the same keyword arguments as for Builder().
    "default" is the name of the default function to run when the build
    script is run with no command line arguments. 

Definition at line 1385 of file fabricate.py.

1385 def setup(builder=None, default=None, **kwargs):
1386  """ NOTE: setup functionality is now in main(), setup() is kept for
1387  backward compatibility and should not be used in new scripts.
1388 
1389  Setup the default Builder (or an instance of given builder if "builder"
1390  is not None) with the same keyword arguments as for Builder().
1391  "default" is the name of the default function to run when the build
1392  script is run with no command line arguments. """
1393  global _setup_builder, _setup_default, _setup_kwargs
1394  _setup_builder = builder
1395  _setup_default = default
1396  _setup_kwargs = kwargs
1397 setup.__doc__ += '\n\n' + Builder.__init__.__doc__
1398 
def setup(builder=None, default=None, kwargs)
Definition: fabricate.py:1385
def fabricate.shell (   args,
  kwargs 
)

Definition at line 143 of file fabricate.py.

References _shell().

Referenced by fabricate.AtimesRunner.__call__(), and fabricate.StraceRunner._do_strace().

143 def shell(*args, **kwargs):
144  r""" Run a command: program name is given in first arg and command line
145  arguments in the rest of the args. Iterables (lists and tuples) in args
146  are recursively converted to separate arguments, non-string types are
147  converted with str(arg), and None is ignored. For example:
148 
149  >>> def tail(input, n=3, flags=None):
150  >>> args = ['-n', n]
151  >>> return shell('tail', args, flags, input=input)
152  >>> tail('a\nb\nc\nd\ne\n')
153  'c\nd\ne\n'
154  >>> tail('a\nb\nc\nd\ne\n', 2, ['-v'])
155  '==> standard input <==\nd\ne\n'
156 
157  Keyword arguments kwargs are interpreted as follows:
158 
159  "input" is a string to pass standard input into the process (or the
160  default of None to use parent's stdin, eg: the keyboard)
161  "silent" is True (default) to return process's standard output as a
162  string, or False to print it as it comes out
163  "shell" set to True will run the command via the shell (/bin/sh or
164  COMSPEC) instead of running the command directly (the default)
165  "ignore_status" set to True means ignore command status code -- i.e.,
166  don't raise an ExecutionError on nonzero status code
167  Any other kwargs are passed directly to subprocess.Popen
168  Raises ExecutionError(message, output, status) if the command returns
169  a non-zero status code. """
170  try:
171  return _shell(args, **kwargs)
172  finally:
173  sys.stderr.flush()
174  sys.stdout.flush()
175 
def shell(args, kwargs)
Definition: fabricate.py:143
def _shell(args, input=None, silent=True, shell=False, ignore_status=False, kwargs)
Definition: fabricate.py:176

Variable Documentation

list fabricate.__all__
private
Initial value:
1 = ['setup', 'run', 'autoclean', 'main', 'shell', 'fabricate_version',
2  'memoize', 'outofdate', 'parse_options', 'after',
3  'ExecutionError', 'md5_hasher', 'mtime_hasher',
4  'Runner', 'AtimesRunner', 'StraceRunner', 'AlwaysRunner',
5  'SmartRunner', 'Builder']

Definition at line 67 of file fabricate.py.

string fabricate.__version__ = '1.29.3'
private

Definition at line 26 of file fabricate.py.

fabricate._groups = _Groups()
private

Definition at line 904 of file fabricate.py.

fabricate._parsed_options = None
private

Definition at line 1459 of file fabricate.py.

fabricate._pool = None
private

Definition at line 902 of file fabricate.py.

fabricate._results = None
private

Definition at line 906 of file fabricate.py.

fabricate._setup_builder = None
private

Definition at line 1381 of file fabricate.py.

fabricate._setup_default = None
private

Definition at line 1382 of file fabricate.py.

dictionary fabricate._setup_kwargs = {}
private

Definition at line 1383 of file fabricate.py.

fabricate._stop_results = threading.Event()
private

Definition at line 907 of file fabricate.py.

string fabricate._usage = '[options] build script functions to run'
private

Definition at line 1462 of file fabricate.py.

fabricate.args

Definition at line 1612 of file fabricate.py.

fabricate.default_builder = None

Definition at line 1377 of file fabricate.py.

string fabricate.default_command = 'build'

Definition at line 1378 of file fabricate.py.

int fabricate.deps_version = 2

Definition at line 29 of file fabricate.py.

int fabricate.FAT_atime_resolution = 24

Definition at line 79 of file fabricate.py.

int fabricate.FAT_mtime_resolution = 2

Definition at line 80 of file fabricate.py.

fabricate.json
fabricate.md5func = hashlib.md5

Definition at line 97 of file fabricate.py.

Referenced by md5_hasher().

fabricate.multiprocessing

Definition at line 51 of file fabricate.py.

float fabricate.NTFS_atime_resolution = 0.0002048

Definition at line 85 of file fabricate.py.

float fabricate.NTFS_mtime_resolution = 0.0002048

Definition at line 86 of file fabricate.py.

fabricate.options
fabricate.parser

Definition at line 1612 of file fabricate.py.

int fabricate.PY3 = 3

Definition at line 54 of file fabricate.py.

int fabricate.status = 0

Definition at line 1613 of file fabricate.py.

Referenced by dbutils::daqconfig::BNEVBRunConfig._fetchAllData(), dbutils::daqconfig::DCMConnectConfig._fetchAllData(), dbutils::daqconfig::DCMRunConfig._fetchAllData(), dbutils::daqconfig::DLRunConfig._fetchAllData(), dbutils::daqconfig::DCMHardwareConfig._fetchAllData(), dbutils::daqconfig::DCMHardwareConfig._fetchNamedConfigList(), dbutils::gui::ConfigDataTreeModel._populateSubTree(), dbutils::gui::ConfigDataTreeEditor.addChildRow(), dbutils::gui::ConfigDataTreeModel.addChildRow(), dbutils::gui::CustomTabWidget.addInitialRow(), dbutils::gui::TabbedSetOfTableEditors.addInitialRow(), dbutils::gui::TabbedSetOfTreeEditors.addInitialRow(), dbutils::gui::ConfigDataTableModel.addInitialRow(), dbutils::gui::ConfigDataTreeEditor.addRowAfter(), dbutils::gui::ConfigDataTableModel.addRowAfter(), dbutils::gui::ConfigDataTreeEditor.addRowBefore(), dbutils::dcs::APDSettings.APDSettings(), dbutils::daqconfig::BNEVBRunConfig.BNEVBRunConfig(), bsim.calcLocationWeights(), gov::fnal::cd::rms::provider::DPSingleton.connect_participant(), dbutils::daqconfig::DDTConnectConfig.DDTConnectConfig(), dbutils::gui::ConfigDataTableModel.deleteRow(), dbutils::daqconfig::DLRunConfig.DLRunConfig(), evd::GeometryDrawer.DrawBadBoxesPretty(), art::productstatus.dropped(), genie::FermiMover.Emit2ndNucleonFromSRC(), util.EnvExpansion(), gibuu::GiBUURegen.ExpandLibraryPath(), FindhAFate(), genie::flux::GAstroFlux.GenerateNext(), dbutils::gui::DCSConfigEditorDisplay.generateRecipeScripts(), novadaq::ProcessUtils.getChildProcessIds(), novadaq::ProcessUtils.getDescendantProcessIds(), gov::fnal::cd::rms::provider.getErrorName(), dbutils::dcs::APDSettings.getTemperature(), genie::KNOHadronization.HandleDecays(), tensorflow::TFHandler.Initialize(), dbutils::gui::ConfigDataTableModel.insertRows(), dbutils::gui::ConfigDataTreeModel.insertRows(), load_libs_from_command(), dbutils::gui::CustomTabWidget.loadData(), dbutils::gui::TabbedSetOfTableEditors.loadData(), dbutils::gui::TabbedSetOfTreeEditors.loadData(), fnex::FitAlg_ROOTFactoryFit.LoadFinalResults(), loadlibs(), genie::FermiMomentumTablePool.LoadTables(), dbutils::daqconfig::NamedConfigUtils.markConfigDone(), dbutils::daqconfig::NDMRunConfig.NDMRunConfig(), art::productstatus.neverCreated(), NewNearlinePlots(), genie::utils::fragmrec.NParticles(), dbutils::daqconfig::PixelEnableMasks.PixelEnableMasks(), dbutils::daqconfig::PixelThresholds.PixelThresholds(), tensorflow::TFHandler.Predict(), tensorflow::TensorflowHandler.Predict(), art::productstatus.present(), genie::TuneId.Print(), art::Path.process(), gov::fnal::cd::rms::provider::DDSTopicReaderClass< TT_ >.receiveMessage(), gov::fnal::cd::rms::provider::DDSConnection.receiveMessage(), dbutils::gui::ConfigDataTableModel.removeRows(), dbutils::gui::ConfigDataTreeModel.removeRows(), lem::LEMMixer.respondToOpenInputFile(), novadaq::BackgroundProcess.run(), dbutils::gui::CustomTabWidget.saveChanges(), dbutils::gui::TabbedSetOfTableEditors.saveChanges(), dbutils::gui::TabbedSetOfTreeEditors.saveChanges(), dbutils::gui::BasicEditorDisplay.saveChanges(), dbutils::gui::BasicEditorDisplay.saveChangesWithNewName(), set_eventn_status_track(), set_eventn_status_vertex(), art::ProductProvenance.setStatus(), gov::fnal::cd::rms::provider::DDSTopicReaderClass< TT_ >.statusConditionHandler(), novadaq::BackgroundProcess.stop(), nutools::dbi::Table.Tag(), nova::dbi::Table.Tag(), gov::fnal::cd::rms::provider::DDSTopicReaderClass< TT_ >.take_timed_wait(), art::productstatus.uninitialized(), art::productstatus.unknown(), genie::GMCJMonitor.Update(), wildcard(), ana.Wildcard(), novadaq::LocationUtils.wordExpansion(), gov::fnal::cd::rms::provider::DDSTopicWriterClass< TT_ >.write(), nutools::dbi::Table.Write(), nova::dbi::Table.Write(), genie::utils::app_init.XSecTable(), and dbutils::gui::BasicEditorDisplay.~BasicEditorDisplay().

fabricate.string_types = str

Definition at line 56 of file fabricate.py.

fabricate.threading_condition = threading.Condition

Definition at line 57 of file fabricate.py.