"""
if name is None: name = id(utility_code)
if self.check_utility_code_needed_and_register(name):
+ if utility_code.requires:
+ for dependency in utility_code.requires:
+ self.use_utility_code(dependency)
if utility_code.proto:
self.utilprotowriter.put(utility_code.proto)
if utility_code.impl:
# a simple class that simplifies the usage of utility code
class UtilityCode(object):
- def __init__(self, proto=None, impl=None, init=None, cleanup=None):
+ def __init__(self, proto=None, impl=None, init=None, cleanup=None, requires=None):
self.proto = proto
self.impl = impl
self.init = init
self.cleanup = cleanup
+ self.requires = requires
def write_init_code(self, writer, pos):
if not self.init: