Skip to content

Commit 72694fd

Browse files
author
Richard Jones
committed
moving towards full database export
1 parent 7f208a9 commit 72694fd

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

TODO.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pending hyperdb: range searching of values (dates in particular)
1313
pending hyperdb: make creator, creation and activity available pre-commit
1414
pending hyperdb: migrate "id" property to be Number type
1515
pending hyperdb: allow classes to define their ordering (properties, asc/desc)
16+
pending hyperdb: entire database export and import (files, journals and all)
1617
pending instance: including much simpler upgrade path and the use of
1718
non-Python configuration files (ConfigParser)
1819
pending instance: move the header link config out into an html template

roundup/admin.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.21 2002-08-01 01:07:37 richard Exp $
19+
# $Id: admin.py,v 1.22 2002-08-16 04:26:42 richard Exp $
2020

2121
import sys, os, getpass, getopt, re, UserDict, shlex, shutil
2222
try:
@@ -808,17 +808,23 @@ def do_retire(self, args):
808808
return 0
809809

810810
def do_export(self, args):
811-
'''Usage: export class[,class] destination_dir
811+
'''Usage: export [class[,class]] destination_dir
812812
Export the database to tab-separated-value files.
813813
814814
This action exports the current data from the database into
815815
tab-separated-value files that are placed in the nominated destination
816816
directory. The journals are not exported.
817817
'''
818-
if len(args) < 2:
818+
# grab the directory to export to
819+
if len(args) < 1:
819820
raise UsageError, _('Not enough arguments supplied')
820-
classes = args[0].split(',')
821-
dir = args[1]
821+
dir = args[-1]
822+
823+
# get the list of classes to export
824+
if len(args) == 2:
825+
classes = args[0].split(',')
826+
else:
827+
classes = self.db.classes.keys()
822828

823829
# use the csv parser if we can - it's faster
824830
if csv is not None:
@@ -831,7 +837,7 @@ def do_export(self, args):
831837
f.write(':'.join(cl.properties.keys()) + '\n')
832838

833839
# all nodes for this class
834-
properties = cl.properties.items()
840+
properties = cl.getprops()
835841
for nodeid in cl.list():
836842
l = []
837843
for prop, proptype in properties:
@@ -1164,6 +1170,9 @@ def main(self):
11641170

11651171
#
11661172
# $Log: not supported by cvs2svn $
1173+
# Revision 1.21 2002/08/01 01:07:37 richard
1174+
# include info about new user roles
1175+
#
11671176
# Revision 1.20 2002/08/01 00:56:22 richard
11681177
# Added the web access and email access permissions, so people can restrict
11691178
# access to users who register through the email interface (for example).

0 commit comments

Comments
 (0)