from requests_oauthlib import OAuth1
import argparse
import ConfigParser
import os

ap = argparse.ArgumentParser(description=__doc__,
                             formatter_class=argparse.RawTextHelpFormatter)
ap.add_argument('--config',
                metavar='CONFIG',
                default=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.cfg'),
                help='config file, containing keys and login info')
args = ap.parse_args()


def read_config(section_name, item_name):
    config = ConfigParser.RawConfigParser()
    config.read(os.environ['GGRAPH_CFG'])
    #config.read(args.config)
    return config.get(section_name, item_name)


def get_twitter_authentication():
    return OAuth1(read_config('twitter', 'client_key'),
                  client_secret=read_config('twitter', 'client_secret'),
                  resource_owner_key=read_config('twitter', 'resource_owner_key'),
                  resource_owner_secret=read_config('twitter', 'resource_owner_secret'))

@@ -34,24 +34,8 @@
 th1%0A
-import argparse%0A
 impo
@@ -65,384 +65,8 @@
 os%0A%0A
-ap = argparse.ArgumentParser(description=__doc__,%0A                             formatter_class=argparse.RawTextHelpFormatter)%0Aap.add_argument('--config',%0A                metavar='CONFIG',%0A                default=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.cfg'),%0A                help='config file, containing keys and login info')%0Aargs = ap.parse_args()%0A%0A
 %0Adef
@@ -194,38 +194,8 @@
 '%5D)%0A
-    #config.read(args.config)%0A
     

remove argparse bit from config