Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
scripts.databasebuilder.Build Class Reference

Public Member Functions

 __init__ (self, provider)
 
 format_exception (self, e)
 
 generate_from_idl (self, idl_file)
 

Public Attributes

 output_directory
 
 idl_compiler
 

Detailed Description

Definition at line 123 of file databasebuilder.py.

Constructor & Destructor Documentation

◆ __init__()

scripts.databasebuilder.Build.__init__ (   self,
  provider 
)

Definition at line 125 of file databasebuilder.py.

125 def __init__(self, provider):
126 # TODO(terry): Consider using the generator to do the work today we're
127 # driven by the databasebuilder. Blink compiler requires
128 # an output directory even though we don't use (yet). Might
129 # use the code generator portion of the new IDL compiler
130 # then we'd have a real output directory. Today we use the
131 # compiler to only create an AST.
132 self.output_directory = tempfile.mkdtemp()
133 attrib_file = os.path.join('Source',
134 idl_validator.EXTENDED_ATTRIBUTES_FILENAME)
135 # Create compiler.
136 self.idl_compiler = compiler.IdlCompilerDart(
137 self.output_directory,
138 attrib_file,
139 interfaces_info=provider._info_collector.interfaces_info,
140 only_if_changed=True)
141

Member Function Documentation

◆ format_exception()

scripts.databasebuilder.Build.format_exception (   self,
  e 
)

Definition at line 142 of file databasebuilder.py.

142 def format_exception(self, e):
143 exception_list = traceback.format_stack()
144 exception_list = exception_list[:-2]
145 exception_list.extend(traceback.format_tb(sys.exc_info()[2]))
146 exception_list.extend(
147 traceback.format_exception_only(sys.exc_info()[0],
148 sys.exc_info()[1]))
149
150 exception_str = "Traceback (most recent call last):\n"
151 exception_str += "".join(exception_list)
152 # Removing the last \n
153 exception_str = exception_str[:-1]
154
155 return exception_str
156

◆ generate_from_idl()

scripts.databasebuilder.Build.generate_from_idl (   self,
  idl_file 
)

Definition at line 157 of file databasebuilder.py.

157 def generate_from_idl(self, idl_file):
158 try:
159 idl_file_fullpath = os.path.realpath(idl_file)
160 self.idl_compiler.compile_file(idl_file_fullpath)
161 except Exception as err:
162 print('ERROR: idl_compiler.py: ' + os.path.basename(idl_file))
163 print(err)
164 print()
165 print('Stack Dump:')
166 print(self.format_exception(err))
167
168 return 1
169
170 return IDLFile(idl_ast, file_name)
171
172
void print(void *str)
Definition bridge.cpp:126

Member Data Documentation

◆ idl_compiler

scripts.databasebuilder.Build.idl_compiler

Definition at line 136 of file databasebuilder.py.

◆ output_directory

scripts.databasebuilder.Build.output_directory

Definition at line 132 of file databasebuilder.py.


The documentation for this class was generated from the following file: