Gadfly DB problem in python

Lance LaDamage lance-ladamage at rogers.com
Thu Mar 6 16:59:46 EST 2003


This is the traceback I get:

C:\DATA\RY>main.py
Traceback (most recent call last):
  File "C:\DATA\RY\main.py", line 27, in ?
    DataPool.Startup( connection = connection )
  File "C:\Data\Ry\DataPool.py", line 35, in Startup
    DataPool.instance = DataPool( init[ 'connection' ] )
  File "C:\Data\Ry\DataPool.py", line 24, in __init__
    self.cursor.execute("select * from datapool")
  File "F:\Python22\Lib\site-packages\gadfly\database.py", line 372, in
execute
  File "C:\Data\Python\lib\site-packages\gadfly\gadfly\semantics.py", line
2719,
 in eval
    substseq = h.join(substseq)
  File "C:\Data\Python\lib\site-packages\gadfly\gadfly\semantics.py", line
149,
in join
    new = t.remap(transformG)
  File "F:\Python22\Lib\site-packages\gadfly\kjbuckets0.py", line 581, in
remap
  File "C:\Data\Python\lib\site-packages\gadfly\gadfly\kjbuckets0.py", line
413,
 in __mul__
    raise ValueError, "kjGraph composes only with kjTable"
ValueError: kjGraph composes only with kjTable

When I run this code:

#!/usr/local/ActivePython-2.2/bin/python2.2

import gadfly
import ModuleLoader
import DataPool
import time
import socket
import sys
import traceback
import threading
import string

DEFAULTCOLOR = 'black'
DEFAULTFONT = 'Arial'
DEFAULTSIZE = '10'

if __name__ == '__main__':

    connection = gadfly.gadfly( 'rogiedb', 'rogiedb' )

    loadmod = [ 'Config', 'Acl', 'Socket', 'Inbound', 'Display',
                'PacketLogin', 'PacketDevNull', 'PacketPing', 'PacketJoin',
'PacketLeave', 'PacketSpeech', 'PacketPM',
                'Command', 'CommandModule', 'CommandSystem',
'CommandGoogle', 'CommandGreeting', 'CommandPing',
                'CommandMachine', 'CommandSpeech',
                'Uptime' ]

    DataPool.Startup( connection = connection )

    ModuleLoader.Startup( connection = connection )
    ModuleLoader.GetInstance().LoadModules( loadmod )

    DataPool.SetVariable( 'running', 1 )

    reqadd = 0
    if reqadd:
        addme = raw_input()
        ModuleLoader.GetModule( 'Acl' ).AddUser( addme )
        sys.exit()

    while DataPool.GetVariable( 'running' ):
        try:
# if 1:
            server = ModuleLoader.GetModule( 'Config' ).GetValue( 'login',
'chatserver')
            port = ModuleLoader.GetModule( 'Config' ).GetValue( 'login',
'chatport')

            ModuleLoader.GetModule( 'Socket' ).Connect( server, port )

            ModuleLoader.GetModule( 'PacketLogin' ).DoLogin()
            ModuleLoader.GetModule( 'PacketJoin' ).DoJoin()
            ModuleLoader.GetModule( 'Inbound' ).run()

            ModuleLoader.GetModule( 'Socket' ).Close()
            DataPool.SetVariable( 'socket', socket.socket( socket.AF_INET,
socket.SOCK_STREAM ) )
        except Exception, e:
            file = open( 'err_log.txt', 'a' )
            err = traceback.format_exception( Exception, e,
sys.exc_info()[2] )
            err = string.join( err )
            file.write( err + "\n\n" )
            file.close()
            print "BLEH!!!"
            ModuleLoader.GetModule( 'Socket' ).Close()
            DataPool.SetVariable( 'socket', socket.socket( socket.AF_INET,
socket.SOCK_STREAM ) )
            time.sleep( ModuleLoader.GetModule( 'Config' ).GetValue(
'reconnect', 'interval' ) )

    ModuleLoader.Shutdown()
    DataPool.Shutdown()
    raw_input( "This is just to let you know what happened" )


All this code is fine but it used to work on my old computer, but now it
won't work on this one...






More information about the Python-list mailing list