diff --git a/csvdb.py b/csvdb.py index 84b69d5..36d08e0 100755 --- a/csvdb.py +++ b/csvdb.py @@ -5,6 +5,13 @@ import dbtools import sqlite3, csv, sys def makeDB(dbo=dbtools.dbHelper(), infile='tweets.csv'): + """ + Initializes the database. + + :param dbo: Database object for the database to be initialized. + :param infile: Path of the CSV file to initalize the database with. + :return: Returns nothing. + """ try: infile = open(infile) except IOError: diff --git a/filler.py b/filler.py index ccfe413..298e61e 100755 --- a/filler.py +++ b/filler.py @@ -51,6 +51,8 @@ def getMessages(db=dbtools.dbHelper(), two=twitools.twObject()): return mcount, savepoint or 0, db.getLatestMessage() def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False): + """ Get handles of users we are following. :param db: Database object to be used. :param two: Twitter object to be used. :param firstrun: Must be set to True if the function is executed for the first time. Defaults to False. :return: Returns the number of gained and lost followings in a list (gained, lost). """ + current = list(db.getFollowers()) new = list(twitools.getNamesByIDs(twitools.getFollowerIDs())) gained = 0 @@ -77,6 +79,14 @@ def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False) return gained, lost def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False): + """ + Get handles of users we are following. + + :param db: Database object to be used. + :param two: Twitter object to be used. + :param firstrun: Must be set to True if the function is executed for the first time. Defaults to False. + :return: Returns the number of gained and lost followings in a list (gained, lost). + """ current = list(db.getFollowing()) new = list(twitools.getNamesByIDs(twitools.getFollowingIDs())) gained = 0