예제 #1
0
    def __init__(self, submission, shouldComment, shouldFlair, DB):
        """
        Initializes a Report instance.

        Args:
            Submission submission: The reddit submission.
            Boolean shouldComment: Whether comments should be left on the submission.
            Boolean shouldFlair: Whether the flair of the submission should be modified.
            DB DB: The database interface and connection for this class.
        """

        Report.log.debug("")
        Report.log.info("Processing submission https://redd.it/" +
                        submission.id)
        Recorder.__init__(self, DB)
        RedditBound.__init__(self, submission, shouldComment, shouldFlair)

        self.title_data = parse_title_data(self.title)

        if self.title_data is not None:
            self.gamemode = self.title_data[0]
            self.username = self.title_data[1]
            self.offense_data = self.title_data[2]
            self.flair_data = self.title_data[3]
            self.user_data = parse_user_data(self.username, self.gamemode,
                                             "string")

            if self.user_data is not None:
                self.user_id = self.user_data[0]["user_id"]
예제 #2
0
    def __init__(self, DB):
        """
        Initializes a Sheriff instance.

        Args:
            DB DB: The database interface and connection for this class.
        """

        Recorder.__init__(self, DB)
예제 #3
0
    def __init__(self, submission, shouldComment, shouldFlair, record, DB):
        """
        Initializes an OldReport instance.

        Args:
            Submission submission: The reddit submission to check.
            Boolean shouldComment: Whether comments should be left on the submission.
            Boolean shouldFlair: Whether the flair of the submission should be modified.
            List record: The list returned by db#get_recent_users.
            DB DB: The database interface and connection for this class.
        """

        Recorder.__init__(self, DB)
        RedditBound.__init__(self, submission, shouldComment, shouldFlair)

        self.user_id = record[1]  # user id
        self.post_date = int(float(
            record[2]))  # post submission date, convert from string to int
        self.offense_type = record[3]
        self.blatant = record[4]
        self.reportee = record[5]
예제 #4
0
 def __init__(self, db_path, book_name):
     Recorder.__init__(self, db_path)
     self.book_name = book_name
예제 #5
0
 def __init__(self, db_path, book_name):
     Recorder.__init__(self, db_path)
     self.book_name = book_name
예제 #6
0
 def __init__( me, width, height, rec_context):
     Recorder.__init__( me, rec_context)
     me.width = width
     me.height = height