From: kammerla <kam...@gm...> - 2006-12-30 07:43:39
|
Synchronization with source works fine, even when source is located on some other drive. I have tried out your proposal and source display jumped to the script on drive c: and back. (I had to use either /sys.path.insert(0, "c:/")/ or /sys.path.insert(0, "c:\\")/ both are working. The committed version of pydb.el is also correct on DOS style pathnames. Thanks a lot for your help. R. Bernstein schrieb: > Thanks for the info. When you write "Syncronization is perfect" did > you try the situation where you have some Python scripts running from > e: and some running from c:? > > Here's a little test for example: > In file e:/Sources/CapFilterScanner/t1.py > > import os, sys > sys.path.insert(0, "c:") # or c:\\ or c:/ - you'll have to see what works here > import t2 > > > In file c:/t2.py: > > print "t2 here" > > > First, when you run t1.py you should see "t2 here". You may have to > change that sys.path.insert to get this right. > > After that works, then inside pydb try stepping through this program > to make sure you switch from t1 to t2. > > Thanks. > > I've committed the regular expression change, but not the one listed > you quoted, because I have feeling the above might not work. Instead > the regular expression commited was the *second* one I listed: > > "^(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/\\\\.]*\\):\\([0-9]+\\)):[ \t]?" > > The ?: is need to make sure the numbering of patterns matched is > correct. It works on Unixy path names if it doesn't on DOSy path names > I'll go to the version you quote below. > > > > kammerla writes: > > Okay, here is what i found: > > > > "(e:\\sources\\capfilterscanner\\capanalyzer.py:3): <module> > > (Pydb) " > > > > in the emacs gud-buffer appears > > > > "Current directory is e:/Sources/CapFilterScanner/ > > <module> > > (Pydb) step > > <module> > > (Pydb) " > > > > Synchronization with the source buffer is perfect and your suggestion > > > > "^(\\(?:[a-zA-Z]:\\)?\\([-a-zA-Z0-9_/\\\\.]*\\):\\([0-9]+\\)):[ \t]?" > > > > also works fine. (though i do not understand the '?' and the ':' in > > front of the first opening squared bracket...) > > > > I would have expected that the module name and the current line number > > appear in the gud-buffer, but the > > (defun gud-pydb-marker-filter (string) ...) seems to filter it out and i > > can't figure out how it should be. > > > > Anyway pydb within emacs is what i was looking for to help me learning > > python. > > > > > > > > R. Bernstein schrieb: > > > My guess is that a drive letter and backslashes are shown in the > > > location pydb is printing and this is what is not getting > > > recognized. That is, pydb prints something like: > > > > > > (c:\mydirectory\myprog.py:10): > > > > > > If you could copy what appears as a location, e.g. the part that I > > > think will sort of look like what's above -- the line that has the > > > parenthesis -- that would help out. > > > > > > I had been running under cygwin which doesn't show drive letters or > > > use backslashes. > > > > > > A couple comments though about the regular expression used. The > > > pattern you give will match an all sorts of non-drive things, for example: > > > > > > (::a:bbbb:c:\mydirectory\myprog.py:10): > > > > > > So try using this instead: > > > > > > "^(\\(?:[a-zA-Z]:\\)?\\([-a-zA-Z0-9_/\\\\.]*\\):\\([0-9]+\\)):[ \t]?" > > > > > > > > > There may be another thing in the regular expression you suggests that > > > may be cause problems. I guess that so far the drive printed also > > > happens to be your "current" drive. If you have another drive around > > > try putting a script on that while your current drive is not that. > > > > > > If that doesn't work and the above change did not break things too, > > > then try: > > > > > > "^(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/\\\\.]*\\):\\([0-9]+\\)):[ \t]?" > > > > > > and see if this works. > > > > > > If you get back with the results, I'll look into updating that nasty > > > regular expression. And yes, regular expressions in GNU Emacs Lisp > > > are a pain in the ass to get right. > > > > > > > > > ralph.kammerlander writes: > > > > Hi, > > > > I'm an absolute beginner with python (and emacs ...) and trying to learn something new. > > > > I am using python 2.5 under WinXP (okay, I could use an other os ...) > > > > I just wanted to use pydb with emacs, but i could only get it to work with the source buffer, when i changed > > > > > > > > (defconst gud-pydb-marker-regexp > > > > "^(\\([-a-zA-Z0-9_/.]*\\):\\([0-9]+\\)):[ \t]?" > > > > to > > > > (defconst gud-pydb-marker-regexp > > > > "^([a-zA-Z:]*\\([-a-zA-Z0-9_/\\\\.]*\\):\\([0-9]+\\)):[ \t]?" > > > > > > > > I assume that's not the right way to do it ... > > > > Could somebody help me? > > > > > > > > Ralph > > > > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share your > > opinions on IT & business topics through brief surveys - and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Bashdb-pydb mailing list > > Bas...@li... > > https://lists.sourceforge.net/lists/listinfo/bashdb-pydb > > > > |