예제 #1
0
파일: base.py 프로젝트: gic888/gicdat
 def follows(self, tf):
     '''
     test if this transform can come in a sequence after transform tf
     '''
     if not tf.output or not self.input:
         return "Missing Signature"
     if search.contains(tf.output, self.input):
         return 0
     else:
         return search.whynotcontains(tf.output, self.input)
예제 #2
0
def main():

	args = parseArgument()

	#옵션에 따라 진행
	if args.cmd=='search':
		import search
		search.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='delete':
		import delete
		if args.duplicatedLines:
			delete.duplicatedLines(args.input, args.output, args.withoutBlankLines)
		else:
			delete.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='trim':
		from trim import trim
		trim(args.input, args.output, args.lines)
	print ''
	print 'Done!'	
예제 #3
0
def main():
	start = datetime.datetime.now()
	args = parseArgument()

	#옵션에 따라 진행
	if args.cmd=='search':
		import search
		search.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='delete':
		import delete
		if args.duplicatedLines:
			delete.duplicatedLines(args.input, args.output, args.withoutBlankLines)
		else:
			delete.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='trim':
		from trim import trim
		trim(args.input, args.output, args.lines)

	took = datetime.datetime.now() - start
	
	log.info('Done! (%dsec.)' % (took.seconds))
예제 #4
0
	#default arguments
	parser.add_argument('-i', '--input', help='file to process.')
	parser.add_argument('-o', '--output', help='file to save result.(default=stdout)') #smart_open.py

	#parse!
	args = parser.parse_args()

	if not args.input:
		parser.error("No input file provided. use '-i' or '--input'")
	return args
	
if __name__ == "__main__":

	args = parseArgument()

	#옵션에 따라 진행
	if args.cmd=='search':
		import search
		search.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='delete':
		import delete
		if args.duplicatedLines:
			delete.duplicatedLines(args.input, args.output, args.withoutBlankLines)
		else:
			delete.contains(args.input, args.output, args.term, args.regex)
	elif args.cmd=='trim':
		from trim import trim
		trim(args.input, args.output, args.lines)
	print ''
	print 'Done!'