<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12359] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12359">12359</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-01-16 09:46:32 -0800 (Thu, 16 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make sure all cli tools use a service class derived from WorkerService. Also add an assert to ensure that is the case.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertoolscalverifypy">CalendarServer/trunk/calendarserver/tools/calverify.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolscmdlinepy">CalendarServer/trunk/calendarserver/tools/cmdline.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsdbinspectpy">CalendarServer/trunk/calendarserver/tools/dbinspect.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsexportpy">CalendarServer/trunk/calendarserver/tools/export.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsmigrate_verifypy">CalendarServer/trunk/calendarserver/tools/migrate_verify.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsobliteratepy">CalendarServer/trunk/calendarserver/tools/obliterate.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsshellterminalpy">CalendarServer/trunk/calendarserver/tools/shell/terminal.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolstesttest_calverifypy">CalendarServer/trunk/calendarserver/tools/test/test_calverify.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsupgradepy">CalendarServer/trunk/calendarserver/tools/upgrade.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsvalidcalendardatapy">CalendarServer/trunk/calendarserver/tools/validcalendardata.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsworkitemspy">CalendarServer/trunk/calendarserver/tools/workitems.py</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#CalendarServertrunk">CalendarServer/trunk/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunk"></a>
<div class="propset"><h4>Property changes: CalendarServer/trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx">   + /CalDAVTester/trunk:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><a id="CalendarServertrunkcalendarservertoolscalverifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/calverify.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/calverify.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/calverify.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> from pycalendar.period import Period
</span><span class="cx"> from pycalendar.timezone import Timezone
</span><span class="cx"> 
</span><del>-from twisted.application.service import Service
</del><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.python import usage
</span><span class="cx"> from twisted.python.usage import Options
</span><span class="lines">@@ -78,7 +77,7 @@
</span><span class="cx"> from txdav.common.datastore.sql_tables import schema, _BIND_MODE_OWN
</span><span class="cx"> from txdav.common.icommondatastore import InternalDataStoreError
</span><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> 
</span><span class="cx"> from calendarserver.tools import tables
</span><span class="cx"> from calendarserver.tools.util import getDirectory
</span><span class="lines">@@ -386,14 +385,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class CalVerifyService(Service, object):
</del><ins>+class CalVerifyService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Base class for common service behaviors.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, reactor, config):
</span><del>-        super(CalVerifyService, self).__init__()
-        self.store = store
</del><ins>+        super(CalVerifyService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.reactor = reactor
</span><span class="lines">@@ -409,32 +407,12 @@
</span><span class="cx">         self.totalExceptions = None
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
-        &quot;&quot;&quot;
-        Start the service.
-        &quot;&quot;&quot;
-        super(CalVerifyService, self).startService()
-        self.doCalVerify()
-
-
-    def stopService(self):
-        &quot;&quot;&quot;
-        Stop the service.  Nothing to do; everything should be finished by this
-        time.
-        &quot;&quot;&quot;
-        # TODO: stopping this service mid-export should really stop the export
-        # loop, but this is not implemented because nothing will actually do it
-        # except hitting ^C (which also calls reactor.stop(), so that will exit
-        # anyway).
-        pass
-
-
</del><span class="cx">     def title(self):
</span><span class="cx">         return &quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def doCalVerify(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Do the operation stopping the reactor when done.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -444,11 +422,9 @@
</span><span class="cx">             yield self.doAction()
</span><span class="cx">             self.output.close()
</span><span class="cx">         except:
</span><del>-            log.failure(&quot;doCalVerify()&quot;)
</del><ins>+            log.failure(&quot;doWork()&quot;)
</ins><span class="cx"> 
</span><del>-        self.reactor.stop()
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     def directoryService(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Get an appropriate directory service for this L{CalVerifyService}'s
</span><span class="lines">@@ -2792,7 +2768,8 @@
</span><span class="cx">         self.output.write(&quot;\n&quot;)
</span><span class="cx">         self.output.write(&quot;Actual RECURRENCE-ID: %s.\n&quot; % (rid,))
</span><span class="cx"> 
</span><del>-        oldUID = yield calendarObj.split(rid=rid)
</del><ins>+        oldObj = yield calendarObj.split(rid=rid)
+        oldUID = oldObj.uid()
</ins><span class="cx"> 
</span><span class="cx">         self.output.write(&quot;\n&quot;)
</span><span class="cx">         self.output.write(&quot;Split Resource: %s at %s, old UID: %s.\n&quot; % (resid, rid, oldUID,))
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolscmdlinepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/cmdline.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/cmdline.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/cmdline.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -68,6 +68,13 @@
</span><span class="cx">         will be imported and used.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><ins>+    # We want to validate that the actual service is always an instance of WorkerService, so wrap the
+    # service maker callback inside a function that does that check
+    def _makeValidService(store):
+        service = serviceClass(store)
+        assert isinstance(service, WorkerService)
+        return service
+
</ins><span class="cx">     # Install std i/o observer
</span><span class="cx">     if verbose:
</span><span class="cx">         observer = StandardIOObserver()
</span><span class="lines">@@ -83,7 +90,7 @@
</span><span class="cx">         checkDirectories(config)
</span><span class="cx"> 
</span><span class="cx">         config.ProcessType = &quot;Utility&quot;
</span><del>-        config.UtilityServiceClass = serviceClass
</del><ins>+        config.UtilityServiceClass = _makeValidService
</ins><span class="cx"> 
</span><span class="cx">         autoDisableMemcached(config)
</span><span class="cx"> 
</span><span class="lines">@@ -172,5 +179,8 @@
</span><span class="cx">         By default, stop the reactor after doWork( ) finishes.  Subclasses
</span><span class="cx">         can override this if they want different behavior.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        from twisted.internet import reactor
-        reactor.stop()
</del><ins>+        if hasattr(self, &quot;reactor&quot;):
+            self.reactor.stop()
+        else:
+            from twisted.internet import reactor
+            reactor.stop()
</ins></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsdbinspectpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/dbinspect.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/dbinspect.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/dbinspect.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -23,12 +23,11 @@
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> from calendarserver.tools import tables
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> from pycalendar.datetime import DateTime
</span><span class="cx"> from twext.enterprise.dal.syntax import Select, Parameter, Count, Delete, \
</span><span class="cx">     Constant
</span><del>-from twisted.application.service import Service
-from twisted.internet.defer import inlineCallbacks, returnValue
</del><ins>+from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</ins><span class="cx"> from twisted.python.filepath import FilePath
</span><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options
</span><span class="lines">@@ -851,14 +850,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DBInspectService(Service, object):
</del><ins>+class DBInspectService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, exports the appropriate records, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, reactor, config):
</span><del>-        super(DBInspectService, self).__init__()
-        self.store = store
</del><ins>+        super(DBInspectService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.reactor = reactor
</span><span class="cx">         self.config = config
</span><span class="lines">@@ -866,11 +864,10 @@
</span><span class="cx">         self.commandMap = {}
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Start the service.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        super(DBInspectService, self).startService()
</del><span class="cx"> 
</span><span class="cx">         # Register commands
</span><span class="cx">         self.registerCommand(TableSizes)
</span><span class="lines">@@ -890,7 +887,16 @@
</span><span class="cx">         self.registerCommand(EventsInTimerange)
</span><span class="cx">         self.doDBInspect()
</span><span class="cx"> 
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><ins>+
+    def postStartService(self):
+        &quot;&quot;&quot;
+        Don't quit right away
+        &quot;&quot;&quot;
+        pass
+
+
</ins><span class="cx">     def registerCommand(self, cmd):
</span><span class="cx">         self.commands.append(cmd.name())
</span><span class="cx">         self.commandMap[cmd.name()] = cmd
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsexportpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/export.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/export.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/export.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -42,13 +42,12 @@
</span><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><del>-from twisted.application.service import Service
</del><span class="cx"> 
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twistedcaldav.ical import Component
</span><span class="cx"> 
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> 
</span><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="lines">@@ -285,14 +284,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class ExporterService(Service, object):
</del><ins>+class ExporterService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, exports the appropriate records, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, reactor, config):
</span><del>-        super(ExporterService, self).__init__()
-        self.store = store
</del><ins>+        super(ExporterService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.reactor = reactor
</span><span class="lines">@@ -300,16 +298,8 @@
</span><span class="cx">         self._directory = self.store.directoryService()
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
-        &quot;&quot;&quot;
-        Start the service.
-        &quot;&quot;&quot;
-        super(ExporterService, self).startService()
-        self.doExport()
-
-
</del><span class="cx">     @inlineCallbacks
</span><del>-    def doExport(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Do the export, stopping the reactor when done.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -326,11 +316,9 @@
</span><span class="cx">             # update stuff needed to happen, don't want to undo it.
</span><span class="cx">             self.output.close()
</span><span class="cx">         except:
</span><del>-            log.failure(&quot;doExport()&quot;)
</del><ins>+            log.failure(&quot;doWork()&quot;)
</ins><span class="cx"> 
</span><del>-        self.reactor.stop()
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     def directoryService(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Get an appropriate directory service.
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsmigrate_verifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/migrate_verify.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -17,9 +17,6 @@
</span><span class="cx"> ##
</span><span class="cx"> from __future__ import print_function
</span><span class="cx"> 
</span><del>-from txdav.common.datastore.sql_tables import schema, _BIND_MODE_OWN
-from twext.enterprise.dal.syntax import Select, Parameter
-
</del><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> This tool takes a list of files paths from a file store being migrated
</span><span class="cx"> and compares that to the results of a migration to an SQL store. Items
</span><span class="lines">@@ -29,16 +26,19 @@
</span><span class="cx"> import os
</span><span class="cx"> import sys
</span><span class="cx"> 
</span><del>-from twisted.application.service import Service
</del><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options
</span><span class="cx"> 
</span><ins>+from twext.enterprise.dal.syntax import Select, Parameter
</ins><span class="cx"> from twext.python.log import Logger
</span><ins>+
</ins><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from txdav.common.datastore.sql_tables import schema, _BIND_MODE_OWN
</ins><span class="cx"> 
</span><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
+
</ins><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> VERSION = &quot;1&quot;
</span><span class="lines">@@ -118,14 +118,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class MigrateVerifyService(Service, object):
</del><ins>+class MigrateVerifyService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, does its stuff, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, reactor, config):
</span><del>-        super(MigrateVerifyService, self).__init__()
-        self.store = store
</del><ins>+        super(MigrateVerifyService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.reactor = reactor
</span><span class="lines">@@ -141,16 +140,8 @@
</span><span class="cx">         self.missingResources = []
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
-        &quot;&quot;&quot;
-        Start the service.
-        &quot;&quot;&quot;
-        super(MigrateVerifyService, self).startService()
-        self.doMigrateVerify()
-
-
</del><span class="cx">     @inlineCallbacks
</span><del>-    def doMigrateVerify(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Do the work, stopping the reactor when done.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -163,11 +154,9 @@
</span><span class="cx">         except ConfigError:
</span><span class="cx">             pass
</span><span class="cx">         except:
</span><del>-            log.failure(&quot;doMigrateVerify()&quot;)
</del><ins>+            log.failure(&quot;doWork()&quot;)
</ins><span class="cx"> 
</span><del>-        self.reactor.stop()
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     def readPaths(self):
</span><span class="cx"> 
</span><span class="cx">         self.output.write(&quot;-- Reading data file: %s\n&quot; % (self.options[&quot;data&quot;]))
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsobliteratepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/obliterate.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/obliterate.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/obliterate.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> import sys
</span><span class="cx"> import time
</span><span class="cx"> 
</span><del>-from twisted.application.service import Service
</del><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options
</span><span class="lines">@@ -42,7 +41,7 @@
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><span class="cx"> from txdav.common.datastore.sql_tables import schema, _BIND_MODE_OWN
</span><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> 
</span><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="lines">@@ -138,14 +137,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class ObliterateService(Service, object):
</del><ins>+class ObliterateService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, does its stuff, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, reactor, config):
</span><del>-        super(ObliterateService, self).__init__()
-        self.store = store
</del><ins>+        super(ObliterateService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.reactor = reactor
</span><span class="lines">@@ -159,16 +157,8 @@
</span><span class="cx">         self.attachments = set()
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
-        &quot;&quot;&quot;
-        Start the service.
-        &quot;&quot;&quot;
-        super(ObliterateService, self).startService()
-        self.doObliterate()
-
-
</del><span class="cx">     @inlineCallbacks
</span><del>-    def doObliterate(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Do the work, stopping the reactor when done.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -186,11 +176,9 @@
</span><span class="cx">         except ConfigError:
</span><span class="cx">             pass
</span><span class="cx">         except:
</span><del>-            log.failure(&quot;doObliterate()&quot;)
</del><ins>+            log.failure(&quot;doWork()&quot;)
</ins><span class="cx"> 
</span><del>-        self.reactor.stop()
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     @inlineCallbacks
</span><span class="cx">     def obliterateOrphanedProperties(self):
</span><span class="cx">         &quot;&quot;&quot;
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsshellterminalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/shell/terminal.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/shell/terminal.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/shell/terminal.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -38,12 +38,11 @@
</span><span class="cx"> from twisted.python.failure import Failure
</span><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><del>-from twisted.internet.defer import Deferred
</del><ins>+from twisted.internet.defer import Deferred, succeed
</ins><span class="cx"> from twisted.internet.defer import inlineCallbacks
</span><span class="cx"> from twisted.internet.stdio import StandardIO
</span><span class="cx"> from twisted.conch.recvline import HistoricRecvLine as ReceiveLineProtocol
</span><span class="cx"> from twisted.conch.insults.insults import ServerProtocol
</span><del>-from twisted.application.service import Service
</del><span class="cx"> 
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> from calendarserver.tools.util import getDirectory
</span><span class="cx"> from calendarserver.tools.shell.cmd import Commands, UsageError as CommandUsageError
</span><span class="cx"> 
</span><span class="lines">@@ -95,7 +94,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class ShellService(Service, object):
</del><ins>+class ShellService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     A L{ShellService} collects all the information that a shell needs to run;
</span><span class="cx">     when run, it invokes the shell on stdin/stdout.
</span><span class="lines">@@ -117,21 +116,19 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, directory, options, reactor, config):
</span><del>-        super(ShellService, self).__init__()
-        self.store      = store
-        self.directory  = directory
-        self.options    = options
-        self.reactor    = reactor
-        self.config     = config
</del><ins>+        super(ShellService, self).__init__(store)
+        self.directory = directory
+        self.options = options
+        self.reactor = reactor
+        self.config = config
</ins><span class="cx">         self.terminalFD = None
</span><del>-        self.protocol   = None
</del><ins>+        self.protocol = None
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><del>-        Start the service.
</del><ins>+        Service startup.
</ins><span class="cx">         &quot;&quot;&quot;
</span><del>-        super(ShellService, self).startService()
</del><span class="cx"> 
</span><span class="cx">         # Set up the terminal for interactive action
</span><span class="cx">         self.terminalFD = sys.__stdin__.fileno()
</span><span class="lines">@@ -140,8 +137,16 @@
</span><span class="cx"> 
</span><span class="cx">         self.protocol = ServerProtocol(lambda: ShellProtocol(self))
</span><span class="cx">         StandardIO(self.protocol)
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    def postStartService(self):
+        &quot;&quot;&quot;
+        Don't quit right away
+        &quot;&quot;&quot;
+        pass
+
+
</ins><span class="cx">     def stopService(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Stop the service.
</span><span class="lines">@@ -280,7 +285,7 @@
</span><span class="cx">                 word = &quot;&quot;
</span><span class="cx">             else:
</span><span class="cx">                 word = tokens[-1]
</span><del>-            cmd  = tokens.pop(0)
</del><ins>+            cmd = tokens.pop(0)
</ins><span class="cx">         else:
</span><span class="cx">             word = cmd = &quot;&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolstesttest_calverifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/test/test_calverify.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/test/test_calverify.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/test/test_calverify.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -3066,8 +3066,7 @@
</span><span class="cx">         }
</span><span class="cx">         output = StringIO()
</span><span class="cx">         calverify = EventSplitService(self._sqlCalendarStore, options, output, reactor, config)
</span><del>-        oldObj = yield calverify.doAction()
-        oldUID = oldObj.uid()
</del><ins>+        oldUID = yield calverify.doAction()
</ins><span class="cx"> 
</span><span class="cx">         relsubs = dict(self.subs)
</span><span class="cx">         relsubs[&quot;relID&quot;] = oldUID
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/upgrade.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/upgrade.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/upgrade.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -25,15 +25,15 @@
</span><span class="cx"> import sys
</span><span class="cx"> import time
</span><span class="cx"> 
</span><ins>+from twisted.internet.defer import succeed
</ins><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><span class="cx"> 
</span><span class="cx"> from twext.python.log import Logger, LogLevel, formatEvent, addObserver
</span><span class="cx"> 
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><del>-from twisted.application.service import Service
</del><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> from calendarserver.tap.caldav import CalDAVServiceMaker
</span><span class="cx"> 
</span><span class="cx"> log = Logger()
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class UpgraderService(Service, object):
</del><ins>+class UpgraderService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, exports the appropriate records, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="lines">@@ -130,8 +130,7 @@
</span><span class="cx">     started = False
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, reactor, config):
</span><del>-        super(UpgraderService, self).__init__()
-        self.store = store
</del><ins>+        super(UpgraderService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.reactor = reactor
</span><span class="lines">@@ -139,7 +138,7 @@
</span><span class="cx">         self._directory = None
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Immediately stop.  The upgrade will have been run before this.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -155,7 +154,13 @@
</span><span class="cx">             else:
</span><span class="cx">                 self.output.write(&quot;Upgrade complete, shutting down.\n&quot;)
</span><span class="cx">         UpgraderService.started = True
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><ins>+
+    def postStartService(self):
+        &quot;&quot;&quot;
+        Quit right away
+        &quot;&quot;&quot;
</ins><span class="cx">         from twisted.internet import reactor
</span><span class="cx">         from twisted.internet.error import ReactorNotRunning
</span><span class="cx">         try:
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsvalidcalendardatapy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/validcalendardata.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/validcalendardata.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/validcalendardata.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -21,8 +21,8 @@
</span><span class="cx"> for the server.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-from calendarserver.tools.cmdline import utilityMain
-from twisted.application.service import Service
</del><ins>+from calendarserver.tools.cmdline import utilityMain, WorkerService
+from twisted.internet.defer import succeed
</ins><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="lines">@@ -119,14 +119,13 @@
</span><span class="cx"> 
</span><span class="cx"> errorPrefix = &quot;Calendar data had unfixable problems:\n  &quot;
</span><span class="cx"> 
</span><del>-class ValidService(Service, object):
</del><ins>+class ValidService(WorkerService, object):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Service which runs, exports the appropriate records, then stops the reactor.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, store, options, output, input, reactor, config):
</span><del>-        super(ValidService, self).__init__()
-        self.store = store
</del><ins>+        super(ValidService, self).__init__(store)
</ins><span class="cx">         self.options = options
</span><span class="cx">         self.output = output
</span><span class="cx">         self.input = input
</span><span class="lines">@@ -135,7 +134,7 @@
</span><span class="cx">         self._directory = None
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Start the service.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -149,7 +148,7 @@
</span><span class="cx">             print(&quot;Calendar data OK&quot;)
</span><span class="cx">         else:
</span><span class="cx">             print(message)
</span><del>-        self.reactor.stop()
</del><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def parseCalendarData(self):
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsworkitemspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/workitems.py (12358 => 12359)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/workitems.py        2014-01-16 16:52:43 UTC (rev 12358)
+++ CalendarServer/trunk/calendarserver/tools/workitems.py        2014-01-16 17:46:32 UTC (rev 12359)
</span><span class="lines">@@ -23,9 +23,8 @@
</span><span class="cx"> import curses
</span><span class="cx"> import datetime
</span><span class="cx"> 
</span><del>-from twisted.internet.defer import inlineCallbacks
-from calendarserver.tools.cmdline import utilityMain
-from twisted.application.service import Service
</del><ins>+from twisted.internet.defer import inlineCallbacks, succeed
+from calendarserver.tools.cmdline import utilityMain, WorkerService
</ins><span class="cx"> from calendarserver.push.notifier import PushNotificationWork
</span><span class="cx"> from twistedcaldav.directory.directory import GroupCacherPollingWork
</span><span class="cx"> from txdav.caldav.datastore.scheduling.imip.inbound import IMIPPollingWork, IMIPReplyWork
</span><span class="lines">@@ -86,21 +85,29 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class WorkItemMonitorService(Service):
</del><ins>+class WorkItemMonitorService(WorkerService, object):
</ins><span class="cx"> 
</span><span class="cx">     def __init__(self, store):
</span><del>-        self.store = store
</del><ins>+        super(WorkItemMonitorService, self).__init__(store)
</ins><span class="cx">         from twisted.internet import reactor
</span><span class="cx">         self.reactor = reactor
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def startService(self):
</del><ins>+    def doWork(self):
</ins><span class="cx">         self.screen = curses.initscr()
</span><span class="cx">         self.windows = []
</span><span class="cx">         self.updateScreenGeometry()
</span><span class="cx">         self.reactor.callLater(0, self.updateDisplay)
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    def postStartService(self):
+        &quot;&quot;&quot;
+        Don't quit right away
+        &quot;&quot;&quot;
+        pass
+
+
</ins><span class="cx">     def updateScreenGeometry(self):
</span><span class="cx">         for win in self.windows:
</span><span class="cx">             del win
</span></span></pre>
</div>
</div>

</body>
</html>