Using ZopeEDIT with Notepad?
OK, so it's not my favourite editor but I thought I'd try Notepad with ZopeEDIT for the hell of it. Can anyone tell me what I should set EDITOR_CMD to? 'C:\WINNT\system32\notepad.exe' and 'C:\WINNT\system32\notepad.exe %s' don't do the job. (What's the %s for anyway?) TIA. Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bris.ac.uk URL: http://www.bris.ac.uk/
On Mon, Mar 20, 2000 at 04:25:04PM +0000, Paul Browning wrote:
OK, so it's not my favourite editor but I thought I'd try Notepad with ZopeEDIT for the hell of it.
Can anyone tell me what I should set EDITOR_CMD to?
'C:\WINNT\system32\notepad.exe' and 'C:\WINNT\system32\notepad.exe %s' don't do the job. (What's the %s for anyway?)
The %s will be replaced by the filename. This so Notpad knows what file to edit. You will have to double the bacvslahes for this to work, because in Python (as in many programming languages), the backslash has special meaning: 'C:\\WINNT\\system32\\notepad.exe %s' or, you could place an 'r' in front of the string (r stands for raw): r'C:\WINNT\system32\notepad.exe %s' ZopeEDIT will open Notepad for you. When done, you save and close notepad. ZopeEDIT will ask you wether or not you want to save the file to Zope. Click 'Yes', and your changes are now on your Zope server. -- Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
On Mon, 20 Mar 2000 17:44:19 +0100 Martijn Pieters <mj@digicool.com> wrote:
The %s will be replaced by the filename. This so Notpad knows what file to edit.
Doh.
You will have to double the bacvslahes for this to work, because in Python (as in many programming languages), the backslash has special meaning:
'C:\\WINNT\\system32\\notepad.exe %s'
Doh**2. That now works very nicely. Thanks. One last request: Any way of suppressing the reflection of the password in the dialogue box that pops up? That would make my Computing Service colleagues alot more comfortable. Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bris.ac.uk URL: http://www.bris.ac.uk/
The '%s' gets replaced by a temporary file name, it definitly needs to be there. I know nothing about notepad.exe, but it sounds like notepad can't accept filename arguments on the command line. I can't verify this however. I know people are using ZopeEDIT in Win?? so it must be something with notepad. cheers jb Paul Browning wrote:
OK, so it's not my favourite editor but I thought I'd try Notepad with ZopeEDIT for the hell of it.
Can anyone tell me what I should set EDITOR_CMD to?
'C:\WINNT\system32\notepad.exe' and 'C:\WINNT\system32\notepad.exe %s' don't do the job. (What's the %s for anyway?)
TIA. Paul
-- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bris.ac.uk URL: http://www.bris.ac.uk/
-- Memory fault - where am I?
On 20 Mar 00, 14:35 JB wrote:
The '%s' gets replaced by a temporary file name, it definitly needs to be there. I know nothing about notepad.exe, but it sounds like notepad can't accept filename arguments on the command line.
It can, since ca. 1984. :-)
I can't verify this however. I know people are using ZopeEDIT in Win?? so it must be something with notepad.
cheers jb
Paul Browning wrote:
OK, so it's not my favourite editor but I thought I'd try Notepad with ZopeEDIT for the hell of it.
Can anyone tell me what I should set EDITOR_CMD to?
'C:\WINNT\system32\notepad.exe' and 'C:\WINNT\system32\notepad.exe %s' don't do the job. (What's the %s for anyway?)
Try %1, instead. %1, %2 etc stand for a commands first, second ... positional parameter in the MSDOS/Windows/Windows NT universe. -- o ( Wolfgang.Strobl@gmd.de (+49 2241) 14-2394 /\ * GMD mbH #include _`\ `_<=== Schloss Birlinghoven, <std.disclaimer> __(_)/_(_)___.-._ 53754 Sankt Augustin, Germany ________________
On Tue, Mar 21, 2000 at 11:12:14AM +0100, Wolfgang Strobl wrote:
On 20 Mar 00, 14:35 JB wrote:
The '%s' gets replaced by a temporary file name, it definitly needs to be there. I know nothing about notepad.exe, but it sounds like notepad can't accept filename arguments on the command line.
It can, since ca. 1984. :-)
I can't verify this however. I know people are using ZopeEDIT in Win?? so it must be something with notepad.
cheers jb
Paul Browning wrote:
OK, so it's not my favourite editor but I thought I'd try Notepad with ZopeEDIT for the hell of it.
Can anyone tell me what I should set EDITOR_CMD to?
'C:\WINNT\system32\notepad.exe' and 'C:\WINNT\system32\notepad.exe %s' don't do the job. (What's the %s for anyway?)
Try %1, instead. %1, %2 etc stand for a commands first, second ... positional parameter in the MSDOS/Windows/Windows NT universe.
*Sigh* Did anyone read my reply to the original message?? A backslash has special meaning in python! And positional parameters have nothing to do with python either! In python (as in many programming languages based on C) \n means newline. Just fire up a python interpreter:
repr('C:\WINNT\system32\notepad.exe %s') 'C:\\WINNT\\system32\012otepad.exe %s'
\012 is the octal representation for newline. Note that, as \W and \s are meaningless, they are interpreted as if you used a double backslash. The solution immediatly becomes clear:
repr('C:\\WINNT\\system32\\notepad.exe %s') 'C:\\WINNT\\system32\\notepad.exe %s' repr(r'C:\WINNT\system32\notepad.exe %s') 'C:\\WINNT\\system32\\notepad.exe %s'
ZopeEDIT uses the string to build up a command to feed to the system. It uses the default python % operator to replace the %s (which is a C-sprintf-like string formatting code) with the filename of the temporary file it creates. Please, next time, use the python debugger or something to see what goes wrong. Paul has long since gotten ZopeEDIT to work, BTW. -- Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
participants (4)
-
JB -
Martijn Pieters -
Paul Browning -
Wolfgang Strobl