Ejemplo n.º 1
0
def update(p,w):
	parser=save.load(p,w,sys.argv)
	if p.find==None: parser.find=parser.first_id
	#print p
	website=Website.load_website(parser)
	actions["fetch"](parser,website)
Ejemplo n.º 2
0
############
# Modules needing pre_loaders
def history(p,w):
	if p.sub_action=="clear":
		try:
			os.unlink(save.save_file)
		except OSError:
			pass
		except:
			logging.exception("Unknown")
	else:
		save.list(p,w)
	
def update(p,w):
	parser=save.load(p,w,sys.argv)
	if p.find==None: parser.find=parser.first_id
	#print p
	website=Website.load_website(parser)
	actions["fetch"](parser,website)

actions={'fetch':fetch.fetch_it,'history':history,'update':update}
parser=parse.parser.parse_args()
try: website=Website.load_website(parser)
except ImportError: sys.exit()
except AttributeError: website=None # Not very clever, should name the error myself or avoid this
except: 
	logging.exception("Unknown error")
	sys.exit()

actions[parser.action](parser,website)