<commit_before># -*- coding: utf-8 -*-
"""
    longboxed.manage.comics
    ~~~~~~~~~~~~~~~~~~~~~~~

    comic management commands
"""
import csv
import warnings
from StringIO import StringIO

from flask import current_app
from flask.ext.script import Command, Option, prompt, prompt_bool

from ..helpers import mail_content
from ..importer import DailyDownloadImporter, DailyDownloadRecord, WeeklyReleasesImporter, WeeklyReleaseRecord
from ..services import comics, bundle


class TestCommand(Command):
    def run(self):
        pass

class ScheduleReleasesCommand(Command):
    def get_options(self):
        return [
            Option('-w', '--week', dest='week', required=True, choices=['thisweek', 'nextweek', 'twoweeks']),
        ]

    def run(self, week):
        # Suppress argparse warnings caused by running gunicorn's argparser
                # "inside" Flask-Script which imports it too...
        warnings.filterwarnings("ignore", "^.*argparse.*$")
        release_instance = WeeklyReleasesImporter(
            week=week,
            affiliate_id=current_app.config['AFFILIATE_ID'],
            supported_publishers=current_app.config['SUPPORTED_DIAMOND_PUBS'],
            csv_rules=current_app.config['RELEASE_CSV_RULES'],
            record=WeeklyReleaseRecord
        )
        scheduled_releases = release_instance.run()
        return

class ImportDatabase(Command):
    def get_options(self):
        return [
            Option('--days', '-d', dest='days', default=21, type=int)
        ]

    def run(self, days):
        print 'Importing the next %d days worth of comic books...' % days
        import_instance = DailyDownloadImporter(
            days=days,
            affiliate_id=current_app.config['AFFILIATE_ID'],
            supported_publishers=current_app.config['SUPPORTED_PUBS'],
            csv_rules=current_app.config['CSV_RULES'],
            record=DailyDownloadRecord
        )
        imported_issues = import_instance.run()
        return

<commit_msg>maybe user warning will suppress it?<commit_after># -*- coding: utf-8 -*-
"""
    longboxed.manage.comics
    ~~~~~~~~~~~~~~~~~~~~~~~

    comic management commands
"""
import csv
import warnings
from StringIO import StringIO

from flask import current_app
from flask.ext.script import Command, Option, prompt, prompt_bool

from ..helpers import mail_content
from ..importer import DailyDownloadImporter, DailyDownloadRecord, WeeklyReleasesImporter, WeeklyReleaseRecord
from ..services import comics, bundle


class TestCommand(Command):
    def run(self):
        pass

class ScheduleReleasesCommand(Command):
    def get_options(self):
        return [
            Option('-w', '--week', dest='week', required=True, choices=['thisweek', 'nextweek', 'twoweeks']),
        ]

    def run(self, week):
        # Suppress argparse warnings caused by running gunicorn's argparser
                # "inside" Flask-Script which imports it too...
        warnings.filterwarnings("ignore", "UserWarning")
        release_instance = WeeklyReleasesImporter(
            week=week,
            affiliate_id=current_app.config['AFFILIATE_ID'],
            supported_publishers=current_app.config['SUPPORTED_DIAMOND_PUBS'],
            csv_rules=current_app.config['RELEASE_CSV_RULES'],
            record=WeeklyReleaseRecord
        )
        scheduled_releases = release_instance.run()
        return

class ImportDatabase(Command):
    def get_options(self):
        return [
            Option('--days', '-d', dest='days', default=21, type=int)
        ]

    def run(self, days):
        print 'Importing the next %d days worth of comic books...' % days
        import_instance = DailyDownloadImporter(
            days=days,
            affiliate_id=current_app.config['AFFILIATE_ID'],
            supported_publishers=current_app.config['SUPPORTED_PUBS'],
            csv_rules=current_app.config['CSV_RULES'],
            record=DailyDownloadRecord
        )
        imported_issues = import_instance.run()
        return


{'fraction_non_alphanumeric': 0.11174713787954206, 'fraction_numerical': 0.0014932802389248383, 'mean_word_length': 2.932485322896282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1750783', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1098, 'n_words': 249}