Module Expr Str Import alias Import alias Import alias Import alias ImportFrom alias alias alias alias Assign NameStore Str Assign NameStore ListLoad Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr ImportFrom alias Assign NameStore Str Assign NameStore Call NameLoad keyword NameLoad keyword BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body If BoolOpAnd AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str If BoolOpOr AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Add entry/entries to .bib file.
Default format produces citekeys like:
Schwilk+Isaac:2002 and Isaac+Schwilk+etal:2006.
 N/A os N/A sys N/A shutil N/A logging bibstuff.bibadd bibadd_logger make_entry html_format text_format N/A __docformat__ restructuredtext en N/A __authors__ N/A Alan G. Isaac N/A __version__ 0.3.1 N/A __needs__ 2.4 main N/A N/A N/A N/A N/A Command-line tool.
	See bibsearch.py -h for help.
	 N/A output N/A sys stdout optparse OptionParser N/A usage 
	%prog [options]
	example: %prog -mt article -bo BIB_DATABASE
	 N/A parser N/A OptionParser usage usage version N/A %prog  __version__ N/A N/A N/A parser add_option -f --format action store dest format default b help set format(s) of output
b: BibTeX
h: HTML
t: text metavar FORMAT N/A N/A N/A parser add_option -m --more_fields action store_true dest more_fields default False help input less common fields N/A N/A N/A parser add_option -M --MORE_FIELDS action store_true dest MORE_FIELDS default False help input all relevant fields N/A N/A N/A parser add_option -v --verbose action store_true dest verbose default False help Print INFO messages to stdout, default=%default N/A N/A N/A parser add_option -V --very_verbose action store_true dest very_verbose default False help Print DEBUG messages to stdout, default=%default N/A N/A N/A parser add_option -t --type action store dest entry_type default help set type of entry metavar ENTRYTYPE N/A N/A N/A parser add_option -o --outfile action store type string dest outfile help Write formatted references to FILE metavar FILE N/A N/A N/A parser add_option -n --nuke action store_true dest overwrite default False help CAUTION! silently overwrite outfile, default=%default N/A N/A N/A parser add_option -b --backup action store_true dest backup default False help backup FILE to FILE.bak, default=%default N/A 
	#TODO:
	parser.add_option("-I", "--ISBN", action="store", dest="ISBN", default=False,
					  help="use pyaws to add one entry by ISBN, default=%default")
	parser.add_option("-m", "--maxnames", action="store", type="int",
					  dest="maxnames",  default = 2, help="Max names to add to key")
	parser.add_option("-e", "--etal", action="store", type="string", 					  dest="etal",  default = 'etal',help="What to add after max names")
	parser.add_option("-i", "--infile", action="store", type="string", dest="infile",
					  help="Parse FILE for citation references.", metavar="FILE")
	parser.add_option("-s", "--stylefile", action="store", dest="stylefile", default="default.py",
					  help="Specify user-chosen style file",metavar="FILE")
	 N/A N/A options args N/A N/A parser parse_args N/A N/A options verbose N/A N/A N/A N/A bibadd_logger setLevel N/A logging INFO N/A N/A options very_verbose N/A N/A N/A N/A bibadd_logger setLevel N/A logging DEBUG N/A N/A N/A bibadd_logger info N/A Script running.
args=%s args N/A 
	#TODO: error check cite keys, insert (v. append), sort
	# get database as text from .bib file(s) or stdin
	if len(args) > 0 :
		try :
		   src = ''.join(open(f).read() for f in args)
		except:
			print 'Error in filelist'
	else :
		src = sys.stdin.read()

	 
	bibfile_name = args[-1]
	if (os.path.splitext(bibfile_name)[-1]).lower() != ".bib":
		bib4txt_logger.warning(bibfile_name + " does not appear to be a .bib file")
	try :
		bibfile_as_string = open(bibfile_name,'r').read()
	except :
		print "Database file not found."
		sys.exit(1)

	# read input file (default: stdin)
	if options.infile:
		try:
			input = open(options.infile,'r')
		except:
			print "Cannot open: "+options.infile
			sys.exit(1)

	# create object to store parsed .bib file
	bibfile_processor = bibfile.BibFile()
	#store parsed .bib file in the bibfile_processor
	#  TODO: allow multiple .bib files
	bibgrammar.Parse(bibfile_as_string, bibfile_processor)

	bfile = bibfile.BibFile()
	bibgrammar.Parse(src, bfile)
	used_citekeys = [] # stores created keys
	 N/A entry N/A make_entry N/A options entry_type N/A options more_fields N/A options MORE_FIELDS N/A N/A options outfile N/A N/A N/A N/A options backup N/A N/A N/A os path exists N/A options outfile N/A N/A N/A N/A shutil copyfile N/A options outfile N/A N/A options outfile .bak N/A N/A N/A options overwrite N/A N/A N/A N/A os path exists N/A options outfile N/A N/A output N/A open N/A options outfile w N/A N/A N/A N/A bibadd_logger info N/A Appending to %s.
(Use -n option to nuke (overwrite) the old output file.) N/A options outfile N/A output N/A open N/A options outfile a N/A N/A N/A output write N/A str entry N/A N/A h N/A options format N/A N/A N/A N/A output write N/A html_format entry N/A N/A t N/A options format N/A N/A N/A N/A output write N/A text_format entry N/A N/A N/A output close N/A N/A N/A __name__ __main__ N/A N/A N/A main