[Mailman-checkins] [Branch ~mailman-coders/mailman/2.1] (no title)
revno: 986 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.1 timestamp: Fri 2007-08-03 17:46:05 -0700 message: Backported dumpdb changes from the 3.0 branch to allow dumping of marshals. This has been broken since 2.1.5! modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2005-08-27 01:40:17 + +++ b/bin/dumpdb2007-08-04 00:46:05 + @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! /usr/bin/python # # Copyright (C) 1998-2005 by the Free Software Foundation, Inc. # @@ -45,16 +45,15 @@ -- or if the file ends in neither suffix -- use the -p or -m flags. -import os import sys import getopt import pprint -from cPickle import load +import cPickle +import marshal from types import StringType import paths # Import this /after/ paths so that the sys.path is properly hacked -from email.Generator import Generator from Mailman.i18n import _ PROGRAM = sys.argv[0] @@ -121,37 +120,35 @@ # Handle dbs pp = pprint.PrettyPrinter(indent=4) if filetype == 1: -# BAW: this probably doesn't work if there are mixed types of .db -# files (i.e. some marshals, some bdbs). -d = DumperSwitchboard().read(filename) +load = marshal.load +typename = 'marshal' +else: +load = cPickle.load +typename = 'pickle' +fp = open(filename) +m = [] +try: +cnt = 1 if doprint: -pp.pprint(d) -return d -else: -fp = open(filename) -m = [] -try: -cnt = 1 +print _('[- start %(typename)s file -]') +while True: +try: +obj = load(fp) +except EOFError: +if doprint: +print _('[- end %(typename)s file -]') +break if doprint: -print _('[- start pickle file -]') -while True: -try: -obj = load(fp) -except EOFError: -if doprint: -print _('[- end pickle file -]') -break -if doprint: -print _('- start object %(cnt)s -') -if isinstance(obj, StringType): -print obj -else: -pp.pprint(obj) -cnt += 1 -m.append(obj) -finally: -fp.close() -return m +print _('- start object %(cnt)s -') +if isinstance(obj, StringType): +print obj +else: +pp.pprint(obj) +cnt += 1 +m.append(obj) +finally: +fp.close() +return m -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.1 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org
[Mailman-checkins] [Branch ~mailman-coders/mailman/2.2] (no title)
revno: 986 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.2 timestamp: Fri 2007-08-03 17:44:44 -0700 message: Backported dumpdb changes from the 3.0 branch to allow dumping of marshals. This has been broken since 2.1.5! modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2005-08-27 01:40:17 + +++ b/bin/dumpdb2007-08-04 00:44:44 + @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! /usr/bin/python # # Copyright (C) 1998-2005 by the Free Software Foundation, Inc. # @@ -45,16 +45,15 @@ -- or if the file ends in neither suffix -- use the -p or -m flags. -import os import sys import getopt import pprint -from cPickle import load +import cPickle +import marshal from types import StringType import paths # Import this /after/ paths so that the sys.path is properly hacked -from email.Generator import Generator from Mailman.i18n import _ PROGRAM = sys.argv[0] @@ -121,37 +120,35 @@ # Handle dbs pp = pprint.PrettyPrinter(indent=4) if filetype == 1: -# BAW: this probably doesn't work if there are mixed types of .db -# files (i.e. some marshals, some bdbs). -d = DumperSwitchboard().read(filename) +load = marshal.load +typename = 'marshal' +else: +load = cPickle.load +typename = 'pickle' +fp = open(filename) +m = [] +try: +cnt = 1 if doprint: -pp.pprint(d) -return d -else: -fp = open(filename) -m = [] -try: -cnt = 1 +print _('[- start %(typename)s file -]') +while True: +try: +obj = load(fp) +except EOFError: +if doprint: +print _('[- end %(typename)s file -]') +break if doprint: -print _('[- start pickle file -]') -while True: -try: -obj = load(fp) -except EOFError: -if doprint: -print _('[- end pickle file -]') -break -if doprint: -print _('- start object %(cnt)s -') -if isinstance(obj, StringType): -print obj -else: -pp.pprint(obj) -cnt += 1 -m.append(obj) -finally: -fp.close() -return m +print _('- start object %(cnt)s -') +if isinstance(obj, StringType): +print obj +else: +pp.pprint(obj) +cnt += 1 +m.append(obj) +finally: +fp.close() +return m -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.2 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.2/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org
[Mailman-checkins] [Branch ~mailman-coders/mailman/2.1] (no title)
revno: 987 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.1 timestamp: Fri 2007-08-03 18:09:33 -0700 message: Ooops! The previous rev copied a configured file by mistake. Fixed. modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2007-08-04 00:46:05 + +++ b/bin/dumpdb2007-08-04 01:09:33 + @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! @PYTHON@ # # Copyright (C) 1998-2005 by the Free Software Foundation, Inc. # -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.1 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org
[Mailman-checkins] [Branch ~mailman-coders/mailman/2.2] (no title)
revno: 987 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.2 timestamp: Fri 2007-08-03 18:10:34 -0700 message: Ooops! The previous rev copied a configured file by mistake. Fixed. modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2007-08-04 00:44:44 + +++ b/bin/dumpdb2007-08-04 01:10:34 + @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! @PYTHON@ # # Copyright (C) 1998-2005 by the Free Software Foundation, Inc. # -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.2 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.2/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org
[Mailman-checkins] [Branch ~mailman-coders/mailman/2.1] (no title)
revno: 988 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.1 timestamp: Fri 2007-08-03 18:16:56 -0700 message: Updated copyright year. modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2007-08-04 01:09:33 + +++ b/bin/dumpdb2007-08-04 01:16:56 + @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2005 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.1 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org
[Mailman-checkins] [Branch ~mailman-coders/mailman/2.2] (no title)
revno: 988 committer: Mark Sapiro [EMAIL PROTECTED] branch nick: 2.2 timestamp: Fri 2007-08-03 18:16:07 -0700 message: Updated copyright year. modified: bin/dumpdb === modified file 'bin/dumpdb' --- a/bin/dumpdb2007-08-04 01:10:34 + +++ b/bin/dumpdb2007-08-04 01:16:07 + @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2005 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License -- (no title) https://code.launchpad.net/~mailman-coders/mailman/2.2 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.2/+subscription/mailman-checkins. ___ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org