Commit cdd7234b authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/*.py: qq moved from zodbtools -> pygolang

See zodbtools@b1163449 for details.
parent 4a2407dc
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Copyright (C) 2017-2018 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
......@@ -22,7 +22,7 @@
from ZODB.tests import testSerialize
from ZODB import serialize
from zodbtools.util import escapeqq
from golang.gcompat import qq
def main():
# dump to go what to expect
......@@ -46,8 +46,8 @@ def main():
emit("\nvar _PyData_ClassName_Testv = [...]_PyDataClassName_TestEntry{")
for test in testv:
emit("\t{")
emit("\t\t%s," % escapeqq(test))
emit("\t\t%s," % escapeqq(r.getClassName(test)))
emit("\t\t%s," % qq(test))
emit("\t\t%s," % qq(r.getClassName(test)))
emit("\t},")
emit('\t{"aaa", "?.?"},') # invalid
emit("}")
......
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Copyright (C) 2017-2018 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
......@@ -22,7 +22,7 @@
from ZODB.FileStorage import FileStorage
from zodbtools.test.gen_testdata import gen_testdb
from zodbtools.util import escapeqq
from golang.gcompat import qq
import struct
......@@ -81,9 +81,9 @@ def main():
emit("\t\t\tTxnInfo:\tzodb.TxnInfo{")
emit("\t\t\t\tTid:\t%s," % hex64(txn.tid))
emit("\t\t\t\tStatus:\t'%s'," % txn.status)
emit("\t\t\t\tUser:\t\t[]byte(%s)," % escapeqq(txn.user))
emit("\t\t\t\tDescription:\t[]byte(%s)," % escapeqq(txn.description))
emit("\t\t\t\tExtension:\t[]byte(%s)," % escapeqq(th.ext))
emit("\t\t\t\tUser:\t\t[]byte(%s)," % qq(txn.user))
emit("\t\t\t\tDescription:\t[]byte(%s)," % qq(txn.description))
emit("\t\t\t\tExtension:\t[]byte(%s)," % qq(th.ext))
emit("\t\t\t},")
emit("\t\t},")
......@@ -118,14 +118,14 @@ def main():
data = "/* deleted */ nil"
datatid = "/* deleted */ 0"
else:
data = "[]byte(%s)" % escapeqq(drec.data)
data = "[]byte(%s)" % qq(drec.data)
datatid = "/* copy from */ " + hex64(drec.data_txn)
else:
rawdata = drec.data
data = "/* same as ^^^ */ sameAsRaw"
datatid = "/* no copy */ 0"
emit("\t\t\t\t[]byte(%s)," % escapeqq(rawdata))
emit("\t\t\t\t[]byte(%s)," % qq(rawdata))
emit("\t\t\t\t%s," % data)
emit("\t\t\t\t%s," % datatid)
emit("\t\t\t},")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment