[Zope] Using Cookie Data
I have a cookie that contains the value of an psql key as its value. I want to retrieve the value and use it to call the psql query method to retrieve the data. The code that I am currently using is dtml-in qryGetCustomer(REQUEST.cookies[Company_Name)] The company record has been retrieved for dtml-var company_name.br /dtml-in where Company_Name is a property containing the company name and is the name of the cookie, and company_name is the first field that should be retrieved from the psql database query. When I run the code I get Error Type: KeyError Error Value: qryGetCustomer(REQUEST.cookies[Company_Name)] Any help out there on helping a Zope newbie to get the data from his psql database with a value retrieved from a cookie? -- Jim Zope is cool! ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: zdaemon/trunk/ Updated to reflect split of zope.testrunner and zope.testing.
Log message for revision 126501: Updated to reflect split of zope.testrunner and zope.testing. Addressed deprecation warnings. Changed: U zdaemon/trunk/buildout.cfg U zdaemon/trunk/setup.py U zdaemon/trunk/src/zdaemon/tests/tests.py -=- Modified: zdaemon/trunk/buildout.cfg === --- zdaemon/trunk/buildout.cfg 2012-05-25 19:10:43 UTC (rev 126500) +++ zdaemon/trunk/buildout.cfg 2012-05-25 20:28:10 UTC (rev 126501) @@ -5,7 +5,7 @@ [test] recipe = zc.recipe.testrunner -eggs = zdaemon +eggs = zdaemon [test] [coverage-test] recipe = zc.recipe.testrunner Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2012-05-25 19:10:43 UTC (rev 126500) +++ zdaemon/trunk/setup.py 2012-05-25 20:28:10 UTC (rev 126501) @@ -29,6 +29,7 @@ entry_points=entry_points, include_package_data = True, install_requires=[ZConfig], +extras_require=dict(test=['zope.testing']), ) except ImportError: from distutils.core import setup Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-05-25 19:10:43 UTC (rev 126500) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-05-25 20:28:10 UTC (rev 126501) @@ -12,9 +12,17 @@ # ## -import os, re, shutil, sys, tempfile, unittest -import ZConfig, zdaemon -from zope.testing import doctest, renormalizing +import doctest +import os +import re +import shutil +import subprocess +import sys +import tempfile +import unittest +import ZConfig +import zdaemon +from zope.testing import renormalizing try: import pkg_resources @@ -112,13 +120,17 @@ f() def system(command, input=''): -i, o = os.popen4(command) +p = subprocess.Popen( +command, shell=True, +stdin=subprocess.PIPE, +stdout=subprocess.PIPE, +stderr=subprocess.STDOUT) if input: -i.write(input) -i.close() -print o.read(), +p.stdin.write(input) +p.stdin.close() +print p.stdout.read(), +p.wait() - def checkenv(match): match = [a for a in match.group(1).split('\n')[:-1] if a.split('=')[0] in ('HOME', 'LD_LIBRARY_PATH')] ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/s Used manuel to make the documentation more documenty
sleep -... socket-name /tmp/demo.zdsock -... /runner -... '''.replace('/tmp', tmpdir)) +runner + program sleep + socket-name /tmp/demo.zdsock +/runner - system(./zdaemon -Cconf start 100) +.. - text + + open('conf', 'w').write(text.replace('/tmp', tmpdir)) + +Then we can pass the program argument on the command line: + +sh ./zdaemon -Cconf start 100 . . daemon process started, pid=1149 - system(./zdaemon -Cconf status) +sh ./zdaemon -Cconf status program running; pid=1149 - system(./zdaemon -Cconf stop) +sh ./zdaemon -Cconf stop . . daemon process stopped @@ -157,19 +170,24 @@ a program. Perhaps the most common case for this is setting LD_LIBRARY_PATH so that dynamically loaded libraries can be found. - open('conf', 'w').write( -... ''' -... runner -... program env -... socket-name /tmp/demo.zdsock -... /runner -... environment -... LD_LIBRARY_PATH /home/foo/lib -... HOME /home/foo -... /environment -... '''.replace('/tmp', tmpdir)) +:: - system(./zdaemon -Cconf fg) +runner + program env + socket-name /tmp/demo.zdsock +/runner +environment + LD_LIBRARY_PATH /home/foo/lib + HOME /home/foo +/environment + +.. - text + + open('conf', 'w').write(text.replace('/tmp', tmpdir)) + +Now, when we run the command, we'll see out environment settings reflected: + +sh ./zdaemon -Cconf fg env USER=jim HOME=/home/foo @@ -200,15 +218,20 @@ import os f.write('rec 1\n'); os.fsync(f.fileno()) - open('conf', 'w').write( -... ''' -... runner -... program tail -f data -... transcript log -... /runner -... ''') +Now, here's out zdaemon configuration:: - system(./zdaemon -Cconf start) +runner + program tail -f data + transcript log +/runner + +.. - text + + open('conf', 'w').write(text) + +Now we'll start: + +sh ./zdaemon -Cconf start . . daemon process started, pid=7963 @@ -217,7 +240,7 @@ import time time.sleep(0.1) -Now, if we look at the log file, it contains the tail output: +After waiting a bit, if we look at the log file, it contains the tail output: open('log').read() 'rec 1\n' @@ -244,7 +267,7 @@ Now, if we tell zdaemon to reopen the file: - system(./zdaemon -Cconf reopen_transcript) +sh ./zdaemon -Cconf reopen_transcript and generate some output: Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-05-25 20:28:10 UTC (rev 126501) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-05-25 21:43:35 UTC (rev 126502) @@ -13,6 +13,9 @@ ## import doctest +import manuel.capture +import manuel.doctest +import manuel.testing import os import re import shutil @@ -21,6 +24,7 @@ import tempfile import unittest import ZConfig +import zc.customdoctests import zdaemon from zope.testing import renormalizing @@ -137,7 +141,27 @@ match.sort() return '\n'.join(match) + '\n' +zdaemon_template = #!%(python)s + +import sys +sys.path[0:0] = [ + %(zdaemon)r, + %(ZConfig)r, + ] + +import zdaemon.zdctl + +if __name__ == '__main__': +zdaemon.zdctl.main() + + def test_suite(): +README_checker = renormalizing.RENormalizing([ +(re.compile('pid=\d+'), 'pid=NNN'), +(re.compile('(\. )+\.?'), 'BLANKLINE'), +(re.compile('^env\n((?:.*\n)+)$'), checkenv), +]) + return unittest.TestSuite(( doctest.DocTestSuite( setUp=setUp, tearDown=tearDown, @@ -146,28 +170,18 @@ (re.compile('(\. )+\.?'), 'BLANKLINE'), ]) ), -doctest.DocFileSuite( +manuel.testing.TestSuite( +manuel.doctest.Manuel( +parser=zc.customdoctests.DocTestParser( +ps1='sh', +transform=lambda s: 'system(%s)\n' % s.rstrip() +), +checker=README_checker, +) + +manuel.doctest.Manuel(checker=README_checker) + +manuel.capture.Manuel(), '../README.txt', setUp=setUp, tearDown=tearDown, -checker=renormalizing.RENormalizing([ -(re.compile('pid=\d+'), 'pid=NNN'), -(re.compile('(\. )+\.?'), 'BLANKLINE'), -(re.compile('^env\n((?:.*\n)+)$'), checkenv), -]) -), +), )) - -zdaemon_template = #!%(python)s - -import sys -sys.path[0:0] = [ - %(zdaemon)r, - %(ZConfig)r, - ] - -import zdaemon.zdctl - -if __name__ == '__main__': -zdaemon.zdctl.main() - ___ Zope-Checkins maillist - Zope-Checkins@zope.org https
[Zope-Checkins] SVN: zdaemon/trunk/ Added a separate option, stop-timout, to control how long to wait
Log message for revision 126562: Added a separate option, stop-timout, to control how long to wait for a graceful shutdown. Previously, this was controlled by backoff-limit, which didn't make much sense. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/README.txt U zdaemon/trunk/src/zdaemon/component.xml U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdoptions.py U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-04 13:06:20 UTC (rev 126561) +++ zdaemon/trunk/CHANGES.txt 2012-06-04 14:17:09 UTC (rev 126562) @@ -2,13 +2,16 @@ Changelog === - -2.0.5 (unreleased) +3.0.0 (unreleased) == -- Nothing changed yet. +- Added a separate option, stop-timout, to control how long to wait + for a graceful shutdown. + Previously, this was controlled by backoff-limit, which didn't make + much sense. + 2.0.4 (2009-04-20) == Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2012-06-04 13:06:20 UTC (rev 126561) +++ zdaemon/trunk/src/zdaemon/README.txt2012-06-04 14:17:09 UTC (rev 126562) @@ -398,6 +398,16 @@ status code in this list makes zdaemon give up. To disable this, change the value to an empty list. +stop-timeout +Command-line option: -T or --stop-timeout SECONDS + +This defaults to 500 seconds (5 minutes). + +When a stop command is issued, a SIGTERM signal is sent to the +process. zdaemon waits for stop-timeout seconds for the +process to gracefully exit. If the process doesn't exit in +that time, a SIGKILL signal is sent. + user Command-line option: -u or --user. Modified: zdaemon/trunk/src/zdaemon/component.xml === --- zdaemon/trunk/src/zdaemon/component.xml 2012-06-04 13:06:20 UTC (rev 126561) +++ zdaemon/trunk/src/zdaemon/component.xml 2012-06-04 14:17:09 UTC (rev 126562) @@ -185,6 +185,17 @@ /description /key +key name=stop-timeout datatype=integer required=no default=300 + description +When a stop command is issued, a SIGTERM signal is sent to the +process. zdaemon waits for stop-timeout seconds for the +process to gracefully exit. If the process doesn't exit in +that time, a SIGKILL signal is sent. + +This defaults to 500 seconds (5 minutes). + /description +/key + key name=user datatype=string required=no description Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-06-04 13:06:20 UTC (rev 126561) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-06-04 14:17:09 UTC (rev 126562) @@ -38,13 +38,16 @@ zdaemon_loc = os.path.dirname(os.path.dirname(zdaemon.__file__)) zconfig_loc = os.path.dirname(os.path.dirname(ZConfig.__file__)) +def write(name, text): +with open(name, 'w') as f: +f.write(text) def make_sure_non_daemon_mode_doesnt_hang_when_program_exits(): The whole awhile bit that waits for a program to start whouldn't be used on non-daemon mode. - open('conf', 'w').write( + write('conf', ... ''' ... runner ... program sleep 1 @@ -60,7 +63,7 @@ If a program doesn't start, we don't want to wait for ever. - open('conf', 'w').write( + write('conf', ... ''' ... runner ... program sleep @@ -82,7 +85,7 @@ configuration arguments. To deal with this, we'll allow duplicate arguments that have the same values. - open('conf', 'w').write( + write('conf', ... ''' ... runner ... program sleep 10 @@ -99,6 +102,45 @@ +def test_stop_timeout(): +r + + write('t.py', +... ''' +... import time, signal +... signal.signal(signal.SIGTERM, lambda *a: None) +... while 1: time.sleep(9) +... ''') + + write('conf', +... ''' +... runner +... program %s t.py +... stop-timeout 1 +... /runner +... ''' % sys.executable) + + system(./zdaemon -Cconf start) +. . +daemon process started, pid=21446 + + import threading, time + thread = threading.Thread( +... target=system, args=(./zdaemon -Cconf stop,), +... kwargs=dict(quiet=True)) + thread.start() + time.sleep(.2) + + system(./zdaemon -Cconf status) +program running; pid=15372 + + thread.join(2) + + system(./zdaemon -Cconf status) +daemon manager not running + + + def setUp(test): test.globs['_td'] = td = [] here = os.getcwd() @@ -123,7 +165,7 @@ for f
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zd Simplified runner state management.
Log message for revision 126588: Simplified runner state management. Changed: U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdoptions.py U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-04 17:01:22 UTC (rev 126587) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-04 19:11:00 UTC (rev 126588) @@ -444,7 +444,6 @@ print umask: , oct(umask) print directory: , repr(self.options.directory) print logfile: , repr(self.options.logfile) -print hang_around: , repr(self.options.hang_around) def show_python(self): print Python info: Modified: zdaemon/trunk/src/zdaemon/zdoptions.py === --- zdaemon/trunk/src/zdaemon/zdoptions.py 2012-06-04 17:01:22 UTC (rev 126587) +++ zdaemon/trunk/src/zdaemon/zdoptions.py 2012-06-04 19:11:00 UTC (rev 126588) @@ -403,7 +403,6 @@ default=022) self.add(directory, runner.directory, z:, directory=, existing_parent_directory) -self.add(hang_around, runner.hang_around, default=0) def realize(self, *args, **kwds): ZDOptions.realize(self, *args, **kwds) Modified: zdaemon/trunk/src/zdaemon/zdrun.py === --- zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-04 17:01:22 UTC (rev 126587) +++ zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-04 19:11:00 UTC (rev 126588) @@ -382,16 +382,15 @@ # additionally recommends ignoring SIGHUP and forking again # after the setsid() call, for obscure SVR4 reasons. -mood = 1 # 1: up, 0: down, -1: suicidal +should_be_up = True delay = 0 # If nonzero, delay starting or killing until this time killing = 0 # If true, send SIGKILL when delay expires proc = None # Subprocess instance def runforever(self): self.logger.info(daemon manager started) -min_mood = not self.options.hang_around -while self.mood = min_mood or self.proc.pid: -if self.mood 0 and not self.proc.pid and not self.delay: +while self.should_be_up or self.proc.pid: +if self.should_be_up and not self.proc.pid and not self.delay: pid = self.proc.spawn() if not pid: # Can't fork. Try again later... @@ -519,7 +518,7 @@ self.sendreply(Unknown command %r; 'help' for a list % args[0]) def cmd_start(self, args): -self.mood = 1 # Up +self.should_be_up = True self.backoff = 0 self.delay = 0 self.killing = 0 @@ -530,7 +529,7 @@ self.sendreply(Application already started) def cmd_stop(self, args): -self.mood = 0 # Down +self.should_be_up = False self.backoff = 0 self.delay = 0 self.killing = 0 @@ -543,7 +542,7 @@ self.sendreply(Application already stopped) def cmd_restart(self, args): -self.mood = 1 # Up +self.should_be_up = True self.backoff = 0 self.delay = 0 self.killing = 0 @@ -556,21 +555,6 @@ self.proc.spawn() self.sendreply(Application started) -def cmd_exit(self, args): -self.mood = -1 # Suicidal -self.backoff = 0 -self.delay = 0 -self.killing = 0 -if self.proc.pid: -self.proc.kill(signal.SIGTERM) -self.sendreply(Sent SIGTERM; will exit later) -self.killing = 1 -self.delay = time.time() + self.options.backofflimit -else: -self.sendreply(Exiting now) -self.logger.info(Exiting) -sys.exit(0) - def cmd_kill(self, args): if args[1:]: try: @@ -596,7 +580,7 @@ status = running self.sendreply(status=%s\n % status + now=%r\n % time.time() + - mood=%d\n % self.mood + + should_be_up=%d\n % self.should_be_up + delay=%r\n % self.delay + backoff=%r\n % self.backoff + lasttime=%r\n % self.proc.lasttime + ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zdrun.py sorted imports :)
Log message for revision 126589: sorted imports :) Changed: U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/src/zdaemon/zdrun.py === --- zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-04 19:11:00 UTC (rev 126588) +++ zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-04 20:54:58 UTC (rev 126589) @@ -54,16 +54,16 @@ but you want the daemon manager to keep trying. -import os -import sys -import time +from stat import ST_MODE import errno import logging -import socket +import os import select import signal +import socket +import sys import threading -from stat import ST_MODE +import time if __name__ == __main__: # Add the parent of the script directory to the module search path ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zdctl.py whitespace
Log message for revision 126590: whitespace Changed: U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-04 20:54:58 UTC (rev 126589) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-04 21:28:54 UTC (rev 126590) @@ -16,7 +16,7 @@ Usage: python zdctl.py [-C URL] [-S schema.xml] [-h] [-p PROGRAM] [zdrun-options] [action [arguments]] - + Options: -C/--configure URL -- configuration file or URL -S/--schema XML Schema -- XML schema for configuration file @@ -76,9 +76,9 @@ class ZDCtlOptions(RunnerOptions): - + __doc__ = __doc__ - + positional_args_allowed = True def __init__(self): @@ -102,7 +102,7 @@ self.add(prompt, runner.prompt, default=(programname + )) def realize(self, *args, **kwds): - + RunnerOptions.realize(self, *args, **kwds) # Maybe the config file requires -i or positional args ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zd Cleaned up plumbing of stop-timeout
Log message for revision 126591: Cleaned up plumbing of stop-timeout Changed: U zdaemon/trunk/src/zdaemon/zdoptions.py U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/src/zdaemon/zdoptions.py === --- zdaemon/trunk/src/zdaemon/zdoptions.py 2012-06-04 21:28:54 UTC (rev 126590) +++ zdaemon/trunk/src/zdaemon/zdoptions.py 2012-06-05 13:28:57 UTC (rev 126591) @@ -389,8 +389,6 @@ ZDOptions.__init__(self) self.add(backofflimit, runner.backoff_limit, b:, backoff-limit=, int, default=10) -self.add(stoptimeut, runner.stop_timeout, - T:, stop-timeout=, int, default=300) self.add(daemon, runner.daemon, d, daemon, flag=1, default=1) self.add(forever, runner.forever, f, forever, flag=1, default=0) Modified: zdaemon/trunk/src/zdaemon/zdrun.py === --- zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-04 21:28:54 UTC (rev 126590) +++ zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-05 13:28:57 UTC (rev 126591) @@ -99,6 +99,7 @@ handler=self.set_schemafile) self.add(transcript, runner.transcript, t:, transcript=, default=/dev/null) +self.add(stoptimeut, runner.stop_timeout) def set_schemafile(self, file): self.schemafile = file ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zdrun.py Removed confusing usage info that humans never see and that was a
Log message for revision 126592: Removed confusing usage info that humans never see and that was a massive DRY violation. Changed: U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/src/zdaemon/zdrun.py === --- zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-05 13:28:57 UTC (rev 126591) +++ zdaemon/trunk/src/zdaemon/zdrun.py 2012-06-05 13:32:14 UTC (rev 126592) @@ -15,43 +15,6 @@ zrdun -- run an application as a daemon. Usage: python zrdun.py [zrdun-options] program [program-arguments] - -Options: --C/--configure URL -- configuration file or URL --S/--schema XML Schema -- XML schema for configuration file --b/--backoff-limit SECONDS -- set backoff limit to SECONDS (default 10) --d/--daemon -- run as a proper daemon; fork a subprocess, setsid(), etc. --f/--forever -- run forever (by default, exit when backoff limit is exceeded) --h/--help -- print this usage message and exit --s/--socket-name SOCKET -- Unix socket name for client (default zdsock) --u/--user USER -- run as this user (or numeric uid) --m/--umask UMASK -- use this umask for daemon subprocess (default is 022) --t/--transcript FILE -- transript of output from daemon-mode program --x/--exit-codes LIST -- list of fatal exit codes (default 0,2) --z/--directory DIRECTORY -- directory to chdir to when using -d (default off) -program [program-arguments] -- an arbitrary application to run - -This daemon manager has two purposes: it restarts the application when -it dies, and (when requested to do so with the -d option) it runs the -application in the background, detached from the foreground tty -session that started it (if any). - -Exit codes: if at any point the application exits with an exit status -listed by the -x option, it is not restarted. Any other form of -termination (either being killed by a signal or exiting with an exit -status not listed in the -x option) causes it to be restarted. - -Backoff limit: when the application exits (nearly) immediately after a -restart, the daemon manager starts slowing down by delaying between -restarts. The delay starts at 1 second and is increased by one on -each restart up to the backoff limit given by the -b option; it is -reset when the application runs for more than the backoff limit -seconds. By default, when the delay reaches the backoff limit, the -daemon manager exits (under the assumption that the application has a -persistent fault). The -f (forever) option prevents this exit; use it -when you expect that a temporary external problem (such as a network -outage or an overfull disk) may prevent the application from starting -but you want the daemon manager to keep trying. from stat import ST_MODE ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zdctl.py Organized usage a little, including removing a dup.
Log message for revision 126594: Organized usage a little, including removing a dup. Changed: U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-05 13:38:15 UTC (rev 126593) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-05 13:43:53 UTC (rev 126594) @@ -18,16 +18,15 @@ [zdrun-options] [action [arguments]] Options: --C/--configure URL -- configuration file or URL --S/--schema XML Schema -- XML schema for configuration file --h/--help -- print usage message and exit -b/--backoff-limit SECONDS -- set backoff limit to SECONDS (default 10) +-C/--configure URL -- configuration file or URL -d/--daemon -- run as a proper daemon; fork a subprocess, close files etc. -f/--forever -- run forever (by default, exit when backoff limit is exceeded) -h/--help -- print this usage message and exit -i/--interactive -- start an interactive shell after executing commands -l/--logfile -- log file to be read by logtail command -p/--program PROGRAM -- the program to run +-S/--schema XML Schema -- XML schema for configuration file -s/--socket-name SOCKET -- Unix socket name for client (default zdsock) -u/--user USER -- run as this user (or numeric uid) -m/--umask UMASK -- use this umask for daemon subprocess (default is 022) ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/zdctl.py Made an untested fix to the untested interactive quit command,
Log message for revision 126597: Made an untested fix to the untested interactive quit command, which I hope to remove soon. It previously send an exit command, which has the same semantics as stop and was removed recently. Changed: U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-05 15:03:56 UTC (rev 126596) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-05 15:39:33 UTC (rev 126597) @@ -569,7 +569,7 @@ print daemon manager not running elif not self.zd_pid: print daemon process not running; stopping daemon manager -self.send_action(exit) +self.send_action(stop) self.awhile(lambda: not self.zd_up, daemon manager stopped) else: print daemon process and daemon manager still running ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ - Added an option, ``start-test-program`` to supply a test command to
Log message for revision 126598: - Added an option, ``start-test-program`` to supply a test command to test whether the program managed by zdaemon is up and operational, rather than just running. When starting a program, the start command doesn't return until the test passes. You could, for example, use this to wait until a web server is actually accepting connections. - Added a ``start-timeout`` option to error if a program takes too long to start. This is especially useful in combination with the ``start-test-program`` option. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/README.txt U zdaemon/trunk/src/zdaemon/component.xml U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdrun.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-05 15:39:33 UTC (rev 126597) +++ zdaemon/trunk/CHANGES.txt 2012-06-05 16:37:12 UTC (rev 126598) @@ -5,6 +5,17 @@ 3.0.0 (unreleased) == +- Added an option, ``start-test-program`` to supply a test command to + test whether the program managed by zdaemon is up and operational, + rather than just running. When starting a program, the start + command doesn't return until the test passes. You could, for + example, use this to wait until a web server is actually accepting + connections. + +- Added a ``start-timeout`` option to error if a program takes too long to + start. This is especially useful in combination with the + ``start-test-program`` option. + - Added a separate option, stop-timout, to control how long to wait for a graceful shutdown. Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2012-06-05 15:39:33 UTC (rev 126597) +++ zdaemon/trunk/src/zdaemon/README.txt2012-06-05 16:37:12 UTC (rev 126598) @@ -285,6 +285,18 @@ open('log.1').read() 'rec 1\nrec 2\n' +Start test program and timeout +== + +Normally, zdaemon considers a process to have started when the process +itself has been created. A process may take a while before it is +truly up and running. For example, a database server or a web server +may take time before they're ready to accept requests. + +You can optionally supply a test program, via the ``start-test-program`` +configuration option, that is called repeatedly until it returns a 0 +exit status or until a time limit, ``start-timeout``, has been reached. + Reference Documentation === @@ -398,9 +410,19 @@ status code in this list makes zdaemon give up. To disable this, change the value to an empty list. +start-test-program +A command that tests whether the program is up and running. +The command should exit with a zero exit statis if the program +is running and with a non-zero status otherwise. + +start-timeout +Command-line option: -T or --start-timeout. + +If the program takes more than ``start-timeout`` seconds to +start, then an error is printed and the control script will +exit with a non-zero exit status. + stop-timeout -Command-line option: -T or --stop-timeout SECONDS - This defaults to 500 seconds (5 minutes). When a stop command is issued, a SIGTERM signal is sent to the Modified: zdaemon/trunk/src/zdaemon/component.xml === --- zdaemon/trunk/src/zdaemon/component.xml 2012-06-05 15:39:33 UTC (rev 126597) +++ zdaemon/trunk/src/zdaemon/component.xml 2012-06-05 16:37:12 UTC (rev 126598) @@ -185,6 +185,39 @@ /description /key +key name=start-test-program datatype=string-list + required=no + description +Command-line option: -p or --program (zdctl.py only). + +This option gives the command used to start the subprocess +managed by zdrun.py. This is currently a simple list of +whitespace-delimited words. The first word is the program +file, subsequent words are its command line arguments. If the +program file contains no slashes, it is searched using $PATH. +(XXX There is no way to to include whitespace in the program +file or an argument, and under certain circumstances other +shell metacharacters are also a problem, e.g. the foreground +command of zdctl.py.) + +NOTE: zdrun.py doesn't use this option; it uses its positional +arguments. Rather, zdctl.py uses this option to determine the +positional argument with which to invoke zdrun.py. (XXX This +could be better.) + /description +/key + +key name=start-timeout datatype=integer required=no + default=300 +
[Zope-Checkins] SVN: zdaemon/branches/2/ make a v2 release branch, as trunk is viverging somewhat
Log message for revision 126632: make a v2 release branch, as trunk is viverging somewhat Changed: A zdaemon/branches/2/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.5/ tag
Log message for revision 126673: tag Changed: A zdaemon/tags/2.0.5/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.5/setup.py version
Log message for revision 126674: version Changed: U zdaemon/tags/2.0.5/setup.py -=- Modified: zdaemon/tags/2.0.5/setup.py === --- zdaemon/tags/2.0.5/setup.py 2012-06-07 19:57:05 UTC (rev 126673) +++ zdaemon/tags/2.0.5/setup.py 2012-06-07 19:57:50 UTC (rev 126674) @@ -39,7 +39,7 @@ name = zdaemon setup( name=name, -version = '2.0.5dev', +version = '2.0.5', url=http://www.python.org/pypi/zdaemon;, license=ZPL 2.1, description= ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/branches/2/CHANGES.txt Gaaaaaa, released trunk as 2.0.5.
Log message for revision 126675: Gaa, released trunk as 2.0.5. Changed: U zdaemon/branches/2/CHANGES.txt -=- Modified: zdaemon/branches/2/CHANGES.txt === --- zdaemon/branches/2/CHANGES.txt 2012-06-07 19:57:50 UTC (rev 126674) +++ zdaemon/branches/2/CHANGES.txt 2012-06-07 19:59:42 UTC (rev 126675) @@ -2,7 +2,7 @@ Changelog === -2.0.5 (2012-06-07) +2.0.6 (2012-06-07) == - Fixed: When the ``user`` option was used to run as a particular ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.6/ tag
Log message for revision 126676: tag Changed: A zdaemon/tags/2.0.6/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.6/2/ tag
Log message for revision 126677: tag Changed: A zdaemon/tags/2.0.6/2/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.6/2/ oops
Log message for revision 126678: oops Changed: D zdaemon/tags/2.0.6/2/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.6/setup.py version
Log message for revision 126679: version Changed: U zdaemon/tags/2.0.6/setup.py -=- Modified: zdaemon/tags/2.0.6/setup.py === --- zdaemon/tags/2.0.6/setup.py 2012-06-07 20:02:46 UTC (rev 126678) +++ zdaemon/tags/2.0.6/setup.py 2012-06-07 20:03:24 UTC (rev 126679) @@ -38,7 +38,7 @@ name = zdaemon setup( name=name, -version = '2.0.4', +version = '2.0.6', url=http://www.python.org/pypi/zdaemon;, license=ZPL 2.1, description= ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: When the ``user`` option was used to run as a particular
Log message for revision 126681: Fixed: When the ``user`` option was used to run as a particular user, supplemental groups weren't set to the user's supplemental groups. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/README.txt U zdaemon/trunk/setup.py A zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdoptions.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/CHANGES.txt 2012-06-07 20:52:43 UTC (rev 126681) @@ -22,7 +22,18 @@ Previously, this was controlled by backoff-limit, which didn't make much sense. +2.0.6 (2012-06-07) +== +- Fixed: When the ``user`` option was used to run as a particular + user, supplemental groups weren't set to the user's supplemental + groups. + +2.0.5 (2012-06-07) +== + +(Accidental release. Please ignore.) + 2.0.4 (2009-04-20) == Modified: zdaemon/trunk/README.txt === --- zdaemon/trunk/README.txt2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/README.txt2012-06-07 20:52:43 UTC (rev 126681) @@ -2,10 +2,7 @@ ``zdaemon`` process controller for Unix-based systems * -`zdaemon` is a Python package which provides APIs for managing applications -run as daemons. Its principal use to date has been to manage the application -server and storage server daemons for Zope / ZEO, although it is not limited -to running Python-based applications (for instance, it has been used to -manage the 'spread' daemon). +``zdaemon`` is a Unix (Unix, Linux, Mac OS X) Python program that wraps +commands to make them behave as proper daemons. .. contents:: Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2012-06-07 20:34:56 UTC (rev 126680) +++ zdaemon/trunk/setup.py 2012-06-07 20:52:43 UTC (rev 126681) @@ -30,7 +30,7 @@ include_package_data = True, install_requires=[ZConfig], extras_require=dict( -test=['zope.testing', 'manuel', 'zc.customdoctests']), +test=['zope.testing', 'manuel', 'zc.customdoctests', 'mock']), ) except ImportError: from distutils.core import setup Copied: zdaemon/trunk/src/zdaemon/tests/testuser.py (from rev 126680, zdaemon/branches/2/src/zdaemon/tests/testuser.py) === --- zdaemon/trunk/src/zdaemon/tests/testuser.py (rev 0) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-07 20:52:43 UTC (rev 126681) @@ -0,0 +1,111 @@ +## +# +# Copyright (c) 2010 Zope Foundation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## + +# Test user and groups options + +from zope.testing import setupstack +import doctest +import mock +import os +import sys +import unittest +import zdaemon.zdctl + +def write(name, text): +with open(name, 'w') as f: +f.write(text) + +class O: +def __init__(self, **kw): +self.__dict__.update(kw) + +def test_user_fails_when_not_root(): + + + write('conf', +... ''' +... runner +... program sleep 9 +... user zope +... /runner +... ''') + + with mock.patch('os.geteuid') as geteuid: +... with mock.patch('sys.stderr'): +... sys.stderr = sys.stdout +... geteuid.return_value = 42 +... try: +... zdaemon.zdctl.main(['-C', 'conf', 'status']) +... except SystemExit: +... pass +... else: +... print 'oops' +... # doctest: +ELLIPSIS +Error: only root can use -u USER to change users +For help, use ... -h + + import pwd + pwd.getpwnam.assert_called_with('zope') + + + +def test_user_sets_supplemtary_groups(): + + + write('conf', +... ''' +... runner +... program sleep 9 +... user zope +... /runner +... ''') + + import grp + grp.getgrall.return_value = [ +... O(gr_gid=8, gr_mem =['g', 'zope', ]), +... O(gr_gid=1, gr_mem =['a', 'x', ]), +... O(gr_gid=2, gr_mem =['b', 'x', 'zope']), +... O(gr_gid=5, gr_mem =['c', 'x', ]), +...
[Zope-Checkins] SVN: zdaemon/trunk/ Several undocunented, untested, and presumeably unused features were removed.
Log message for revision 126682: Several undocunented, untested, and presumeably unused features were removed. (I suspect that some of the remaining features are untested, :(, but I can imagine using them.) Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/testzdrun.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-07 20:52:43 UTC (rev 126681) +++ zdaemon/trunk/CHANGES.txt 2012-06-07 21:34:23 UTC (rev 126682) @@ -22,6 +22,8 @@ Previously, this was controlled by backoff-limit, which didn't make much sense. +- Several undocunented, untested, and presumeably unused features were removed. + 2.0.6 (2012-06-07) == Modified: zdaemon/trunk/src/zdaemon/tests/testzdrun.py === --- zdaemon/trunk/src/zdaemon/tests/testzdrun.py2012-06-07 20:52:43 UTC (rev 126681) +++ zdaemon/trunk/src/zdaemon/tests/testzdrun.py2012-06-07 21:34:23 UTC (rev 126682) @@ -385,7 +385,7 @@ def testDirectoryChown(self): path = os.path.join(self.root, 'foodir') options = zdctl.ZDCtlOptions() -options.realize(['-p', self.cmd]) +options.realize(['-p', self.cmd, 'status']) cmd = zdctl.ZDCmd(options) options.uid = 27 options.gid = 28 Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-07 20:52:43 UTC (rev 126681) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-07 21:34:23 UTC (rev 126682) @@ -23,7 +23,6 @@ -d/--daemon -- run as a proper daemon; fork a subprocess, close files etc. -f/--forever -- run forever (by default, exit when backoff limit is exceeded) -h/--help -- print this usage message and exit --i/--interactive -- start an interactive shell after executing commands -l/--logfile -- log file to be read by logtail command -p/--program PROGRAM -- the program to run -S/--schema XML Schema -- XML schema for configuration file @@ -35,10 +34,7 @@ -z/--directory DIRECTORY -- directory to chdir to when using -d (default off) action [arguments] -- see below -Actions are commands like start, stop and status. If -i is -specified or no action is specified on the command line, a shell -interpreting actions typed interactively is started (unless the -configuration option default_to_interactive is set to false). Use the +Actions are commands like start, stop and status. Use the action help to find out about available actions. @@ -86,11 +82,6 @@ self.add(schemafile, short=S:, long=schema=, default=schema.xml, handler=self.set_schemafile) -self.add(interactive, None, i, interactive, flag=1) -self.add(default_to_interactive, runner.default_to_interactive, - default=1) -self.add(default_to_interactive, runner.default_to_interactive, - default=1) self.add(program, runner.program, p:, program=, handler=string_list, required=no program specified; use -p or -C) @@ -110,10 +101,8 @@ RunnerOptions.realize(self, *args, **kwds) # Maybe the config file requires -i or positional args -if not self.args and not self.interactive: -if not self.default_to_interactive: -self.usage(either -i or an action argument is required) -self.interactive = 1 +if not self.args: +self.usage(an action argument is required) # Where's python? if not self.python: @@ -261,14 +250,6 @@ print help -- Print a list of available actions. print help action -- Print help for action. -def do_EOF(self, arg): -print -return 1 - -def help_EOF(self): -print To quit, type ^D or use the quit command. - - def _start_cond(self, n): if (n self.options.start_timeout): print '\nProgram took too long to start' @@ -444,9 +425,6 @@ print zdctl/zdrun options: print schemafile: , repr(self.options.schemafile) print configfile: , repr(self.options.configfile) -print interactive: , repr(self.options.interactive) -print default_to_interactive:, -print repr(self.options.default_to_interactive) print zdrun: , repr(self.options.zdrun) print python: , repr(self.options.python) print program: , repr(self.options.program) @@ -487,17 +465,6 @@ print show python -- show Python version and details print show all -- show all of the above -def complete_show(self, text, *ignored): -options = [options, python, all] -return [x for x in options if x.startswith(text)]
[Zope-Checkins] SVN: zdaemon/trunk/CHANGES.txt tweaks
Log message for revision 126689: tweaks Changed: U zdaemon/trunk/CHANGES.txt -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-08 13:50:52 UTC (rev 126688) +++ zdaemon/trunk/CHANGES.txt 2012-06-08 13:54:59 UTC (rev 126689) @@ -1,5 +1,5 @@ === - Changelog + Change log === 3.0.0 (unreleased) @@ -16,13 +16,13 @@ start. This is especially useful in combination with the ``start-test-program`` option. -- Added a separate option, stop-timout, to control how long to wait +- Added an option, stop-timeout, to control how long to wait for a graceful shutdown. Previously, this was controlled by backoff-limit, which didn't make much sense. -- Several undocunented, untested, and presumeably unused features were removed. +- Several undocumented, untested, and presumably unused features were removed. 2.0.6 (2012-06-07) == @@ -61,7 +61,7 @@ Bugs Fixed -- -- No longer uses a hardcoded filename (/tmp/demo.zdsock) in unit tests. +- No longer uses a hard-coded file name (/tmp/demo.zdsock) in unit tests. This lets you run the tests on Python 2.4 and 2.5 simultaneously without spurious errors. @@ -132,7 +132,7 @@ - In non-daemon mode, start hung, producing annoying dots when the program exited. -- The start command hung producing annoying dots if the deamon failed +- The start command hung producing annoying dots if the daemon failed to start. - foreground and start had different semantics because one used @@ -149,10 +149,10 @@ - zdctl now invokes itself to run zdrun. This means that it's no-longer necessary to generate a separate zdrun script. This especially when the magic techniques to find and run zdrun using - directory sniffing fail to set the path corrrectly. + directory sniffing fail to set the path correctly. -- The daemon mode is now enabled by default. To get non-deamon mode, - you have to use a configuration file and set deamon to off +- The daemon mode is now enabled by default. To get non-daemon mode, + you have to use a configuration file and set daemon to off there. The old -d option is kept for backward compatibility, but is a no-op. @@ -183,7 +183,7 @@ has a path so long that the test socket can't be created. o Changed management of 'donothing.sh'. This script is now created by - the test in the temporarary directory with the necessary + the test in the temporarily directory with the necessary permissions. This is to avoids possible mangling of permissions leading to spurious test failures. It also avoids management of a file in the source tree, which is a bonus. ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.0/ tag
Log message for revision 126690: tag Changed: A zdaemon/tags/3.0.0/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.0/setup.py Version.
Log message for revision 126691: Version. Changed: U zdaemon/tags/3.0.0/setup.py -=- Modified: zdaemon/tags/3.0.0/setup.py === --- zdaemon/tags/3.0.0/setup.py 2012-06-08 13:59:00 UTC (rev 126690) +++ zdaemon/tags/3.0.0/setup.py 2012-06-08 13:59:49 UTC (rev 126691) @@ -39,7 +39,7 @@ name = zdaemon setup( name=name, -version = '2.0.5dev', +version = '3.0.0', url=http://www.python.org/pypi/zdaemon;, license=ZPL 2.1, description= ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/setup.py Version.
Log message for revision 126692: Version. Changed: U zdaemon/trunk/setup.py -=- Modified: zdaemon/trunk/setup.py === --- zdaemon/trunk/setup.py 2012-06-08 13:59:49 UTC (rev 126691) +++ zdaemon/trunk/setup.py 2012-06-08 14:00:27 UTC (rev 126692) @@ -12,6 +12,8 @@ # ## +version = '0.0.0' + import os entry_points = @@ -39,7 +41,7 @@ name = zdaemon setup( name=name, -version = '2.0.5dev', +version = version, url=http://www.python.org/pypi/zdaemon;, license=ZPL 2.1, description= ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.7/ tag
Log message for revision 126693: tag Changed: A zdaemon/tags/2.0.7/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.7/ oops
Log message for revision 126694: oops Changed: D zdaemon/tags/2.0.7/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/branches/2/setup.py version
Log message for revision 126695: version Changed: U zdaemon/branches/2/setup.py -=- Modified: zdaemon/branches/2/setup.py === --- zdaemon/branches/2/setup.py 2012-06-08 17:17:10 UTC (rev 126694) +++ zdaemon/branches/2/setup.py 2012-06-08 17:19:06 UTC (rev 126695) @@ -12,6 +12,8 @@ # ## +version = '0.0.0' + import os entry_points = @@ -38,7 +40,7 @@ name = zdaemon setup( name=name, -version = '2.0.4', +version = version, url=http://www.python.org/pypi/zdaemon;, license=ZPL 2.1, description= ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/branches/2/ Fixed:
Log message for revision 126696: Fixed: The change in 2.0.6 to set a user's supplemental groups broke common configurations in which the effective user was set via ``su`` or ``sudo -u`` prior to invoking zdaemon. Now, zdaemon doesn't set groups or the effective user if the effective user is already set to the configured user. Changed: U zdaemon/branches/2/CHANGES.txt U zdaemon/branches/2/src/zdaemon/tests/testuser.py U zdaemon/branches/2/src/zdaemon/zdctl.py U zdaemon/branches/2/src/zdaemon/zdoptions.py -=- Modified: zdaemon/branches/2/CHANGES.txt === --- zdaemon/branches/2/CHANGES.txt 2012-06-08 17:19:06 UTC (rev 126695) +++ zdaemon/branches/2/CHANGES.txt 2012-06-08 17:19:44 UTC (rev 126696) @@ -2,6 +2,18 @@ Changelog === +2.0.7 (2012-06-08) +== + +- Fixed: + + The change in 2.0.6 to set a user's supplemental groups broke common + configurations in which the effective user was set via ``su`` or + ``sudo -u`` prior to invoking zdaemon. + + Now, zdaemon doesn't set groups or the effective user if the + effective user is already set to the configured user. + 2.0.6 (2012-06-07) == Modified: zdaemon/branches/2/src/zdaemon/tests/testuser.py === --- zdaemon/branches/2/src/zdaemon/tests/testuser.py2012-06-08 17:19:06 UTC (rev 126695) +++ zdaemon/branches/2/src/zdaemon/tests/testuser.py2012-06-08 17:19:44 UTC (rev 126696) @@ -96,10 +96,36 @@ +def test_do_nothing_if_effective_user_is_configured_user(): + + + write('conf', +... ''' +... runner +... program sleep 9 +... user zope +... /runner +... ''') + + with mock.patch('os.geteuid') as geteuid: +... geteuid.return_value = 99 +... zdaemon.zdctl.main(['-C', 'conf', 'status']) +... os.geteuid.assert_called_with() +daemon manager not running + + import pwd, os, grp + pwd.getpwnam.assert_called_with('zope') + _ = grp.getgrall.assert_not_called() + _ = os.setuid.assert_not_called() + _ = os.setgid.assert_not_called() + _ = os.setgroups.assert_not_called() + + + def setUp(test): setupstack.setUpDirectory(test) getpwname = setupstack.context_manager(test, mock.patch('pwd.getpwnam')) -getpwname.return_value = O(pw_gid=5, pw_uid=99) +getpwname.return_value = O(pw_gid=5, pw_uid=99, pw_name='zope') setupstack.context_manager(test, mock.patch('os.geteuid')).return_value = 0 setupstack.context_manager(test, mock.patch('grp.getgrall')) setupstack.context_manager(test, mock.patch('os.setgroups')) Modified: zdaemon/branches/2/src/zdaemon/zdctl.py === --- zdaemon/branches/2/src/zdaemon/zdctl.py 2012-06-08 17:19:06 UTC (rev 126695) +++ zdaemon/branches/2/src/zdaemon/zdctl.py 2012-06-08 17:19:44 UTC (rev 126696) @@ -173,15 +173,43 @@ os.chown(directory, self.options.uid, self.options.gid) def set_uid(self): -if self.options.uid is None: +user = self.options.user +if user is None: return -uid = os.geteuid() -if uid != 0 and uid != self.options.uid: -self.options.usage(only root can use -u USER to change users) -os.setgid(self.options.gid) -os.setgroups(self.options.groups) -os.setuid(self.options.uid) +import pwd +try: +uid = int(user) +except ValueError: +try: +pwrec = pwd.getpwnam(user) +except KeyError: +self.options.usage(username %r not found % user) +uid = pwrec.pw_uid +else: +try: +pwrec = pwd.getpwuid(uid) +except KeyError: +self.options.usage(uid %r not found % user) + +# See if we're already that user: +euid = os.geteuid() +if euid != 0: +if euid != uid: +self.options.usage(only root can use -u USER to change users) +return + +# OK, we have to set user and groups: +os.setgid(pwrec.pw_gid) + +import grp +user = pwrec.pw_name +os.setgroups( +sorted(g.gr_gid for g in grp.getgrall() # sort for tests + if user in g.gr_mem) +) +os.setuid(uid) + def emptyline(self): # We don't want a blank line to repeat the last command. # Showing status is a nice alternative. Modified: zdaemon/branches/2/src/zdaemon/zdoptions.py === --- zdaemon/branches/2/src/zdaemon/zdoptions.py 2012-06-08 17:19:06 UTC (rev 126695) +++ zdaemon/branches/2/src/zdaemon/zdoptions.py 2012-06-08 17:19:44 UTC (rev 126696) @@ -400,31 +400,7 @@
[Zope-Checkins] SVN: zdaemon/tags/2.0.7/ tag
Log message for revision 126697: tag Changed: A zdaemon/tags/2.0.7/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/2.0.7/setup.py version
Log message for revision 126698: version Changed: U zdaemon/tags/2.0.7/setup.py -=- Modified: zdaemon/tags/2.0.7/setup.py === --- zdaemon/tags/2.0.7/setup.py 2012-06-08 17:20:12 UTC (rev 126697) +++ zdaemon/tags/2.0.7/setup.py 2012-06-08 17:20:55 UTC (rev 126698) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '2.0.7' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed:
Log message for revision 126699: Fixed: The change in 2.0.6 to set a user's supplemental groups broke common configurations in which the effective user was set via ``su`` or ``sudo -u`` prior to invoking zdaemon. Now, zdaemon doesn't set groups or the effective user if the effective user is already set to the configured user. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py U zdaemon/trunk/src/zdaemon/zdoptions.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/CHANGES.txt 2012-06-08 17:52:02 UTC (rev 126699) @@ -1,10 +1,22 @@ -=== - Change log -=== +== +Change log +== -3.0.0 (unreleased) +3.0.1 (2012-06-08) == +- Fixed: + + The change in 2.0.6 to set a user's supplemental groups broke common + configurations in which the effective user was set via ``su`` or + ``sudo -u`` prior to invoking zdaemon. + + Now, zdaemon doesn't set groups or the effective user if the + effective user is already set to the configured user. + +3.0.0 (2012-06-08) +== + - Added an option, ``start-test-program`` to supply a test command to test whether the program managed by zdaemon is up and operational, rather than just running. When starting a program, the start Modified: zdaemon/trunk/src/zdaemon/tests/testuser.py === --- zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-06-08 17:52:02 UTC (rev 126699) @@ -96,10 +96,36 @@ +def test_do_nothing_if_effective_user_is_configured_user(): + + + write('conf', +... ''' +... runner +... program sleep 9 +... user zope +... /runner +... ''') + + with mock.patch('os.geteuid') as geteuid: +... geteuid.return_value = 99 +... zdaemon.zdctl.main(['-C', 'conf', 'status']) +... os.geteuid.assert_called_with() +daemon manager not running + + import pwd, os, grp + pwd.getpwnam.assert_called_with('zope') + _ = grp.getgrall.assert_not_called() + _ = os.setuid.assert_not_called() + _ = os.setgid.assert_not_called() + _ = os.setgroups.assert_not_called() + + + def setUp(test): setupstack.setUpDirectory(test) getpwname = setupstack.context_manager(test, mock.patch('pwd.getpwnam')) -getpwname.return_value = O(pw_gid=5, pw_uid=99) +getpwname.return_value = O(pw_gid=5, pw_uid=99, pw_name='zope') setupstack.context_manager(test, mock.patch('os.geteuid')).return_value = 0 setupstack.context_manager(test, mock.patch('grp.getgrall')) setupstack.context_manager(test, mock.patch('os.setgroups')) Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-08 17:20:55 UTC (rev 126698) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-06-08 17:52:02 UTC (rev 126699) @@ -166,15 +166,43 @@ os.chown(directory, self.options.uid, self.options.gid) def set_uid(self): -if self.options.uid is None: +user = self.options.user +if user is None: return -uid = os.geteuid() -if uid != 0 and uid != self.options.uid: -self.options.usage(only root can use -u USER to change users) -os.setgid(self.options.gid) -os.setgroups(self.options.groups) -os.setuid(self.options.uid) +import pwd +try: +uid = int(user) +except ValueError: +try: +pwrec = pwd.getpwnam(user) +except KeyError: +self.options.usage(username %r not found % user) +uid = pwrec.pw_uid +else: +try: +pwrec = pwd.getpwuid(uid) +except KeyError: +self.options.usage(uid %r not found % user) + +# See if we're already that user: +euid = os.geteuid() +if euid != 0: +if euid != uid: +self.options.usage(only root can use -u USER to change users) +return + +# OK, we have to set user and groups: +os.setgid(pwrec.pw_gid) + +import grp +user = pwrec.pw_name +os.setgroups( +sorted(g.gr_gid for g in grp.getgrall() # sort for tests + if user in g.gr_mem) +) +os.setuid(uid) + def emptyline(self): # We don't want a blank line to repeat the last command. # Showing status is a nice alternative. Modified: zdaemon/trunk/src/zdaemon/zdoptions.py === ---
[Zope-Checkins] SVN: zdaemon/tags/3.0.1/ tag
Log message for revision 126700: tag Changed: A zdaemon/tags/3.0.1/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.1/setup.py version
Log message for revision 126701: version Changed: U zdaemon/tags/3.0.1/setup.py -=- Modified: zdaemon/tags/3.0.1/setup.py === --- zdaemon/tags/3.0.1/setup.py 2012-06-08 17:55:58 UTC (rev 126700) +++ zdaemon/tags/3.0.1/setup.py 2012-06-08 17:56:42 UTC (rev 126701) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '3.0.1' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/CHANGES.txt *** empty log message ***
Log message for revision 127306: *** empty log message *** Changed: U zdaemon/trunk/CHANGES.txt -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-07-10 15:48:33 UTC (rev 127305) +++ zdaemon/trunk/CHANGES.txt 2012-07-10 16:44:47 UTC (rev 127306) @@ -2,6 +2,12 @@ Change log == +3.0.2 (2012-07-10) +== + +- Fixed: programs started with zdaemon couldn't, themselves, invoke + zdaemon. + 3.0.1 (2012-06-08) == ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.2/ tag
Log message for revision 127307: tag Changed: A zdaemon/tags/3.0.2/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.2/setup.py version
Log message for revision 127308: version Changed: U zdaemon/tags/3.0.2/setup.py -=- Modified: zdaemon/tags/3.0.2/setup.py === --- zdaemon/tags/3.0.2/setup.py 2012-07-10 16:45:20 UTC (rev 127307) +++ zdaemon/tags/3.0.2/setup.py 2012-07-10 16:46:05 UTC (rev 127308) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '3.0.2' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ - Fixed: programs started with zdaemon couldn't, themselves, invoke
Log message for revision 127309: - Fixed: programs started with zdaemon couldn't, themselves, invoke zdaemon. really Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/CHANGES.txt 2012-07-10 18:05:19 UTC (rev 127309) @@ -2,12 +2,17 @@ Change log == -3.0.2 (2012-07-10) +3.0.3 (2012-07-10) == - Fixed: programs started with zdaemon couldn't, themselves, invoke zdaemon. +3.0.2 (2012-07-10) +== + +Fail :( + 3.0.1 (2012-06-08) == Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-10 18:05:19 UTC (rev 127309) @@ -42,6 +42,10 @@ with open(name, 'w') as f: f.write(text) +def read(name): +with open(name) as f: +return f.read() + def make_sure_non_daemon_mode_doesnt_hang_when_program_exits(): The whole awhile bit that waits for a program to start @@ -243,6 +247,27 @@ daemon process stopped +def DAEMON_MANAGER_MODE_leak(): + +Zdaemon used an environment variable to flag that it's running in +daemon-manager mode, as opposed to UI mode. If this environment +variable is allowed to leak to the program, them the program will +be unable to invoke zdaemon correctly. + + write('c', ''' +... runner +... program env +... transcript t +... /runner +... ''') + + system('./zdaemon -b0 -T1 -Cc start', quiet=True) +Failed: 1 + 'DAEMON_MANAGER_MODE' not in read('t') +True + + + def setUp(test): test.globs['_td'] = td = [] here = os.getcwd() Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-10 16:46:05 UTC (rev 127308) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-10 18:05:19 UTC (rev 127309) @@ -603,6 +603,7 @@ args = sys.argv[1:] if os.environ.get('DAEMON_MANAGER_MODE'): +del os.environ['DAEMON_MANAGER_MODE'] import zdaemon.zdrun return zdaemon.zdrun.main(args) ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.3/ tag
Log message for revision 127310: tag Changed: A zdaemon/tags/3.0.3/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.3/setup.py version
Log message for revision 127311: version Changed: U zdaemon/tags/3.0.3/setup.py -=- Modified: zdaemon/tags/3.0.3/setup.py === --- zdaemon/tags/3.0.3/setup.py 2012-07-10 18:14:18 UTC (rev 127310) +++ zdaemon/tags/3.0.3/setup.py 2012-07-10 18:15:07 UTC (rev 127311) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '3.0.3' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: The start command exited with a zero exit status even when
Log message for revision 127404: Fixed: The start command exited with a zero exit status even when the program being started failed to start (or exited imediately). Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/tests/testuser.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/CHANGES.txt 2012-07-30 17:47:14 UTC (rev 127404) @@ -2,6 +2,12 @@ Change log == +3.0.4 (2012-07-30) +== + +- Fixed: The start command exited with a zero exit status even when + the program being started failed to start (or exited imediately). + 3.0.3 (2012-07-10) == Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-07-30 17:47:14 UTC (rev 127404) @@ -78,6 +78,7 @@ system(./zdaemon -Cconf start) . . daemon manager not running +Failed: 1 @@ -267,7 +268,49 @@ True +def nonzeo_exit_on_program_failure(): + + write('conf', +... ''' +... runner +... backoff-limit 1 +... program nosuch +... /runner +... ''') + system(./zdaemon -Cconf start, echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + + write('conf', +... ''' +... runner +... backoff-limit 1 +... program cat nosuch +... /runner +... ''') + + system(./zdaemon -Cconf start, echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + + write('conf', +... ''' +... runner +... backoff-limit 1 +... program pwd +... /runner +... ''') + + system(./zdaemon -Cconf start, echo=True) # doctest: +ELLIPSIS +./zdaemon... +daemon manager not running +Failed: 1 + + + def setUp(test): test.globs['_td'] = td = [] here = os.getcwd() @@ -292,7 +335,9 @@ for f in test.globs['_td']: f() -def system(command, input='', quiet=False): +def system(command, input='', quiet=False, echo=False): +if echo: +print command p = subprocess.Popen( command, shell=True, stdin=subprocess.PIPE, Modified: zdaemon/trunk/src/zdaemon/tests/testuser.py === --- zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/tests/testuser.py 2012-07-30 17:47:14 UTC (rev 127404) @@ -83,7 +83,8 @@ ... O(gr_gid=7, gr_mem =['h', ]), ... ] - zdaemon.zdctl.main(['-C', 'conf', 'status']) + with mock.patch('sys.exit'): +... zdaemon.zdctl.main(['-C', 'conf', 'status']) daemon manager not running import pwd, os @@ -108,6 +109,7 @@ ... ''') with mock.patch('os.geteuid') as geteuid: +... with mock.patch('sys.exit'): ... geteuid.return_value = 99 ... zdaemon.zdctl.main(['-C', 'conf', 'status']) ... os.geteuid.assert_called_with() Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-30 13:59:51 UTC (rev 127403) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-07-30 17:47:14 UTC (rev 127404) @@ -267,7 +267,7 @@ was_running = True elif (was_running or n 10) and not cond(n): print \ndaemon manager not running -return +return 1 except KeyboardInterrupt: print ^C @@ -318,9 +318,8 @@ print daemon process already running; pid=%d % self.zd_pid return if self.options.daemon: -self.awhile(self._start_cond, -daemon process started, pid=%(zd_pid)d, -) +return self.awhile( +self._start_cond, daemon process started, pid=%(zd_pid)d) def _get_override(self, opt, name, svalue=None, flag=0): value = getattr(self.options, name) @@ -611,7 +610,7 @@ options = ZDCtlOptions() options.realize(args) c = cmdclass(options) -c.onecmd( .join(options.args)) +sys.exit(c.onecmd( .join(options.args))) if __name__ == __main__: main() ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.4/ tag
Log message for revision 127405: tag Changed: A zdaemon/tags/3.0.4/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.4/setup.py *** empty log message ***
Log message for revision 127406: *** empty log message *** Changed: U zdaemon/tags/3.0.4/setup.py -=- Modified: zdaemon/tags/3.0.4/setup.py === --- zdaemon/tags/3.0.4/setup.py 2012-07-30 17:48:04 UTC (rev 127405) +++ zdaemon/tags/3.0.4/setup.py 2012-07-30 17:48:55 UTC (rev 127406) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '3.0.4' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/ Fixed: the status command didn't return a non-zero exit status when
Log message for revision 128449: Fixed: the status command didn't return a non-zero exit status when the program wasn't running. This made it impossible for other software (e.g. Puppet) to tell if a process was running. Changed: U zdaemon/trunk/CHANGES.txt U zdaemon/trunk/src/zdaemon/README.txt U zdaemon/trunk/src/zdaemon/tests/tests.py U zdaemon/trunk/src/zdaemon/zdctl.py -=- Modified: zdaemon/trunk/CHANGES.txt === --- zdaemon/trunk/CHANGES.txt 2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/CHANGES.txt 2012-11-27 22:37:20 UTC (rev 128449) @@ -2,6 +2,13 @@ Change log == +3.0.5 (2012-11-27) +== + +- Fixed: the status command didn't return a non-zero exit status when + the program wasn't running. This made it impossible for other + software (e.g. Puppet) to tell if a process was running. + 3.0.4 (2012-07-30) == Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/README.txt2012-11-27 22:37:20 UTC (rev 128449) @@ -72,6 +72,7 @@ sh ./zdaemon -p 'sleep 100' status daemon manager not running +Failed: 3 Normally, we control zdaemon using a configuration file. Let's create a typical configuration file:: Modified: zdaemon/trunk/src/zdaemon/tests/tests.py === --- zdaemon/trunk/src/zdaemon/tests/tests.py2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/tests/tests.py2012-11-27 22:37:20 UTC (rev 128449) @@ -143,6 +143,7 @@ system(./zdaemon -Cconf status) daemon manager not running +Failed: 3 Modified: zdaemon/trunk/src/zdaemon/zdctl.py === --- zdaemon/trunk/src/zdaemon/zdctl.py 2012-11-27 18:10:32 UTC (rev 128448) +++ zdaemon/trunk/src/zdaemon/zdctl.py 2012-11-27 22:37:20 UTC (rev 128449) @@ -420,18 +420,21 @@ print wait -- Wait for the daemon process to exit. def do_status(self, arg=): +status = 0 if arg not in [, -l]: print status argument must be absent or -l -return +return 1 self.get_status() if not self.zd_up: print daemon manager not running +status = 3 elif not self.zd_pid: print daemon manager running; daemon process not running else: print program running; pid=%d % self.zd_pid if arg == -l and self.zd_status: print self.zd_status +return status def help_status(self): print status [-l] -- Print status for the daemon process. ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.5/ tag
Log message for revision 128450: tag Changed: A zdaemon/tags/3.0.5/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/tags/3.0.5/setup.py version
Log message for revision 128451: version Changed: U zdaemon/tags/3.0.5/setup.py -=- Modified: zdaemon/tags/3.0.5/setup.py === --- zdaemon/tags/3.0.5/setup.py 2012-11-27 22:37:58 UTC (rev 128450) +++ zdaemon/tags/3.0.5/setup.py 2012-11-27 22:38:29 UTC (rev 128451) @@ -12,7 +12,7 @@ # ## -version = '0.0.0' +version = '3.0.5' import os ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/README.txt typo
Log message for revision 128562: typo Changed: U zdaemon/trunk/src/zdaemon/README.txt -=- Modified: zdaemon/trunk/src/zdaemon/README.txt === --- zdaemon/trunk/src/zdaemon/README.txt2012-12-10 18:38:54 UTC (rev 128561) +++ zdaemon/trunk/src/zdaemon/README.txt2012-12-10 18:46:07 UTC (rev 128562) @@ -424,7 +424,7 @@ exit with a non-zero exit status. stop-timeout -This defaults to 500 seconds (5 minutes). +This defaults to 300 seconds (5 minutes). When a stop command is issued, a SIGTERM signal is sent to the process. zdaemon waits for stop-timeout seconds for the ___ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope] dtml-in Tag problem
A traceback is always helpful and would have been useful. Is it possible that there is a 3rd, empty item, or an item with no ^, in "related_stories"? An empty item when split would return only 1 subitem and your code is assuming you will always have two. A test for the ^ in the item before splitting would prevent this. Try this: ... dtml-if "_.string.find(['sequence-item'],'^')!=-1" dtml-let si=sequence-item rs_name_url="_.string.split( si, '^' )" rs_name="rs_name_url[0]" rs_url="rs_name_url[1]" li a href="http://dtml-var rs_url"dtml-var rs_name/a/li /dtml-let /dtml-if ... Jim Sanford - Original Message - From: "Tom Scheidt" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 22, 2000 3:58 PM Subject: [Zope] dtml-in Tag problem dtml-if related_stories table width=175 height=2 cellpadding=0 cellspacing=0 border=0 trtd font/font /td/tr /table table width=175 cellpadding=0 cellspacing=0 border=0 bgcolor="#e7e7e7" trtd valign=top font size=2 bRelated Stories/bbr /font font size=2 dtml-in related_stories dtml-let si=sequence-item rs_name_url="_.string.split( si, '^' )" rs_name="rs_name_url[0]" rs_url="rs_name_url[1]" li a href="http://dtml-var rs_url"dtml-var rs_name/a/li /dtml-let /dtml-in /font /td/tr /table /dtml-if gives me an error that says: "list index out of range" The related_stories property contains: King Kong website^www.kong.com Empire State Building Website^www.empirestate.com It worked at first but when I made any changes to other properties it gave me that error message. Any ideas? Tom Scheidt | www.falsemirror.com | [EMAIL PROTECTED] --- ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how do I get field names from a query
You need an external method to get the dictionary object that has the field name to column number Here is the external method: - def doPySQL(self, zQry) : tvar1 = 'res=self.'+zQry exec tvar1 return res._schema.items() -- Here is a dtml document that uses the external method: (getRes is what I call the external method in Zope) This was for proof of idea - it is not pretty --- htmlheadtitleTest/title/headbody dtml-with "_.namespace(t1=getRes('Your_Query_Here()'))" dtml-var "_.len(t1)" Columnsbr dtml-var "_.str(t1)" html_quotebrbr dtml-in t1 dtml-var "_.str(_['sequence-key'])" = dtml-var "_.str(_['sequence-item'])"br /dtml-in brbr /dtml-with /body/html /dtml-comment htmlheadtitleTest/title/headbody dtml-with "_.namespace(t1=Your_Query_Here(),t2=getRes('Your_Query_Here()'))" hr dtml-in t1 dtml-in t2 sort=sequence-item dtml-var "_['sequence-key']" = dtml-var "_.getitem(_['sequence-key'])" html_quotebr /dtml-inhr /dtml-in /dtml-with /body/html - - Original Message - From: Curtis Maloney [EMAIL PROTECTED] To: Adam Molyneaux [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, May 30, 2000 11:31 PM Subject: Re: [Zope] how do I get field names from a query On Wed, 31 May 2000, Adam Molyneaux wrote: how do I get the names of the fields returned from a SQL query ? ( I would like to generate stuff using the names automatically) I know they must be available because I can use them directly ! I've tried lots of alternatives of the form dtml-in "sqlListTable(table_name='personnel')" dtml-in sequence-item Pdtml-var sequence_item /dtml-in Ok... someone may have already answered this, but here's my guess. (Yes, this is untried, sorry :) dtml-in "sqlQueryBlah()" dtml-in sequence-item dtml-var sequence-key = dtml-var sequence-item /dtml-in /dtml-in which give me the values but not the names, and looked through lots of the old msgs. I'm certain this was tackled some time in the past, but yeh, searching the list logs can sometime be suprisingly fruitless. Thanks in advance if anyone can help glad i could help. (o8 adam [EMAIL PROTECTED] -- Have a better one, Curtis. dtml-var standard_work_disclaimer ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using sql to search in zope
dtml-sqlvar " '%' + _.string.strip(field1_value) + '%'" type=string - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 02, 2000 3:10 AM Subject: [Zope] Using sql to search in zope Hi All, I tried to build a search feature using sql in zope, this is what I normal do in sql to do a range search : select * from table1 where table1_id = %field1_value% But when I try it with zope, it will become select * from table1 where table1_id = %'value'% Which return an error : [ODBC Microsoft Access 97 Driver] Syntax error in query expression 'table1_id alike %'field1_value'%'.") Any idea or work around ?? Please help Cheers Wai ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope/Apache/NT
The "quickest fix" might be installing Linux on your machine. - Original Message - From: Paul Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 05, 2000 7:15 AM Subject: [Zope] Zope/Apache/NT Has anyone managed/bothered to get Zope working with Apache on NT yet? If they have, could you point me at any documentation? This is intended as a quick fix until I can get round to installing Linux on my machine.. Any help would be greatly appreciated! Thanks, Paul - Paul Smith : [EMAIL PROTECTED] http://www.ilrt.bris.ac.uk/ Institute for Learning and Research Technology University of Bristol, BS8 1HH, UK Tel: 0117 928 7192 Fax: 0117 928 7112 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] detail record editing
dtml-if add do your adding thing dtml-elif modify do your modifying thing dtml-elif delete do your deleting thing dtml-else do your 'Whoa! something ain't right here' thing /dtml-if - Original Message - From: ethan mindlace fremen [EMAIL PROTECTED] To: Robert Del Huerto [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 06, 2000 2:42 PM Subject: Re: [Zope] detail record editing Robert Del Huerto wrote: +---+---+-++ | |Doe|Jane |$100.00 | +---+---+-++ | X |Doe|John |$250.00 | +---+---+-++ | |Haggis |Meister |$100.00 | +---+---+-++ | |Zoper |Doper|$723.00 | +---+---+-++ | +--+ +--+ +--+ | | | ADD| | MODIFY | | DELETE | | | +--+ +--+ +--+ | +--+ You can have as many action="submit"'s as you want. Untested: input type="submit" name="add" value="1" input type="submit" name="modify" value="1" input type="submit" name="delete" value="1" The form only submits the value of "successfull" form items, so, on your form's action method: dtml-if add do your adding thing dtml-else dtml-if modify do your modifying thing dtml-else do your deleting thing /dtml-if /dtml-if ~ethan @ digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] escaping with dtml?
dtml-let hack="_.chr(34)+'app'+_.chr(34)+' ONCHANGE='+_.chr(39)+'location.href=cookie?app=+this.options[this.selectedIndex].value'+_.chr(39)" will do what you are trying to do - Original Message - From: Riku Voipio [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 07, 2000 10:28 AM Subject: [Zope] escaping with dtml? Hello, I'm trying to get some doubleqoutes to the final document, but I've been unsuccesful so far: dtml-let hack="\"app\" ONCHANGE=\'location.href=cookie?app=+this.options[this.selectedIndex].value\'" /dtml-let -- Riku Voipio [EMAIL PROTECTED] 09-862 60764 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ANN: ZUBB 0.3.2 (Zope Ultimate Bulletin Board)
on 6/8/00 10:59 PM, J. Atwood at [EMAIL PROTECTED] wrote: How about default sorting the message threads so that the thread with the most recent reply is at the top? This would be possible but I think it would be confusing to the user (posts would jump to the top). See below... I've customized Squishdot myself to add this feature, which is very useful in collaborative work. The effect is that topics (threads) which have ongoing activity stay near the top of the list. Threads that become quiet slide down the list until they fall off the bottom. This serves to highlight active discussions and works nicely in support of workgroups and committees. I'd recommend that you make this an option in ZUBB. Jim Harrison University of Pittsburgh ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] redirecting from inside a frame
The onlyway I can think off, (which doesn't mean its the only way), is to launch a new window and send a HTML document whose content is JavaScript. It would either rewrite the original frame or the entire window depending on you original input and then close itself. - Original Message - From: Fusion Group To: [EMAIL PROTECTED] Sent: Thursday, June 08, 2000 6:03 PM Subject: [Zope] redirecting from inside a frame I'm attempting to submit a form from inside of a frame, and depending on the information submitted, redirect to a new page which I no longer want displayed inside of that frame. I want the new page to displayed in the full browser window, but not a new window. Any help would be greatly appreciated. Regards, Chad
Re: [Zope] Secure storage of credit card info
I use the int value of the datetime of the last transaction multiplied by a random number generated for each day as the key to encrypt the CC data in my RDBMS. Once the customer has identified themselves via a cookie or by entering a customer id I can retrieve the last transaction datetime and use the appropriate stored multiplier for that day to retrieve their CC info from my DB. The CC DB is a separate table in a separate location. - Original Message - From: "R. David Murray" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, June 08, 2000 7:57 PM Subject: [Zope] Secure storage of credit card info OK, any of you out there who have thought about ecommerce, cryptography, and zope, I've got a design question for you. Actually, this question is independent of zope, but I need to solve it in a zope context. You have a ZCommerce site. You accept credit cards, and securely communicate with a CC processor to verify the transacton. Now, you want to save the CC# and other info in case something needs to be done with it later, and probably store the CC# so this customer doesn't have to type it in again later. Regardless of whether you are storing this info in a relational database or in the ZODB, how do you secure that information? Ideally I'd like it to be encrypted on disk. Now, storing it in a database probably makes it pretty hard to grep out even if a hacker manages to snarf the database file, but I'd like to encrypt it. But if I encrypt it, I have to have a decryption key somewhere. Where do I store the decryption key so that the cracker who snarfs the database file can't get it (just in memory somewhere?), and yet have the system be able to boot itself, including having the key, without human intervention? It seems to me like this is a Hard Problem, but I'm not up on the current cyrptography practice. So if there is a well known general solution, I'd love to hear about it. Otherwise, does anyone know what current Best Practice is? --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Newbie: Listing filesystem objects?
This is adapted from much more involved production code and should work: select name="filenames" size=10 dtml-in "local_fs_object.fileValues(spec='*.*')" dtml-let thefile="_['sequence-item'].id" option value="dtml-var thefile"dtml-var thefile/option /dtml-let /dtml-in /select Jim Sanford - Original Message - From: "Andy Gates" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 13, 2000 7:57 AM Subject: [Zope] Newbie: Listing filesystem objects? NewbieQ of the moment: So there's a folder on my server, call it \\server\files\logos. I want to list its contents in a drop-down listbox in a form; something like select name="logo_filename" option selected value="default.jpg"default.jpg option value="file1.jpg"file1.jpg ... /select Needless to say, I've installed the local filesystem product and created a localfs object called "logos" that maps to the correct folder. And now I'm mired in the docs. I'm thinking that I can just use dtml-in to iterate through the file ids of the objects in that folder, but I'm damned if I can see *how* to do that. Any tips? -- Andy Gates, Learning and Research Technology [EMAIL PROTECTED] - ICQ#74362415 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re:[Zope] Importing data
Please, no HTML posts. I crashed Netscape Mail twice trying to reply. Thanks. But to answer, exporting and importing works just fine if you want to copy parts of an existing zope site. It even works recursively, so if you want to export an entire folder of stuff (or Squishdot site) with subfolders, properties, etc., just go to its enclosing folder's "Import/Export" management tab, and follow the directions for exporting. This will create a .zexp file. To import into the new Data.fs file, put the .zexp file you have created into your [where zope is installed]/import folder on your hard drive. Then open the new site's management interface for zope and go to the same Import/Export tab and use the Import part. If you have 2 Data.fs files and only 1 zope, you can switch back and forth between them (stopping and restarting Zope in between so terrible things do not happen) by moving one and then the other into the appropriate var directory to do exporting, or importing as you want. Copies of the original files will come in handy if you confuse easily like me. -- Jim Washington Well, I meant that I have some products w/ data setup in the new .fs. If I copy the old over then I loose what I am currently working on. - Original Message - From: J. Michael Mc Kay To: [EMAIL PROTECTED] Sent: Thursday, June 15, 2000 12:26 PM Subject: [Zope] Importing data I have a Data.fs file from a previous instal of Zope. How can import parts of that data base to a current data.fs? I have a product setup in the old .fs that I want to use in the newlike a squishdot for instance. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Today Date and Tomorow
dtml-var "ZopeTime()" dtml-var "Zopetime()+1" Jim Sanford - Original Message - From: Marcus Mendes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 19, 2000 11:03 AM Subject: [Zope] Today Date and Tomorow Hello, How can I obtain today and tomorow date in Zope? Thanks in advance. Marcus Mendes ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SQL security at row level
We provide access tour database by outside distributors who are only allowed to see "their" records while our company users can see all records. Every data record has an org_id column. Every call to data is wrapped in a sql call to a user database that uses the authenticated_user's id to retreive their org_id and other security privileges (access to specific fields, as well as, type of html controls that show up - some data thay can view but not change while our company users can change them.) The update and insert queries have wrappers to so even if the no privileged users monkey with the form before submitting there chages won't get saved. Jim sanord - Original Message - From: "Hung Jung Lu" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 19, 2000 7:28 PM Subject: [Zope] SQL security at row level Hi, This is a general question. One can protect the ZSQL methods by employing user folders. This offers table-level protection. But what about protecting database information at row level? (This can come from hackers tweaking form variables.) Currently I store some security information (like the owner of row, among other things) on all rows on all tables. When retrieving records from tables (in particular, for "select" and "update" methods), I'd like to verify that the current user indeed has the privilege for accessing a particular row. I know at least two ways for checking this information. (Notice that we may have complicated situations where not only the owner can have access... we may have group privileges, superuser user privileges, etc. Also, I have a few hundreds ZSQL statements, so it's not a small question.) (1) Pre-generate the allowed owner ids, so "select" statements can only select rows with given owner ids... I could put something like: (keeping in mind superusers, team-members, supervisers, etc.) where dtml-sqltest owner_id column=owner_id type=int or dtml-sqltest additional_id1 column=owner_id type=int or dtml-sqltest additional_id2 column=owner_id type=int . (2) Use a wrapper for ZSQL methods, and raise an exception when unauthorized rows are retrieved. I guess row-level protection is a very common issue, so I would like to know what other strategies are used. I would appreciate description of actual implementations. regards, Hung Jung Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] scared
If I were running any remotely critical application on WIN98 I would be scared too. Because of legacy data issues we run Zope on NT and that just makes me nervous. Jim Sanford - Original Message - From: josh on [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 20, 2000 5:38 AM Subject: [Zope] scared when things happen that I have no understanding of their cause I get a little scared. I started up zope this morning, it seemed to open normally. (I am running zserver and zope on a win98 machine) However when I went to access the site through the web, the server would shut down. I have recently exported the app. that I was working on, which makes me happy but I need to get it back up and working asap. What information do I need to get the bottom of this? I don't know how to copy and paste from a dos window, so I will transcribe what I can see, hopefully someone can tell me where I might look next! (I have taken out all the directory structure from the filenames) File "...\ZServer\medusa\asyncore.py", line 321, in handle_error self.close() File "..\ZServer\HTTPServer.py", line 356, in close p.more() #free up resources held by producer File "..\ZServer\Producers.py", line 108, in more getattr(self.logger, self.method)(self.bytes) File "..\ZServer\medusa\http_server.py", line 275, in log, _ _ [%s] "%s" %d "%s" "%s"\n' % ( LOG STUFF ) ... IOError: [Errno 9] Bad file descriptor Oh I feel rotten, way out of my depth! I just want zope to work!!! Not really sure where to start, will reinstalling the whole thing write over my data? I guess I have it backed up, but still... thanks for ANY help!! josh on ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: LocalFS w/ annotation data
I would suggest putting an extra text box on the upload form for the filename in ZOPE. You could include javascript to automatically fill in the text box whenever the ZOPE name in the file box changed. The javaScript code could use the C:\ or D:\ or whatever pattern at the beginning to determine that it might be a windows file and strip off the path. On the unlikely occassions it "guesses" wrong the user could change the name before uploading. Jim Sanford - Original Message - From: Dan L. Pierson [EMAIL PROTECTED] To: Jonothan Farr [EMAIL PROTECTED] Cc: Dan L. Pierson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 20, 2000 7:51 AM Subject: [Zope] Re: LocalFS w/ annotation data Jonothan Farr writes: That sounds like a mess. LocalDirectory objects are not persistent, they are created each time they are requested. So you'll have nowhere to put your PersistentMappings except in the top-level LocalFS object. Trying to make the LocalDirectories persistent would be painful. For one, it would be hard to keep in synch with the file system. You could store everything in a PM at the top and use paths relative to the base but that would make copy,rename,etc. also messy, like you said. I was planning to put the only top level PersistentMapping in the LocalFS object, all the others would be values in it. Still, you're right, it's not pretty. What about just storing your meta-data in files in the local file system? Then you wouldn't need to modify the LocalFS product at all. Just write a ZClass that can read/write you meta-data file format. Might well be a better approach. I'll think about it. Unfortunately, it doesn't remove the need for automatically handling move, copy and rename, since these files wouldn't be visible to the normal archive users. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-sendmail tag that worked in 2.1.6 appears broken in 2.1.7
The error is saying that Zope is seeing localHost (CAPITAL H) where your snippet of code reads localhost (small h). Does your actual code have a typo? Jim - Original Message - From: Shaw, Mark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 20, 2000 1:39 PM Subject: [Zope] dtml-sendmail tag that worked in 2.1.6 appears broken in 2.1.7 Hello, I have a site that contains the following tag: dtml-sendmail smtphost="localhost" mailto="zope" mailfrom="[EMAIL PROTECTED]" subject="SITE.COM EMAIL" ... /dtml-sendmail This worked fine when my server was running Zope 2.1.6. After upgrading to 2.1.7, I get the following error: Error Type: TypeError Error Value: unexpected keyword argument: localHost I've made an attempt to revert to 2.1.6 to resolve this problem. However, I noticed that I was unable to successfully pack the database after moving all the data files from the 2.1.7 tree to the 2.1.6 tree. Has anyone seen/resolved this problem? Any help is greatly appreciated. -Mark ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML-IN Question
from the DTML reference page 41, regarding dtml-in: the default setting for the orphan attribute is 3. So you might try: dtml-in ranked_stories size=3 orphan=0 -- Jim Washington Tom Scheidt wrote: Hi my problem is that Im setting my batch size to 3, yet I keep getting 5 items. As a matter of fact, sometimes I get 4 when asking for 2 and so on. Here's what Im using: [code snipped] Thanks in advance. Tom Scheidt | www.falsemirror.com | [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Newbie Question (dropdown menu)
This is my answer to another seeker's question. It should also answer yours. This code assumes that the variable customerid on the form contains a value that matches up with customerid in the query custcompanysearch ___ dtml-let tcustid="customerid" select name="customerid" dtml-in custcompanysearch option value=dtml-var customerid dtml-if "customerid==tcustid"selected/dtml-if dtml-var firstname dtml-var lastname/option /dtml-in /select dtml-let ______ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: [EMAIL PROTECTED] Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __ - Original Message - From: joel grimes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 21, 2000 10:51 AM Subject: [Zope] Newbie Question (dropdown menu) I'm trying to fill a combo-box (pardon the vb-centric lingo - I don't know what the things are called - it's a select...option... thing) with items selected from a table. I haven't a clue how to do this. I've got the ODBC Connection and SQL Method working, but how do I iterate through the query results to fill a drop-down? Thanks Joel Grimes Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB or not ZODB?
(snip) The filesystem, imho. This lets you spread things out over multiple disks and even (perhaps) multiple systems. Worst case you've got 50k x 15k = 750M. Big for a ZODB (?), No. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB or not ZODB?
Casey Duncan wrote: I am implementing a document Library using Zope. It has an exhaustive index with several thousand topics in an outline residing on a PostgreSQL database. This works well and I like it. My question is where is the best place to store the documents themselves? They will be static HTML documents ranging from 1-50Kb in size roughly. There will probably be at least 10,000-15,000 of these documents in the library once all is said and done. In my mind I have three options: 1. Store them on the filesystem. 2. Store them in a PgSQL table as blobs. 3. Store them as DTML Docs in the ZODB. I would like to eventually have full text searching capabilities, so that makes #1 less attractive (I would likely need my own Python method to do it). #2 is somewhat of a pain to implement due to limitations in the PgSQL row size and text searching would be slow. With #3 I could in theory use a ZCatalog to implement the searching, so that is done for me. In theory, you could use ZCatalog to catalog objects in the file system or in a RDBMS, providing that you can provide paths for them. I don't think anyone's done this yet. There are bound to be bumps from wjoever does it first. :) Is ZODB up to the task of storing this quantity of objects? What problems might I run into? Is it a wise idea, could a data.fs file of this size (~3-400MB) become too easily corrupted? No. Zope.Org varies from 300MB to close to 2GB. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB or not ZODB?
Andrew Kenneth Milton wrote: +[ Cary O'Brien ]- | | I'll let others speak to 3. I've never had a problem with ZODB, but I've | never put 750MB in it. It'll take a fair amount of abuse :-) I've loaded the entire dmoz data into it (once only) just to see what would happen. Booting was slow, but, once it got up, it ran OK. In addition, if you closed it explicitly, an index would be written. The next "boot" would then be pretty fast. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB performance: reads to writes
Jimmie Houchin wrote: I know this has been brought up before, but I don't remember if this question has been asked. I've been reading everything I could find on the ZODB. Currently I am reading 'Introduction to the Zope Object Database' by Jim Fulton at http://www.zope.org/Members/jim/Info/IPC8/ZODB3/index.html . Towards the end of the paper under Status, he starts referring to future features. Under 'Application-level conflict resolution protocols' he states this, 'Applications with much higher write to read ratios are likely to encounter frequent conflict errors which can seriously affect performance.' Is this pretty much the primary reason that it is generally said that the ZODB isn't as well suited to high write situations? Yes. ZODB uses an optimistic concurrency control protocol, which assumes that conflicts are rare. Or is there more to it than that? The reason I ask is this. My app by it's nature as a community/portal will have plenty of writes in certain areas. However, due to the structure of the website and the app most all writes are to unique objects, are appends to an object or the person editing the object is the owner and has no one to conflict with. In this case there should be little if any ConflictErrors due to different users trying to commit changes to the same object. Right, assuming the objects aren't indexed. If they are indexed, then modifications to the indexes could conflict. This is agrevated by the current index design, at Ty pointed out in a later message. In the case of the appends, it would be like a bboard and there would be no conflict. Appends will be done in the order received. Appends are still writes, so they would conflict. It's possible that a conflict resolution protocol, http://www.zope.org/Members/jim/ZODB/ApplicationLevelConflictResolution, could be used to cause appends to be non-conflicting. I plan to implement this protocol on the database side for Zope 2.3. You'd have to implement the application side of it. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB performance: reads to writes
Toby Dickenson wrote: On Sat, 24 Jun 2000 12:43:05 -0400, "Evan Simpson" [EMAIL PROTECTED] wrote: Will an app as described above still suffer from problems with high writes? There are two independent attacks on this problem underway: 2. Implement the application-level conflict handling you read about, so that Folders and Catalogs can decide that two writes don't conflict after all, and merge them into a single update. Yes, that will help 1. Make Folders and Catalogs store meta-data about their contents in a data structure consisting of small persistent objects, like B-Tree nodes. This reduces the scope of potential conflict (and the size of the update required by a write) to the size of one of these nodes. As I understand it, a BTreeFolder alone (ie without application-level conflict handling) will not help here. Sure they will, because a BTree is the moral equivalent of multiple subfolders. (This assumes that a problem in the current BTree design is fixed, which it will be. ;) Folders have to ensure that all their contained elements have a different id. The hot-spot is the only way a Folder can achieve this. But there is only a conflict if two transactions want to pick the same id. Going to (fixed) BTrees doesn't prevent *all* conflicts, but it does prevent most conflicts, which will be good enough for many applications. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB performance: reads to writes
Ty Sarna wrote: In article 000d01bfddfb$4546f070$[EMAIL PROTECTED], Evan Simpson [EMAIL PROTECTED] wrote: - Original Message - From: Jimmie Houchin [EMAIL PROTECTED] Will an app as described above still suffer from problems with high writes? Possibly, but only if there are hidden hotspots. For example, in your [...] 2. Implement the application-level conflict handling you read about, so that Folders and Catalogs can decide that two writes don't conflict after all, and merge them into a single update. Unfortunately, this doesn't deal with cases where the conflicting state is contained in many objects (see note by PJE in the ZODB Wiki). Yes it does. (See my response to PJE's note.) Also, there is a whole other area of difficulty for high-write-volume ZODBs, which is the ammount of IO that needs to be done. First, by nature ZODB can't rewrite a single attribute of an object, it has to rewrite the entire thing. Each object (that subclasses Persistent) is analigous to a database record. When you modify a part of the object (that isn't it's own persistent object) then you write the entire record. This seems pretty reasonable to me. Part of ZODB database design, where it matters, is to balence the size of database objects. If objects are too big, then the amount of data written on a change is larger. If objects are too small, then you may incur too much persistence overhead. Most apps don't need this level of tuning. Indexing is also a bear from an IO perspective. First, BTrees currently keep a count at each level, so every change to a btree changes a node at each level of the BTree. For a ZCatalog, there are a lot of btrees (something like 2n+4 for n indexes, I think -- don't quote me on that, it's been a while), and each one changes (last I looked, every index was updated even if the value indexed in a particular one hadn't changed. This may have been improved since). Not only is this bad from a hotspot point of view (always a conflict on the root node of the tree), but you end up doing a *lot* of IO. During my experiments that led to BerkeleyStorage, I was watching the Data.fs grow by 47K per transaction for adding indexed objects of ~1K in size. Watching this with tranalyzer, this turns out to be 1K of object, and 46K of updated btree pages :). This is a significant problem. The current BTree implementation, which predates Principia, was designed for very different applications than it's being used for now. We are working on a new BTree implementation that does away with these counts. This should have a huge impact. We are also looking at getting rid of other hot spots in the current ZCatalog (e.g. internal id assignment). Note that BerkeleyStorage only prevents the file from growing that much -- it still has to do all that IO (in fact, it has to do ~2-3 times that much IO, due to the nature of BerkeleyDB. A relational storage would have similar issues. For ammount of IO done, FileStorage is about as efficient as you can possibly be -- it's just that it trades that off against space reclamation). Also, with any kind of Berkeley or Relational storage, there is a second hidden IO and storage penalty: you're storing a btree inside a btree. In other words, the lower-level DB uses btrees to store your objects, including interior nodes of the higher-level ZODB btree. Every interior node of the ZODB Btree needs a leaf node (and supporting interior nodes) in the DB's btrees. so you get taxed twice, on both I/O and storage space used. I don't agree with the conclusion of this analysis. The indexes used in the underlying storage are indexing totally different information. They are effectively using indexes to provide persistent memory management. They aren't indexing the application keys. OTOH, I have some sympathy with a related issue. You and Phillip have argued that the ZODB should provide indexes, rather than leaving indexes to application level code to avoid maintaining undo information for indexes. After all, indexes can, in theory, be recomputed from data records after an undo. While I think that this idea has some merit, I don't think it offers enogh benefit to make it a high priority. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
Re: [Zope] Urgent problem: Database and large clock skew
--Also Sprache Toby Dickenson [EMAIL PROTECTED] On Thursday, June 29, 2000 10:19 AM +0100: That probably means you are using ZODB2, yes? (please say yes; ZODB3 should be immune to this problem). If so, there used to be a tool to correct the timestamps... you should be able to find it in the utils directory in the Zope 1 CVS Ding ding ding. Found it. Just what I was looking for! I'll give it a try. I am indeed using ZODB2. I worked around the problem temporarily by snipping all the code out of SimpleDB.py that checks the sanity of the timestamps (After making a copy of my database first :) http://classic.zope.org/cgi-bin/cvsweb.cgi/ZUtil/fixbbbts.py Thanks very much. -- Jim Flanagan [EMAIL PROTECTED] http://jimfl.tensegrity.net ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Prototyped folders?
On Thu, 29 Jun 2000, Hamish Lawson wrote: I wrote: If a folder doesn't itself contain a required object or method, I'd like to have another folder looked in instead. The fall-back folder won't necessarily (and often can't) be higher in the hierarchy, so acquisition doesn't seem to be a solution. Sorry to jump in late on the thread, just joined the list. Is there a reason you can't do this by just messing with the namespaces stack, ie, adding additional folders to it? (Or a reason that's not a good idea? That's what I've been known to do, if I correctly understand your goal...) jim -- Jim Hebert http://www.cosource.com/ [EMAIL PROTECTED] The cooperative market for open source software "Well actually I was considering opening a market in flying pigs. Mostly because it would be more practical" -- Alan Cox ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Messing with the namespaces stack [Was: (no subject)]
On Thu, 29 Jun 2000, Shane Hathaway wrote: Actually what you did is pretty clever, Jim. It even relies on stable interfaces. Uh oh, careful, I'm encouragable and you'll really have a monster on your hands. ;-) The reason for the inner dtml-with is that my pages are DTML Methods, not OK, I am just going to go ahead and spill the rest of what swirled around in my head about zope when I threw up this vistasource.com site, in the hopes that I'll either get another ego stroke (*grin*) or some more insights as to the reason why things are done the way they are (ie, not the way I do 'em!). This is probably going to be long, please forgive me for going from newly subscribed to thinks-he-can-write-a-howto overnight! =) I am bucking a trend, I am starting to realize. Big time! The assumption seems to be that any given page will build itself, it will suck in standard_html_header and standard_html_footer, and compose itself of whatever else in between those things. DTML Document is the base unit of a page. Partially because I was planning at the time to build an over-simplified front end for our system, I wanted people to be able to upload simple, stupid chunks of "content" html and not have to do things like put dtml-var standard_html_header at the top and ..._footer at the bottom. Any lame wysiwyg editor that had save-to-ftp could then push up a 'body file' into the right folder, and I could get writers writing without learning zope. I also started to really groove on the idea of Object Oriented precepts for my pages, and having to explicitly "#include" peices like the common stuff offended those sensibilities. I wanted "objects" that had both "data" and "code" as its members, in a nice little bundle. So, I made the decision that my atomic unit of what constitutes a "page" on my server is a Folder object. This lets me collect everything specific to a page, images that are only used there, methods that are only used there, etc, in a tidy little bundle. So here's my scheme: I think of /index_html, a DTML Method, as if it were a member function of an object. It might as well be named "render_this_folder_as_a_page." So, it looks like (oversimplifying:) dtml-with images dtml-with "PARENTS[0]" dtml-var standard_html_header tabletrtd dtml-var menu /tdtd dtml-var body /td/tr/table dtml-var stnadard_html_footer /dtml-with /dtml-with So, now, in each folder I just put a dtml method called body. When you visit /about, index_html gets acquired, but since it's a dtml method, the /about folder remains the first place to look for other stuff, so body gets located in /about. If I want to override the menu code, I also stick another object in there called menu, but by default my toplevel menu code works for all the subfolders. In some perverse sense, sub-pages conceptually are sub-classes of higher up pages, which inherit some things (index_html for instance) things and override things (/body, nearly always, and sometimes other things). If I repeitively built $header + $menu + some content + footer over and over again in page after page, I couldn't radically redesign my site (for instance, pulling in body and sticking an advertisement between every 3rd paragraph) without touching every page. But in the model that I use, the one true index_html method is free to suck body in, do crazy post-processing to it, and then send that out. And, of course, index_html itself can be overridden for sub-trees of the site, if need be. And, I can also come up with different renderers, I suppose. Untested might be the idea that I could put /alt_renderer as a DTML Method at the top level, then visit /about/alt_renderer and invoke that method in the /about context. So by separating content from presentation, I can plug my content into lots of things simultaneously. Presumably. The only thing that has bummed me out about this strategy is that I feel like that every time I use a 3rd party product I end up working up hill: it usually expects to be able to write out a DTML Method or Document that says dtml-var standard_html_header app-specific-logic-here dtml-var standard_html_footer and have gotten it all. Adding a "Search Interface" is a typical example of this. When I can, I hack around this and migrate "app-specific-logic-here" into SomeFolderName/body. But for products which manufacture pages on an ongoing basis, e.g. FlexFaq/Knowledgebase, this is less of an option, and points more towards me hacking the package code itself. I don't honestly expect that what I invented in the middle of the night 7 days before the VistaSource launch to revolutionize how everyone builds pages (like I said, I actually suspect that these hacks that I invented have some major drawback that you guys will help clue me into, though, hehehe, I haven't been dissauded by the search drawback..), but perhaps someone will have suggestions on how I c
[Zope] Re: Messing with the namespaces stack
On Fri, 30 Jun 2000, Hamish Lawson wrote: Jim, that is indeed clever. Am I right, however, in thinking that every DTML method or DTML document that wants this additional-parent behaviour will need to use these dtml-with wrappers? I think what I'm after is the ability to alter the parents of the containing folder itself, so that any contained method automatically has this modified acquisition path. Yes. I sorta expected someone to point that out, which is part of the reason I posted my other, longish post, which shows among other things that I only have that double-dtml-with in one place, the toplevel index_html. So, it may not be ideal for other design patterns. jim -- Jim Hebert http://www.cosource.com/ [EMAIL PROTECTED] The cooperative market for open source software "Well actually I was considering opening a market in flying pigs. Mostly because it would be more practical" -- Alan Cox ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Messing with the namespaces stack [Was: (no subject)]
On Fri, 30 Jun 2000, Shane Hathaway wrote: It's a great idea but I've had some thoughts on this myself. I think the approach I would take is to create a ZClass. Content authors would Oooh, I like that idea a lot. Solves lots of problems, most notably the hackery I currently do with the searching stuff: The search results come up with urls like http://www.vistasource.com/body, which ain't right, so I do a bunch of munging to make the urls right. Also sounds like work, but hey, I suppose it's about time I earn that salary... =) fundamental changes more easily. Have you learned about property sheets yet? They are the key to success with ZClasses. Nope, where shall I go to read the fine manual on those? visits /home/lowres/content/index_html, they get the lowres style. (I understand this now, modulo the other post from Jeff.) Yeah, this is the part of acquisition that I _get_, but just shy away from for some reason. I need to get over that, because this is probably one of the coolest things about acquisition. Zope is like a collection of Legos (TM): you're given a bunch of blocks and some instructions on how to build some specific models, but encouraged to explore putting them together in new ways. Have you heard of the Lego Machine Gun? :-) Yeah, funny you should mention it. I was just looking at the web page for it like 2 weeks ago. And I like the analogy. =) Thanks so much, I hope others on the list are profiting from this exchange as much as I am! jim -- Jim Hebert http://www.cosource.com/ [EMAIL PROTECTED] The cooperative market for open source software "Well actually I was considering opening a market in flying pigs. Mostly because it would be more practical" -- Alan Cox ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Multiple clicks: how to handle them?
One site I have seen uses javascript on the client side: you get a dialog box that pops up on-click, tells you to only click once. Since the dialog is modal, if you did click twice it (did whatever your platform does when you have a modal dialog box up, eg beeps at you). (yes, of course, it'd be nice to have a solution requiring javascript, but I bet you that the people dumb enough to double click the submit button are the people with javascript on... =) jim -- Jim Hebert http://www.cosource.com/ [EMAIL PROTECTED] The cooperative market for open source software "Well actually I was considering opening a market in flying pigs. Mostly because it would be more practical" -- Alan Cox ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] CorruptTransactionError (Bad news for production site!)
Richard Taylor wrote: Today I had to role back two days of transactions from my production site because when I packed the database I was informed of a CorruptTransactionError. Did anything else happen previous to this? Did you run out of space or anything like that? You should have been able to use Data.fs.old, which is a copy of the database before the pack to restore the data. Or was the error in there too? I'd be interested in looking at the Data.fs file before the pack to try to figure out what might have gone wrong. (If you send my your Data.fs file, please remember to send it to me privately and to zip or compress it. :) We are using Zope for an internal knowledge management application where anyone in the organization can add objects. So I have no way of know what was added after the fateful transaction and no way of getting any of it back. Bummer! Indeed. I think this raises a few questions about ZDB: 1) We need some tools for selectively removing bad transactions rather than just truncating Data.fs back to the last good one and loosing everything that comes after it. Zope 2.2 has just such a tool. In the ZODB directory, there is a Python script, fsrecover.py which simply calls the recover function in the FileStorage module. This will work with any 2.x databases. It scans from both the beginning and the end of the file until it finds a corrupted section and then removes the corrupted portion from the file. You utility modifies the file in-place, so you need to shut-down the site, or work on a copy when you use it. 2) We could do with a tools that can verify the ZODB offline. This could then be run at regular intervals (maybe once an hour from cron) so that corruptions can be picked up earlier. You could use a little Python script that did something like: import ZODB.FileStorage file_name='../../var/Data.fs' file=open(file_name, 'r+b') index={} vindex={} tindex=[] ZODB.FileStorage.read_index( file, file_name, index, vindex, tindex) This basically reads the FileStorage index as would normally be done during startup. 3) Some way to find out what was added after a corrupt transaction is needed so that at least I could see who I need to ask to re-add their stuff. The fsrecover script should avoid the need for this. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZWiki/Structured Text formatting surprise
Chris Withers wrote: Bill Anderson wrote: Why not put a space in there, after the comma? As in: (_.None, _, foo) I suggest that, since this appeared in a code snippit to begin with, it should have been written as: blah blah '(_.None,_,foo)' blah blah in which case, the '_'s shouldn't have had any effect. (If they did, it's a bug). Note that the StructuredText underlining feature is widely considered a missfeature and probably won't be supported in StructuredTextNG. Likewise, I tried this in the Sandbox. Works for me. :) I'd prefer to see a generic way of escaping structured text formatting. Maybe this is something for StructuredTextNG? Maybe. I'd really prefer that this not be necessary. Maybe someone should add this escaping feature to the StructuredText Wiki at http://www.zope.org/Members/jim/StructuredTextWiki/StructuredTextNG. If you do, please suggest an escaping syntax. Please think hard to come up with an escaping syntax that I don't hate. ;) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with _[xyz]
Hi, Christian Christian Zagrodnick wrote: Hi all, shouldn't dtml-var xyz and dtml-var "_['xyz']" return the same result? if xyz is a simple variable, yes. Well - I don't know why but only the 1st is working. (top.German.ActualPages is a folder; tThisIs... is a dtml-method) 1: dtml-with "top.German.ActualPages" dtml-var tThisIsTheXYZDocument /dtml-with 2: dtml-with "_['top.German.ActualPages']" dtml-var tThisIsTheXYZDocument /dtml-with I may be wrong on this, but if the dots indicate subobjects, you may want to do this as Python sequence syntax: "_['top']['German']['ActualPages']" or as "_['top'][aLanguage]['ActualPages']" assuming aLanguage is a variable which may be e.g., 'German' I hope this is a helpful hint. -- Jim Washington Of course I want to replace the 'top.German.ActualPages' with a variable... but since it doesn't work with a hardcoded string it'll not work with a variable. Any hint? Thanks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZWiki/Structured Text formatting surprise
Chris Withers wrote: Jim Fulton wrote: I suggest that, since this appeared in a code snippit to begin with, it should have been written as: blah blah '(_.None,_,foo)' blah blah I don't format my code like that ;-) I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text. (snip) If you do, please suggest an escaping syntax. Please think hard to come up with an escaping syntax that I don't hate. ;) How about extending ! beyond just escaping WikiNames? I *really* **really** hate the ! wiki name escape. ! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character. I really don't like this. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZWiki/Structured Text formatting surprise
Chris Withers wrote: Jim Fulton wrote: (snip) How about extending ! beyond just escaping WikiNames? I *really* **really** hate the ! wiki name escape. Why? A goal of structured text is that it should be readable in it's original form. The conventions used should mimic the kinds of things we do in email, to the extent possible. The bang ascape totally violates this. ! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character. I really don't like this. Hmmm, I would write 'Why?' again, but I think that'd be flame-bating ;-) Not at all. I think there should be some form of escaping, ! seems the most compact and unobtrusive ,or maybe ^ or some such... Ideas welcomely recieved :-) I can't think of any. I'm open to suggestions, but I reserve the right to hate the suggestions. :) While I'm open to escaping, I'd also really like to think harder about the formatting conventions so as to make escaping unnecessary. If we need to escape, we've probably done something wrong. I actually think that the otion of in-line code is useful as a typographic feature and should really eliminate the need for escaping in most if not all cases. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] data record exceeds transaction record
Jonathan Desp wrote: Hi, here is the information of my problem: File "C:\Program Files\WebSite\lib\python\ZODB\FileStorage.py", line 218, in p anic raise CorruptedTransactionError, message ZODB.FileStorage.CorruptedTransactionError: C:\Program Files\WebSite/var/Data.fs data record exceeds transaction record at 20663057 that's special, see, if you analyse the sentence: data record exceeds transaction record it's like saying: you transfered more data than the quantity(of data) you have presently. " I will transfer 5 apples, but I have only 4 apples." hmm Hmm. The sentence describes a situation that shouldn't be possible right? That's why the file must be corrupted. The error message is telling you why the system determined that something is wrong. I'd be interested in looking at the database to try to figure out how this happened. If you are willing to pursue this, write me back in a private email. interesting problem to fix. some ways I got from you: the "recover" program with Zope 2.2, but I didnot find out why it should be useful for me. When I read the "readme file". The recover program in 2.2 will remove damaged transactions from a database file. While this may cause data loss, you can at least get your database up and running again. This seems pretty useful to me. This program isn't mentioned in the README.txt. See the script in lib/python/ZODB/fsrecover.py. You run this script with the name of the file to repair. Note that the repair is made in-place, so you will need to work on a copy or shut your site down. In my netscape browser, I can read: "exceptions.ImportError" then I read all the message related to this problem, in every mailing list, but there is no solution to it, or related to it on those messages. I can't tell from the information you've provided why you would get an error in your browser. Is it a new bug or ? Your database got corrupted. I don't know why. It's possible that it's due to a bug. It's also possible that it's due to a system failure. I don't have enough information to tell right now. Because my website is very big. I don't think it's very important because there is some other data.fs more bigger than 31 381 Ko. As long as your database is under 2GB, size should not be a problem. Zope.org has been close to 2GB on a number of occasions without problem. It's not a server or a hardware problem because I tested my data.fs on another hardware,machine. As well as it's not a another file in zope, because I tested that data.fs on zope linux, and zope windows. So it's really inside data.fs The data file is definiately corrupted. That's what the error tracsbeack says. It's a "FileStorage.CorruptedTransactionError". The question is how the file got that way. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZWiki/Structured Text formatting surprise
Stephen Harrison wrote: Jim Fulton wrote: Chris Withers wrote: Jim Fulton wrote: I suggest that, since this appeared in a code snippit to begin with, it should have been written as: blah blah '(_.None,_,foo)' blah blah I don't format my code like that ;-) I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text. That seems to be a rather inappropriate character to quote code with. You can't quote any of the vast reams of code which uses quotes, such as: REQUEST.set('id', 'value') or any other similar code. I'm open to a different quoting convention. Note that for basic Python code, you can simply switch the quotes, as in: 'REQUEST.set("id", "value")' but, of course, this doesn't work for DTML. As an aside, I just tried, in http://www.zope.org/Wikis/zope-edu/SandBox, quoting the code: dtml-call "REQUEST.set('id', 'value')" It didn't work, so I then tried dtml-call "REQUEST.set(id, value)" which also didn't work, This is due to the fact that StructuredText has a bug in the handling of inline code. It failes to HTML-quote the contents. This can be fixed, but you still can't quote: dtml-var "REQUEST.set('id', 'value')" but it did work if I quoted it by escaping the following paragraph using the :: syntax. This doesn't "escape" the following paragraph, it makes it a literal example. StructuredText *does* properly quote non-inline examples. This indicated that the 'some code' functionality is in some way broken, since it doesn't happen before executing any dtml which might be on the page. Yup. This is not a fatal flaw in itself, as it can be fixed. Still, the DTML bit above is problemantic. A number of people have complained about the use os single quotes for in-line code. One possibel alternative is to use ``code''. See http://www.zope.org/Members/jim/StructuredTextWiki/CustomizingTheDocumentProcessor Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Changing my session identity
How does one become Anonymous User without stopping/restarting the browser? Is there a special username/password for that? -- Jim Washington Chris McDonough wrote: Oops... sorry... dtml-raise Unauthorized Unauthorized. /dtml-raise Shortcuts on the brain. :-) -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 19, 2000 11:43 AM To: 'Andreas Rippel'; [EMAIL PROTECTED] Subject: RE: [Zope] Changing my session identity In dtml: raise Unauthorized You are unauthorized. /raise If you enter a new valid username/password combo in, you'll be validated and your identity will be changed. If you cancel or enter an invalid username/password combo, you'll still be logged in as whomever you started with. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Bi-directional update of Data.fs
Chris Withers wrote: (snip) Definitely, can someone say whether QuorumBasedReplication would handle this on whether it's designed more for real-time replication between storage servers in the ZEO world? It's designed for real-time replication. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Zope.org feedback
We have no http access to our site. It is a corporate Client Relationship Management, Job Tracking and Order Processing, Production and Tracking system that is accessed from all over the world. I will send this to the list to see if any one else can provide help. - Original Message - From: Loren Stafford [EMAIL PROTECTED] To: Jim Sanford [EMAIL PROTECTED] Sent: Friday, July 28, 2000 5:14 PM Subject: Re: Zope.org feedback URL: http://www.zope.org/Members/lstaffor ZScheduler uses Client.py. Would it be correct to say that if my entire site is only accessible via SSL (https) that ZScheduler will not work? I hadn't thought about this before, so you probably know more about it than I do. But given that the python lib that Client.py uses for http (httplib.py) doesn't support https, then you're right. Solutions? 1. Permit http traffic to your site if it comes fromt the same IP and is for URLs that end in "/trigger". I suppose that IP spoofing makes this something of a security hole. How bad? 2. Enhance either Client.py or httplib.py to support at least enough https to get the job done. I know nothing about this. Is it reasonably doable? Is there a Zopista willing and able to do it? 3. ? -- Loren ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZODBCDA 3.1.0b2 and Zope 2.2 as a Service on NT
I am having problems with Zope 2.2 and ZODBCDA 3.1.0b2. When I start Zope manually with the start.bat my ZSQL methods work fine. When I start Zope as a service, every ZSQL method returns a SQL error that states that the table I am looking for does not exist. Anybody out there know what's going on? Thanks __ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: [EMAIL PROTECTED] Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] 2.2 as a service and Zodbcda
Can you shed any insite? ***Result of testing Z SQL Method with Zope 2.2 running as a service: Z SQL Method at /scripts/Zope.pcgi / testing / test2 Error, sql.error: ('S0002', 173, "[Microsoft][ODBC Visual FoxPro Driver]File 'names.dbf' does not exist.") SQL used: Could not render the query template! Registry Parameter= start : REG_SZ : "C:\Progra~1\ATIAny~1\bin\python.exe" "C:\Program Files\ATIAnywhere\z2.py" -D -p C:\InetPub\scripts\Zope.pcgi = Result of testing Z SQL Method with Zope 2.2 running from start.bat.: Z SQL Method at /scripts/Zope.pcgi / testing / test2 Company ATMEL SQL used: select company from names where val(id)=27000 Start.bat="C:\Program Files\ATIAnywhere\bin\python.exe" "C:\Program Files\ATIAnywhere\z2.py" -D -p C:\InetPub\scripts\Zope.pcgi = Both are running via pcgi through MS IIS 4.0 Here is Zope.pcgi: #!C:\Program Files\ATIAnywhere\pcgi\win32\pcgi-wrapper.exe # # This PCGI info file was generated automatically by # the Zope installer. See the file doc/WEBSERVER.txt # for more information on setting up PCGI support. PCGI_NAME=Anywhere PCGI_PORT=8090 PCGI_MODULE_PATH=C:\Progra~1\ATIAnywhere\lib\python\Main.py PCGI_PUBLISHER=C:\Progra~1\ATIAnywhere\pcgi\pcgi_publisher.py PCGI_EXE=C:\Progra~1\ATIAnywhere\pcgi" PCGI_SOCKET_FILE=C:\Progra~1\ATIAnywhere\pcgi\pcgi.soc PCGI_PID_FILE=C:\Progra~1\ATIAnywhere\pcgi\pcgi.pid PCGI_ERROR_LOG=C:\Progra~1\ATIAnywhere\pcgi\pcgi.log PCGI_DISPLAY_ERRORS=1 BOBO_REALM=Zope BOBO_DEBUG_MODE=1 INSTANCE_HOME=C:\Progra~1\ATIAnywhere ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Server as an NT service
If you picked running Zope as a service in the install got to Start-Settings-Services - Original Message - From: "Vincent" [EMAIL PROTECTED] To: "[Zope Org] (E-mail)" [EMAIL PROTECTED] Sent: Tuesday, August 08, 2000 3:25 AM Subject: [Zope] Zope Server as an NT service Does somebody know how to start Zope as an NT service ? As usual, The answer is probably in the documentation but I can't figure where is the answer... Thanks. Vincent ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Getting single values out of lists
This should work: dtml-in substract dtml-if "_['sequence-item']!=''" update artikel_table set artikel_qty=artikel_qty - dtml-sqlvar "_['sequence-item']" type=int where artikel_id=dtml-sqlvar "artikel_id[ _['sequence-index'] ]" type=string dtml-var sql_delimiter /dtml-if /dtml-in ______ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: [EMAIL PROTECTED] Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __ - Original Message - From: Borno Janekovic [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 08, 2000 11:13 AM Subject: [Zope] Getting single values out of lists Hi, I have a page wich is created out of a database. For every artikel (item) I have a description and a number of available items. The page has multiple rows (depending on the database content) in every row is a input-box in wich the user can enter a number. This number needs to be substracted from the available items number of the correct artikel. My question is how can I get the correct tuple of items out of the list. For example In every row I have the substract box and a hidden field with the primary key: input type="text" size=5 value="" name=substract input type="hidden" value="dtml-var artikel_id" name="artikel_id" When I submit the Form I get with the following lines dtml-in "REQUEST.form.items()" sort dtml-var sequence-key:dtml-var sequence-itembr /dtm-in the content substract = ['12', '', '', '', '', '', '', '', '', ''] artikel_id = ['2808095658', '2808095503', '2808095341', '2808095744', '2731135126', '2808092056', '2808092333', '2808092723', '2808095232', '27311227'] and this is correct. This means that a user has entered 12 for the artikel_id 2808095658. How can I get the single values, so that I can use them? How can I extract the values from the list to use the tuple in a sql-statement? Help would be great. Thanxs Borno -- Sent through GMX FreeMail - http://www.gmx.net ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Request for Comment: Zope API naming convention
There is a proposal to adopt a naming convention for all new Zope API methods at: http://dev.zope.org/Wikis/DevSite/Proposals/APINamingConvention Comments are gratefully accepted at: http://dev.zope.org/Wikis/DevSite/Proposals/APINamingConventionDiscussion Please make comments by Wednesday April 16. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZEO 0.2.1 doesn't work with Zope 2.2.1 FileStorage
There is a bug in ZEO 0.2.1 which was made effective by Zope 2.2.1 (which has just beed released in beta). I plan to release ZEO 0.2.2 shortly, which fixes this bug. If you are using ZEO, please hold off of using Zope 2.2.1 (or an up-to-date Zope public CVS) until you can install ZEO 0.2.2. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python + COM (from external method)
I had this problem. If you have Python installed standalone on the machine and a copy under Zope, you need to make sure that the wincomm stuff is in the python path of the Zope python. You can add the proper dirs to the path in z2.py.) __ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: [EMAIL PROTECTED] Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __ - Original Message - From: Steinar Rune Eriksen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 11, 2000 6:49 AM Subject: [Zope] Python + COM (from external method) How come this fails... -- import win32com.client oOleObj = win32com.client.Dispatch("DSOleFile.PropertyReader") -- when run from Zope (within and External Method) when it works from Python standalone on the same machine ? SRE ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. Admin Orion System AS ** ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] need some basic help
As superuser add a user and give him the manager role. - Original Message - From: Dan Huston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 11, 2000 11:09 AM Subject: [Zope] need some basic help Hello Folks, So I downloaded Zope and installed it on my sun box and on my nt box. I can go to the manage page as the admin and it all looks like it installed fine. So I tried to create a folder but the superuser cannot own a folder it says. So I figure I can create a folder in the zope dir as one of the users I have defined, but then how do I add objects to that folder? The only login that works at the manage page is the admin password. Is there a different page for users to go to that is similar to the manage page? I can believe that the admin would have to add all of the objects as that would seem un-Zope-ish. I have looked at a lot of docs but they were either so basic as not to address hands on stuff (devshed) or advanced enough that it was assumed that you could do this simple task. Can someone straighten me out? Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] Request for Comment: Zope API naming convention
Jim Fulton wrote: There is a proposal to adopt a naming convention for all new Zope API methods at: http://dev.zope.org/Wikis/DevSite/Proposals/APINamingConvention Comments are gratefully accepted at: http://dev.zope.org/Wikis/DevSite/Proposals/APINamingConventionDiscussion Please make comments by Wednesday April 16. Sorry, make that August 16. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] Permission
Tom Deprez wrote: Hi, I have this q'n already a long time in my head and I still don't know the answer to it. It has to do with the security-view. I hope that someone can shed a light on my brains. Why is their an Acquire permission (referred to as acq_perm in following text) checkbox column? It allows you to honor permission settings made in containing objects. In order to change a permission for a certain role, we have to check or uncheck this permission at the roles permission checkbox. I don't understand this. You can grant permissions to a role locally, regardless of whether you acquire permission settings. If you don't acquire, then the role only gets the permissions you set, otherwise, it *may* get permissions from above. However, for this to work we have to uncheck the acq_perm column (because if this one is checked, the permission is taken from parent-folder-objects anyway, the value of the role checkbox doesn't counts at that moment). You don't have to ncheck the acq_perm column if you simply want to grant a permission to a role. You only need to uncheck the acq_perm column if you want to prevent containing objects from granting a permission to other roles. As a drawback, this means that all roles have to be checked/unchecked, because they don't acquire the permission anymore from one of its parents-folder-objects. So don't uncheck the acq_perm column. Now, why couldn't this be implemented like the following? Isn't this easier to grasp? The Acq_perm column doesn't exists. Assume that acquisition of a permission is always Active. The checkboxes of the role show their actual value (according to the acquisition). Thus if permissionA is checked in the parent-object, permissionA is also checked. If you want, for a certain role that this permission is not given, you uncheck permissionA. The subobject will show an unchecked permissionA box (because it acquires from its parent). In order to give the subobject again the permission, we only have to check permissionA. The problem with this is that it doesn't recognize changes made to containers later. A) In the first approach we've to uncheck the acq_perm checkbox and have to set the checkbox of every role according to how we want the permission to be handled by that role. You don't need to uncheck the acq_perm checkbox unless you want to prevent containers from granting permissions. B) In the second approach we've to uncheck the permission checkbox of the role(s). Other roles are not effected. Am I missing something here? Is my explenation somewhere wrong? Why does Zope uses the first approach? Which, sounds for me, a little bit more complicated. By acquiring permission settings you are allowing containers to grant a permission to a role today or sometime in the future. This allows someone to control permissions in a centralized fashion. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Zope on AlphaStationNT...
I am a total Zope newbie. I am trying to run Zope on a AlphaStation running NT. I get a "service specific error 1" when I try to start Zope. I am using a utility called FX!32 which lets me run Win32 programs on my Alpha. "Compaq FX!32 (TM) lets you install and run 32 bit, x86 programs on your Windows NT Alpha system." Does anyone have any info that might help? Please reply to [EMAIL PROTECTED] as I am not subscribed to the list yet. Thanks! jrh
Re: [Zope] QSurvey 0.23 and Zope 2.2.1b
Hi, Alexander I have not worked with 2.2.1b yet and have not seen this. But it sounds like the import is expecting things to be in a different order than the export, which does not help much for a solution. Thus I agree with the error message: (Waaa). If it wasn't for the b I would possibly: 1. Upgrade a test zope to 2.2.1b that has the QSurvey working 2. Export that Product 3. See if the new export works with the new 2.2.1b ZODB in a different install. I would also submit a bug report to the Collector. -- Jim Washington Just installed Z2.2.1b, successfully imported some products but when trying to import QSurvey 0.23 got the message: Zope Error Zope has encountered an error while publishing this resource. Error Type: Permission mapping error Error Value: Attempted to map a permission to a permission, Add QSurveyResultsItems, that is not valid. This should never happen. (Waaa). Any suggestions? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )