meta_join.py revision a2ee31ac80ff4531d21bc6c3d30204b9a1bfe150
# -*- coding: utf-8 -*-
# vim: et sw=4 ts=4
try:
import json as simplejson
except:
import simplejson
if pathname == '.':
print "Do not run this script from here, use 'ant all' in the above directory"
return
SRC_DIR = '../'
SRC_SUBDIR = 'meta'
SRC_EXT = 'json'
TEMPLATE_DIR = 'template'
TEMPLATE_FILE = 'meta.js'
TEMPLATE_TOKEN = '{ /* METAGEN */ }'
TESTS_FILE = 'load-tests-template.js'
TESTS_DEST = 'load-tests.js'
TESTS_DEST_DIR = '../yui/js'
DEST_DIR = 'js'
DEST_JSON = 'yui3.json'
DEST_JS = 'yui3.js'
MD5_TOKEN = '{ /* MD5 */ }'
TEST = 'test'
CONDITION = 'condition'
SUBMODULES = 'submodules'
PLUGINS = 'plugins'
modules = {}
fnreplacers = {}
conditions = {}
tokencount = 0
# we are allowing function tests for conditional
# print 'condition: ' + condition
# print '********************************************'
# print name
# print '********************************************'
# token = '"' + testfile + '"'
else:
seed += 1
# conditions[token] = condition
if 'path' in mod:
del mod['path']
if SUBMODULES in mod:
# print simplejson.dumps(subs, ensure_ascii=False, sort_keys=True, indent=4)
if 'path' in sub:
del sub['path']
del mod[SUBMODULES]
if 'path' in plug:
del plug['path']
# module director
# print dirname
# meta dir
# print j
# read all [component].json files
try:
except:
print 'WARNING: could not read ' + j
if data:
modules[k] = v
print 'module: ' + k
get_test_fn(v, 0, k)
# print jsonstr
count = 0
testlines = []
for k, v in conditions.iteritems():
# generate a unique id for the test. Update the metadata to point to the
# correct function, and add the tests to the features submodule
count += 1
if k in fnreplacers:
# jsstr = jsstr.replace(k, id)
print capsfile
# write the raw module json
# create the meta.js file from a template
# the module metadata tests need to be deployed to the yui package
print 'done'
def main():
if __name__ == '__main__':
main()