Commit 077e304a authored by vivek.vg@samsung.com's avatar vivek.vg@samsung.com

Temporary revert: Introduce include directive to make_private_script_source.py

Reason: As discussed with @haraken over IRC, we need to migrate to using chromium
resource, grd, system. In that we may need to think over how to use the include directive.

One of the harmony modules, [1], describes about using the 'import "module-name"' directive.
We could consider using that as well. As this needs some discussion, we decided to revert
this patch first and reconsider landing this once the formal decision is made about it.

R=haraken@chromium.org, yosin@chromium.org

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

Review URL: https://codereview.chromium.org/559493002

git-svn-id: svn://svn.chromium.org/blink/trunk@181640 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 20f51473
......@@ -14,8 +14,6 @@ import re
import sys
RE_INCLUDE = re.compile('<include[^>]+src=[\'"]([^>]*)[\'"]>')
# We assume that X.js has a corresponding X.idl in the same directory.
# If X is a partial interface, this method extracts the base name of the partial interface from X.idl.
# Otherwise, this method returns None.
......@@ -33,21 +31,6 @@ def extract_partial_interface_name(filename):
return match and match.group(1)
# Expand <include src="file_name"> directives
# FIXME: Expansion of include directive will be done by GRD resources building
# system in the future.
def process_input_file(filename):
result_text = ''
dirname = os.path.dirname(filename)
with open(filename) as input_file:
for line in input_file.readlines():
match = re.search(RE_INCLUDE, line)
if match:
result_text += process_input_file(os.path.join(dirname, match.group(1)))
else:
result_text += line
return result_text
def main():
output_filename = sys.argv[1]
input_filenames = sys.argv[2:]
......@@ -56,10 +39,11 @@ def main():
contents = []
for input_filename in input_filenames:
class_name, ext = os.path.splitext(os.path.basename(input_filename))
input_text = process_input_file(input_filename)
hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n\n' % (
class_name, ', '.join(hex_values)))
with open(input_filename) as input_file:
input_text = input_file.read()
hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n\n' % (
class_name, ', '.join(hex_values)))
contents.append('struct %s {' % source_name)
contents.append("""
const char* scriptClassName;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment