示例#1
0
文件: sfdoc.py 项目: jdgirald/sfdoc
def main(argv=None):
	if argv is None:
		argv = sys.argv
	# set the settings based on defaults and command line arguments
	args = __parse_args()
	SFDocSettings.verbose = args.verbose
	SFDocSettings.test = args.test
	SFDocSettings.indexfile = 'index.html' if not args.noindex else ''
	SFDocSettings.project_name = args.name
	if args.scope.lower() == 'protected':
		SFDocSettings.scope = ['global', 'public', 'protected']
	elif args.scope.lower() == 'private':
		SFDocSettings.scope = ['global', 'public', 'protected', 'private']
	SFDocSettings.no_properties = args.noproperties
	SFDocSettings.no_method_list = args.nomethodlist
	[source, target] = [args.source, args.target]

	# get files, parse them, and create class info objects
	files = __get_files(source, args.pattern, args.testpattern, args.regex)
	classes = [apexparser.parse_file(f) for f in files]
	classlist = [cinfo.name for cinfo in classes]

	if not os.path.exists(target) and not SFDocSettings.test:
		os.makedirs(target)

	for c in classes:
		sfdocmaker.create_outfile(classlist, c, target + '/' + c.name + '.html')

	if not args.noindex:
		sfdocmaker.create_index(classes, target + '/index.html')

	if not SFDocSettings.test:
		shutil.copy(SFDocSettings.resource_css_sfdoc, target)
		shutil.copy(SFDocSettings.resource_css_normalize, target)
示例#2
0
文件: sfdoc.py 项目: savelieffd/sfdoc
	return files

args = parse_args()
SFDocSettings.verbose = args.verbose
SFDocSettings.test = args.test
SFDocSettings.indexfile = 'index.html' if not args.noindex else ''
SFDocSettings.project_name = args.name
if args.scope.lower() == 'protected':
	SFDocSettings.scope = ['public', 'protected']
elif args.scope.lower() == 'private':
	SFDocSettings.scope = ['public', 'protected', 'private']
[source, target] = args.dirs;

currentdir = os.path.dirname(os.path.realpath(__file__))
files = get_files(source, args.pattern)
classes = [apexparser.parse_file(f) for f in files]
classlist = [cinfo.name for cinfo in classes]

os.chdir(currentdir)
if not os.path.exists(target) and not SFDocSettings.test:
	os.makedirs(target)

for c in classes:
	sfdocmaker.create_outfile(classlist, c, target + '/' + c.name + '.html')

if not args.noindex:
	sfdocmaker.create_index(classes, target + '/index.html')

if not SFDocSettings.test:
	shutil.copy('sfdoc.css', target)
	shutil.copy('normalize.css', target)
示例#3
0
文件: sfdoc.py 项目: gbreavin/sfdoc
# set the settings based on defaults and command line arguments
args = parse_args()
SFDocSettings.verbose = args.verbose
SFDocSettings.test = args.test
SFDocSettings.indexfile = 'index.html' if not args.noindex else ''
SFDocSettings.project_name = args.name
if args.scope.lower() == 'protected':
    SFDocSettings.scope = ['global', 'public', 'protected']
elif args.scope.lower() == 'private':
    SFDocSettings.scope = ['global', 'public', 'protected', 'private']
SFDocSettings.no_properties = args.noproperties
SFDocSettings.no_method_list = args.nomethodlist
[source, target] = [args.source, args.target]

# get files, parse them, and create class info objects
files = get_files(source, args.pattern, args.testpattern, args.regex)
classes = [apexparser.parse_file(f) for f in files]
classlist = [cinfo.name for cinfo in classes]

if not os.path.exists(target) and not SFDocSettings.test:
    os.makedirs(target)

for c in classes:
    sfdocmaker.create_outfile(classlist, c, target + '/' + c.name + '.html')

if not args.noindex:
    sfdocmaker.create_index(classes, target + '/index.html')

if not SFDocSettings.test:
    shutil.copy('css/sfdoc.css', target)
    shutil.copy('css/normalize.css', target)