<commit_before>#!/usr/bin/env python

import os
import sys
import argparse
import logging
import logging.config
from getpass import getpass

from twisted.internet import reactor

from cardinal.config import ConfigParser, ConfigSpec
from cardinal.bot import CardinalBotFactory

if __name__ == "__main__":

    # Create a new instance of ArgumentParser with a description about Cardinal
    arg_parser = argparse.ArgumentParser(description="""
Cardinal IRC bot

A Python/Twisted-powered modular IRC bot. Aimed to be simple to use, simple
to develop. For information on developing plugins, visit the project page
below.

https://github.com/JohnMaguire/Cardinal
""", formatter_class=argparse.RawDescriptionHelpFormatter)

    # Add all the possible arguments
    arg_parser.add_argument('-n', '--nickname', metavar='nickname',
                            help='nickname to connect as')

    arg_parser.add_argument('--password', action='store_true',
                            help='set this flag to get a password prompt for '
                                 'identifying')

    arg_parser.add_argument('-i', '--network', metavar='network',
                            help='network to connect to')

    arg_parser.add_argument('-o', '--port', type=int, metavar='port',
                            help='network port to connect to')

    arg_parser.add_argument('-P', '--spassword', metavar='server_password',
                            help='password to connect to the network with')

    arg_parser.add_argument('-s', '--ssl', action='store_true',
                            help='you must set this flag for SSL connections')

    arg_parser.add_argument('-c', '--channels', nargs='*', metavar='channel',
                            help='list of channels to connect to on startup')

    arg_parser.add_argument('-p', '--plugins', nargs='*', metavar='plugin',
                            help='list of plugins to load on startup')

    arg_parser.add_argument('--config', metavar='config',
                            help='custom config location')

    # Define the config spec and create a parser for our internal config
    spec = ConfigSpec()
    spec.add_option('nickname', basestring, 'Cardinal')
    spec.add_option('password', basestring, None)
    spec.add_option('network', basestring, 'irc.freenode.net')
    spec.add_option('port', int, 6667)
    spec.add_option('server_password', basestring, None)
    spec.add_option('ssl', bool, False)
    spec.add_option('storage', basestring, 'storage/')
    spec.add_option('channels', list, ['#bots'])
    spec.add_option('plugins', list, [
        'ping',
        'help',<commit_msg>Calculate full, real default storage path<commit_after>#!/usr/bin/env python

import os
import sys
import argparse
import logging
import logging.config
from getpass import getpass

from twisted.internet import reactor

from cardinal.config import ConfigParser, ConfigSpec
from cardinal.bot import CardinalBotFactory

if __name__ == "__main__":

    # Create a new instance of ArgumentParser with a description about Cardinal
    arg_parser = argparse.ArgumentParser(description="""
Cardinal IRC bot

A Python/Twisted-powered modular IRC bot. Aimed to be simple to use, simple
to develop. For information on developing plugins, visit the project page
below.

https://github.com/JohnMaguire/Cardinal
""", formatter_class=argparse.RawDescriptionHelpFormatter)

    # Add all the possible arguments
    arg_parser.add_argument('-n', '--nickname', metavar='nickname',
                            help='nickname to connect as')

    arg_parser.add_argument('--password', action='store_true',
                            help='set this flag to get a password prompt for '
                                 'identifying')

    arg_parser.add_argument('-i', '--network', metavar='network',
                            help='network to connect to')

    arg_parser.add_argument('-o', '--port', type=int, metavar='port',
                            help='network port to connect to')

    arg_parser.add_argument('-P', '--spassword', metavar='server_password',
                            help='password to connect to the network with')

    arg_parser.add_argument('-s', '--ssl', action='store_true',
                            help='you must set this flag for SSL connections')

    arg_parser.add_argument('-c', '--channels', nargs='*', metavar='channel',
                            help='list of channels to connect to on startup')

    arg_parser.add_argument('-p', '--plugins', nargs='*', metavar='plugin',
                            help='list of plugins to load on startup')

    arg_parser.add_argument('--config', metavar='config',
                            help='custom config location')

    # Define the config spec and create a parser for our internal config
    spec = ConfigSpec()
    spec.add_option('nickname', basestring, 'Cardinal')
    spec.add_option('password', basestring, None)
    spec.add_option('network', basestring, 'irc.freenode.net')
    spec.add_option('port', int, 6667)
    spec.add_option('server_password', basestring, None)
    spec.add_option('ssl', bool, False)
    spec.add_option('storage', basestring, os.path.join(
        os.path.dirname(os.path.realpath(sys.argv[0])),
        'storage'
    ))
    spec.add_option('channels', list, ['#bots'])
    spec.add_option('plugins', list, [
        'ping',
        'help',
{'fraction_non_alphanumeric': 0.1183015019469683, 'fraction_numerical': 0.0016688299647691451, 'mean_word_length': 2.8228206945428775, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2163718', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1475, 'n_words': 416}