473,692 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gadfly server startup error

Hello,

I just tried the recent gadfly (from SF), using Python
2.4.2 (hand built, since my Suse 8.2 had only 2.2.2).

The direct operation of gadfly works.

After calling gfserver, I get (in addition to a complete
users manual dumped on the screen) the following error
message:

|Traceback (most recent call last):
| File "/usr/local/bin/gfserver", line 4, in ?
| main()
| File "/usr/local/python-2.4.2/lib/python2.4/site-packages/gadfly/scripts/gfserver.py", line 89, in main
| S = Server(int(port ), db, dr, pw, startup)
|NameError: global name 'Server' is not defined
which is factually correct (the script only imports sys,
but then tries to instantiate the class "Server" which is
nowhere defined).

Is this a bug somewhere, or is just my installation broken?

Ralf
Sep 12 '06 #1
6 1654
Ralf Muschall wrote:
Hello,

I just tried the recent gadfly (from SF), using Python
2.4.2 (hand built, since my Suse 8.2 had only 2.2.2).

The direct operation of gadfly works.

After calling gfserver, I get (in addition to a complete
users manual dumped on the screen) the following error
message:

|Traceback (most recent call last):
| File "/usr/local/bin/gfserver", line 4, in ?
| main()
| File "/usr/local/python-2.4.2/lib/python2.4/site-packages/gadfly/scripts/gfserver.py", line 89, in main
| S = Server(int(port ), db, dr, pw, startup)
|NameError: global name 'Server' is not defined
which is factually correct (the script only imports sys,
but then tries to instantiate the class "Server" which is
nowhere defined).

Is this a bug somewhere, or is just my installation broken?
You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:
C:\Steve\gadfly Zip>python run_tests
Traceback (most recent call last):
File "run_tests" , line 9, in ?
go()
File "C:\Steve\gadfl yZip\test\__ini t__.py", line 35, in go
l.append(test_m ods[name].suite())
AttributeError: 'module' object has no attribute 'suite'

Running gvserver I get pretty mucht he same thing you do:

Traceback (most recent call last):
File "gadflyZip\gadf ly\scripts\gfse rver.py", line 101, in ?
main()
File "gadflyZip\gadf ly\scripts\gfse rver.py", line 89, in main
S = Server(int(port ), db, dr, pw, startup)
NameError: global name 'Server' is not defined

Time to report a bug, methinks? Makes SQLite look good ...

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 13 '06 #2
Steve Holden wrote:
You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:
I don't remember whether I looked into that at all.

....
NameError: global name 'Server' is not defined
....
Time to report a bug, methinks? Makes SQLite look good ...
Carl Waldbieser reported this bug (and a few others, including
fixes) in April 04 (entry 94049[35]). It seems the project
fell asleep four years ago (but in "News" on SF is a more recent
message from the author pointing to xsdb).

Ralf
Sep 13 '06 #3
Ralf Muschall wrote:
Steve Holden wrote:

>>You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:


I don't remember whether I looked into that at all.

....
>>NameError: global name 'Server' is not defined


....
>>Time to report a bug, methinks? Makes SQLite look good ...


Carl Waldbieser reported this bug (and a few others, including
fixes) in April 04 (entry 94049[35]). It seems the project
fell asleep four years ago (but in "News" on SF is a more recent
message from the author pointing to xsdb).
Yes, the whole Gadfly SF web seems to be a bit of a mess.

That news page talks about a "new release", but nothing has actually
been released, so I presume that code is in SVN now. Frankly I'm not
encouraged to use it, though it's a pity: I discussed Gadfly somewhat in
"Python Web Programming", and it would have been nice to see it survive.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 13 '06 #4
Steve Holden wrote:
Yes, the whole Gadfly SF web seems to be a bit of a mess.
Maybe it has been infected by the source code+doc ;-)

I just started the server (after applying Carl's changes)
with

gfserver 2222 foodb . ''

(the DB "foodb" had been created earlier using gfplus
locally).

If I look for it with "nmap localhost -p 2222", it enters
an endless loop (I don't know whether it would still work
after this, since I could not get it to work at all).

gfplus in client-mode wants the argument order
DB, port-No, password, host
(inferred from the source, i.e. the manual is wrong).

The argument order of commandlines and functions seems to be
a general problem - maybe I should try all 24 possibilities
(almost each place in the source does them differently).

After that, it says

|gfplus $Revision: 1.7 $ -- Interactive gadfly shell [readline]
|
|Wednesday September 13, 2006 04:53 PM
|Using:
|Policy: foodb
|Loc: localhost:2222

i.e. it includes a thing called "Policy" (unexplained, just
mentioned in the "Security" chapter of the server manual)
and fills it with the value of the database name (but comparing
scripts/gfplus.py and client.py, "database" and "policy" seem
to be synonyms (but this disagrees with server.py)).

Entering a lone semicolon+retur n at the client prompt causes
a timeout in the client and a message

|no such policy: foodb
|main loop on <socket._socket object object at 0x4080838c<gadf ly.database.gad fly instance at 0x40435eac>
|server: waiting for connection(s)

in the server (which is true in some sense, since I never made
a policy - I just want a blood DB).

It seems the proper way to use gadfly over the net is to say

echo 'SQL statement;' | ssh -l remoteuser 'gfplus -localoptions'

:-(

Is anybody out there who has used the server+client operation
mode successfully?

Ralf
Sep 13 '06 #5
Is anybody out there who has used the server+client operation
mode successfully?
Well, several years ago, yes.

Since then the project was taken over by some volunteers
and they did an excellent job of
restructuring and modernizing (somewhat) the
*standalone* part of gadfly, but apparently they
didn't port the *client/server* component properly.
As it stands the client server portion is broken now.
(I hadn't tried it after the port, sorry).

I think if you find an older (pre-sourceforge)
tarball it will work. I will try
to find time to fix this, unless someone else wants
to have a try. Sorry!

Also, the reference to the new release on the
site refers to a mini-release I did a year or more
ago which fixed various bugs and also added
an xsdb interface component.

-- Aaron Watters

===
There once was a man from Japan
whose limericks never would scan
when told this was so
he said "yes, I know,
but I always try to put as many words in the last line as I possibly
can."

Oct 2 '06 #6

aa************* **@yahoo.com wrote:
Is anybody out there who has used the server+client operation
mode successfully?

Well, several years ago, yes.
I looked into it and it was mainly a documentation and
test issue, I think. The code seems to work.

Please go

http://gadfly.sourceforge.net/gadfly_server_test.zip

and look at the readme. I will try to fold this in to the
distribution sometime soon.

from the README in the zip:

==========
gadfly_server_t est readme

This directory provides a proof of concept test run of the
gadfly server components. It requires gadfly to be installed
in the local python installation ( http://gadfly.sourceforge.net ).

Please see the doc string at the top of gfstest.py for details.

Example demo run sequence (in Windows installations the "python" prefix
is optional):

1. Set up the database.
% python gftest.py dbtest

2. Start the server
% python gfstest.py start

This starts an infinite server loop in the current console.

3. SWITCH TO ANOTHER WINDOW and run test queries.
% python gfstest.py queries

4. Shut down the server.
% python gfstest.py shutdown
=============

-- Aaron Watters

===
There once was a man who said "Well!
Will nobody answer this bell?
I have pulled day and night
'til my hair has grown white
but nobody answers this bell!"
-- Edward Lear

Oct 2 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1848
by: Patrick W. Fraley | last post by:
Hi Everybuddy, I am having a little problem I can not find a solution for. I am trying to use the SQL-LIKE statement in gadfly. After googling around I found out that it is not supported, and that on is supposed to use a regular expression. All great, but there is nowhere a reference to be found on how to do this. No examples, no nothing, just the comment to use regular expressions.
4
2070
by: Brian O. Bush | last post by:
A while ago, I recall hearing that Gadfly might be included into the python standard library. What happened? As I recall, the issue was the license. Brian
3
1439
by: R.Marquez | last post by:
I tried installing gadfly 1.0 on Mandrake 9.2 and got the following: # python setup.py install running install error: invalid Python installation: unable to open /usr/lib/python2.3/config/Makefile (No such file or directory) # Of course, the error is correct in that there is no such file. There is not even a python2.3/ config directory. Is the Mandrake
1
1411
by: Ian Pellew | last post by:
Hi all; Is there a Windows version of gadfly anywhere? All my searching gets me to Linux stuff (not that I have anything against Linux, rather I use Solaris) Regards Ian
0
1268
by: Thomas | last post by:
Hi, i have a webserver with (approx.) the code below, but whatever i do the html code sent to the browser stays the same. The strangest is, if i insert a local variable in the class which is incremented upon each call to self.render_GET() and append it to the html code, it increments correctly on the browser. Could it be a probem with gadfly? from twisted.web import resource, server
0
1083
by: Tommy | last post by:
Hello I've got problems while using py2exe, because of a module I'm using : gadfly In fact, I had the same problem with Pmw, and the solution was to create a single file Pmw.py which contained all the parts of the original module, and to put it in the project's main folder. So, I'd like to make a "freezed" version of gadfly, in order to create a fixed win32 exe. But it's more difficult than with Pmw... so does anyone know another way...
3
1513
by: niko | last post by:
Hello, while using gadfly, got an error that i don't understand. Code is as follow : cursor = connection.cursor() cursor.execute('select id_m from mots where nom_m = "%s"' % nom_m) id_m = cursor.fetchall() Error message : File "C:\Python24\Lib\site-packages\gadfly\kjParser.py", line 567, in getmember
3
1477
by: chris | last post by:
I'm looking for a completely in-memory sql db. I have seen gadfly, but its startup method seems to require a directory for the on-disk file storage. I have a script and I want to create a database/tables in the script, insert some data (not much), and execute some queries, all in-memory. Don't need to persist anything. Possible, or am I just talking crazy here? Thanks, Chris
8
1395
by: jean-jeanot | last post by:
I am writing a prototype program whose aim is to collect bookkeeping transactions in a Database ( Gadfly). After creating the table I create the variables with varAmount = StringVar() I then create labels in Tkinter to ease the input of data. With a function def treatment (): requete = "insert into transactions ( date,amount,,....) values(......) "% (varDate.get(), varAmount.get
0
8610
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9090
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4325
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2977
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2242
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1961
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.