[Zope-Checkins] SVN: Zope/trunk/lib/python/OFS/ Collector #1523:
replace the text field for importing .zexp files with a select list
Andreas Jung
andreas at andreas-jung.com
Wed Nov 3 13:11:21 EST 2004
Log message for revision 28331:
Collector #1523: replace the text field for importing .zexp files with a select list
Changed:
U Zope/trunk/lib/python/OFS/ObjectManager.py
U Zope/trunk/lib/python/OFS/dtml/importExport.dtml
-=-
Modified: Zope/trunk/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/trunk/lib/python/OFS/ObjectManager.py 2004-11-03 17:56:33 UTC (rev 28330)
+++ Zope/trunk/lib/python/OFS/ObjectManager.py 2004-11-03 18:11:21 UTC (rev 28331)
@@ -567,6 +567,18 @@
ob=self._getOb(id)
ob.manage_changeOwnershipType(explicit=0)
+ def list_imports(self):
+ listing = []
+ cfg = getConfiguration()
+ paths = [cfg.zopehome]
+ if not cfg.instancehome in paths:
+ paths.append(cfg.instancehome)
+ for impath in paths:
+ directory = os.path.join(impath, 'import')
+ listing += [f for f in os.listdir(directory)
+ if f.endswith('.zexp') or f.endswith('.xml')]
+ return listing
+
# FTP support methods
def manage_FTPlist(self, REQUEST):
Modified: Zope/trunk/lib/python/OFS/dtml/importExport.dtml
===================================================================
--- Zope/trunk/lib/python/OFS/dtml/importExport.dtml 2004-11-03 17:56:33 UTC (rev 28330)
+++ Zope/trunk/lib/python/OFS/dtml/importExport.dtml 2004-11-03 18:11:21 UTC (rev 28331)
@@ -88,11 +88,14 @@
</div>
</td>
<td align="left" valign="top">
- <input type="text" name="file" size="25" value="" />
+ <select name="file">
+ <dtml-in "list_imports()">
+ <option value="<dtml-var sequence-item>"><dtml-var sequence-item></option>
+ </dtml-in>
+ </select>
</td>
</tr>
<tr>
-
<td align="left" valign="top">
<div class="form-label">
Ownership
More information about the Zope-Checkins
mailing list