Re: [Zope-dev] PythonWin/Textpad, external import of Zope module and Persistence

2002-08-15 Thread Johan Carlsson [Torped]

At 10:54 2002-08-15 +0100, Chris Withers wrote:
Johan Carlsson [Torped] wrote:
I'm trying to setup to run with either TextPad, which can run external 
program like python scripts
and then parse the result and making Traceback lines linked to the 
line/file where the error occurred.

No sure exactly what you're trying to do here, can you privde more detail?

Well, I solved the problem another way, when I realized that I could parse
the Stupid Log File and make traceback's clickable in that file:

I added a small python script that only gives me the latest stuff in the SLF,
and it works quite nice. Now when I get an error I just press CTRL-1 inside
Textpad and I get the traceback, click on the error rows and it will 
automatically
open the correct file and scroll to the row where the error occured.

For anyone using TextPad on Windows this should quite a time saver.
(I know that I forgot to implement a check for if the SLF has been reseted,
something my Zope start-up script does everytime I restart the server.

http://www.zope.org/Members/johanc/Tips_and_HowTos/textpad_tooltips_howto

It's almost like having a RAD tool for Zope. Well not really, but it's an 
improvement.


It should also be possible to make a small script that takes a input file
with REQUEST information and then make the HTTP request to the development 
server
and return any traceback messages from the reply to TextPad.
(SLF only shows error messages when a product is refreshed, this way it 
should be
possible to retrieve traceback from the running code.

(Interactive debugging has to wait, but in Windows it would be terrific to 
use PythonWin
for the task. But starting Zope from within PythonWin usually has the effect of
PythonWin hangling. I might be because I have a really slow laptop :-)

Or try using Python which has an build in debugger which I like to be 
able to use.
The first problem I encounter in both scenarios is that when a file 
import Globals
which in its turn from Persistence import Persistent, this fails.
Mostly because Persistence is hot patched by ZODB.
Is there any smart way to setup a virtual Zope environment without 
importing Zope
(which mounts the Data.fs) or by importing Zope by in a light way without 
mounting
a storage or just mounting a lights storage.

'import Zope' is the only sane thing I can think you'd want to do. Zope 
has lots of magic that happens when you do that, and unless you do that, 
things won't behave as you expect.
You will need to mount the ZODB, but if you use ZEO then this isn't a 
problem as your webserver can mount the same storage.

I think I have a look at how unit test does this, when I have the time. It 
would probably solve my problems.
Running UnitTest from within TextPad or PythonWin would be a nice way to 
develop thing in.
(Unfortunately I'm not up in speed with writing UnitTests)

Thanks.
Johan

cheers,
Chris

-- 
Torped Strategi och Kommunikation AB
Johan Carlsson
[EMAIL PROTECTED]

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Visit:
Västmannagatan 67, Stockholm, Sweden

Phone +46-(0)8-32 31 23
Fax +46-(0)8-32 31 83
Mobil +46-(0)70-558 25 24
http://www.torped.se
http://www.easypublisher.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] PythonWin/Textpad, external import of Zope module and Persistence

2002-08-14 Thread Emile van Sebille

- Original Message - 
From: Johan Carlsson [Torped]

 The only thing I want to do in this first phase is to be able to make 
 syntax/sanity checks.
 

I use something like this for writing and testing external methods, having TextPad run 
the same python zope uses: 

if __name__ == '__main__':
class EmptyClass: pass
REQUEST = EmptyClass()
REQUEST.form = {'sortSeq' : 'Date'}
#REQUEST.form = {'sortSeq' : 'Item'}

print BacklogDetail(REQUEST=REQUEST)
--

Emile van Sebille
[EMAIL PROTECTED]

-


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] PythonWin/Textpad, external import of Zope module and Persistence

2002-08-14 Thread Johan Carlsson [Torped]



  The only thing I want to do in this first phase is to be able to make
  syntax/sanity checks.
 

I use something like this for writing and testing external methods, 
having TextPad run the same python zope uses:


Thanks for you tips.

Here's another one I just published on the Zope.org.

Textpad tool for parsing Stupid Log files to make traceback print outs 
clickable

Additional details:
TextPad from Helios Software Solutions (http://textpad.com) is an excellent 
tool for working with Python and Zope-files. Besides support for text 
coloring of common Python and Zope syntaxes it is possible to setup Tools 
that run a program or a script. The output from such a execution can be 
conneced to a RegExp that makes lines hyperlinks to Files and Lines 
according to the output.

http://www.zope.org/Memebers

http://www.zope.org/Members/johanc/Tips_and_HowTos/textpad_tooltips_howto

Regards,
Johan Carlsson


-- 
Torped Strategi och Kommunikation AB
Johan Carlsson
[EMAIL PROTECTED]

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Visit:
Västmannagatan 67, Stockholm, Sweden

Phone +46-(0)8-32 31 23
Fax +46-(0)8-32 31 83
Mobil +46-(0)70-558 25 24
http://www.torped.se
http://www.easypublisher.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )