#!/usr/bin/env python
import argparse
import rsvpmeetup
import pkg_resources


my_parser = argparse.ArgumentParser(prog='rsvpcron',
	description='Main File to the meetuprsvp script',
	usage='%(prog)s [options] [path]')

my_parser.add_argument('--config',action='store',help='Enter Paths to secret config files')
# my_parser.add_argument('--groups',action='store',help='Enter Paths to group config files')
my_parser.add_argument('--run',action='store_true',help='Begin the script')

def cron():
	from rsvpmeetup.api import Session
	with Session() as new_session:
		new_session=Session()
		new_session.login()
		new_session.rsvp_groups()

def initialize(path):
	if path!=None:
		DATA_PATH = pkg_resources.resource_filename('rsvpmeetup', 'path.txt')
		with open(DATA_PATH,'w+') as f:
			f.write(path)
		print("Done configuring path")



args=my_parser.parse_args()
if not vars(args)['run'] and args.config==None:
	my_parser.print_help()

initialize(args.config)

if vars(args)['run']:
	cron()

# if cron



