Exemplo n.º 1
0
 def testBackslashesKeys(self):
     conf.supybot.reply.whenAddressedBy.strings.get(':foo').set('=/*')
     filename = conf.supybot.directories.conf.dirize('backslashes1.conf')
     registry.close(conf.supybot, filename)
     registry.open_registry(filename)
     value = conf.supybot.reply.whenAddressedBy.strings.get(':foo')()
     self.assertEqual(value, set(['=/*']))
Exemplo n.º 2
0
 def testSpacesValues(self):
     with conf.supybot.networks.test.password.context(' foo '):
         self.assertEqual(conf.supybot.networks.test.password(), ' foo ')
         filename = conf.supybot.directories.conf.dirize('spaces.conf')
         registry.close(conf.supybot, filename)
         registry.open_registry(filename)
         self.assertEqual(conf.supybot.networks.test.password(), ' foo ')
Exemplo n.º 3
0
 def closeRegistry():
     # We only print if world.dying so we don't see these messages during
     # upkeep.
     logger = log.debug
     if world.dying:
         logger = log.info
     logger('Writing registry file to %s', registryFilename)
     registry.close(conf.supybot, registryFilename)
     logger('Finished writing registry file.')
Exemplo n.º 4
0
    def export(self, irc, msg, args, filename):
        """<filename>

        Exports the public variables of your configuration to <filename>.
        If you want to show someone your configuration file, but you don't
        want that person to be able to see things like passwords, etc., this
        command will export a "sanitized" configuration file suitable for
        showing publicly.
        """
        registry.close(conf.supybot, filename, private=False)
        irc.replySuccess()
Exemplo n.º 5
0
    def export(self, irc, msg, args, filename):
        """<filename>

        Exports the public variables of your configuration to <filename>.
        If you want to show someone your configuration file, but you don't
        want that person to be able to see things like passwords, etc., this
        command will export a "sanitized" configuration file suitable for
        showing publicly.
        """
        registry.close(conf.supybot, filename, private=False)
        irc.replySuccess()
Exemplo n.º 6
0
    def export(self, irc, msg, args, filename):
        """<filename>

        Exports the public variables of your configuration to <filename>.
        If you want to show someone your configuration file, but you don't
        want that person to be able to see things like passwords, etc., this
        command will export a "sanitized" configuration file suitable for
        showing publicly.
        """
        if not conf.supybot.commands.allowShell():
            # Disallow writing arbitrary files
            irc.error('This command is not available, because '
                'supybot.commands.allowShell is False.', Raise=True)
        registry.close(conf.supybot, filename, private=False)
        irc.replySuccess()
Exemplo n.º 7
0
    conf.registerPlugin('Admin', True)
    conf.registerPlugin('Channel', True)
    conf.registerPlugin('Config', True)
    conf.registerPlugin('Misc', True)
    conf.registerPlugin('User', True)

    ###
    # Write the registry
    ###

    # We're going to need to do a darcs predist thing here.
    #conf.supybot.debug.generated.setValue('...')

    if not filename:
        filename = '%s.conf' % nick
    registry.close(conf.supybot, filename)

    # Done!
    output("""All done!  Your new bot configuration is %s.  If you're running
    a *nix based OS, you can probably start your bot with the command line
    "supybot %s".  If you're not running a *nix or similar machine, you'll
    just have to start it like you start all your other Python scripts.""" % \
                                                         (filename, filename))


if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        # We may still be using bold text when exiting during a prompt
        if questions.useBold:
Exemplo n.º 8
0
 def testBackslashesValues(self):
     conf.supybot.reply.whenAddressedBy.chars.set('\\')
     filename = conf.supybot.directories.conf.dirize('backslashes2.conf')
     registry.close(conf.supybot, filename)
     registry.open_registry(filename)
     self.assertEqual(conf.supybot.reply.whenAddressedBy.chars(), '\\')
Exemplo n.º 9
0
def _flushUserData():
    userdataFilename = os.path.join(conf.supybot.directories.conf(), "userdata.conf")
    registry.close(conf.users, userdataFilename)
Exemplo n.º 10
0
def _flushUserData():
    userdataFilename = os.path.join(conf.supybot.directories.conf(),
                                    'userdata.conf')
    registry.close(conf.users, userdataFilename)
Exemplo n.º 11
0
    conf.registerPlugin('Admin', True)
    conf.registerPlugin('Channel', True)
    conf.registerPlugin('Config', True)
    conf.registerPlugin('Misc', True)
    conf.registerPlugin('User', True)

    ###
    # Write the registry
    ###

    # We're going to need to do a darcs predist thing here.
    #conf.supybot.debug.generated.setValue('...')

    if not filename:
        filename = '%s.conf' % nick
    registry.close(conf.supybot, filename)

    # Done!
    output("""All done!  Your new bot configuration is %s.  If you're running
    a *nix based OS, you can probably start your bot with the command line
    "supybot %s".  If you're not running a *nix or similar machine, you'll
    just have to start it like you start all your other Python scripts.""" % \
                                                         (filename, filename))

if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        # We may still be using bold text when exiting during a prompt
        if questions.useBold:
            import supybot.ansi as ansi
Exemplo n.º 12
0
 def testBackslashes(self):
     conf.supybot.reply.whenAddressedBy.chars.set('\\')
     filename = conf.supybot.directories.conf.dirize('backslashes.conf')
     registry.close(conf.supybot, filename)
     registry.open_registry(filename)
     self.assertEqual(conf.supybot.reply.whenAddressedBy.chars(), '\\')