mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 06:56:13 +00:00
Reverted back yaml3 for ci failure
This commit is contained in:
@@ -13,16 +13,12 @@ except ImportError:
|
||||
else:
|
||||
import tablib.packages.yaml as yaml
|
||||
|
||||
|
||||
import tablib
|
||||
|
||||
|
||||
|
||||
title = 'yaml'
|
||||
extensions = ('yaml', 'yml')
|
||||
|
||||
|
||||
|
||||
def export_set(dataset):
|
||||
"""Returns YAML representation of Dataset."""
|
||||
|
||||
@@ -52,6 +48,7 @@ def import_book(dbook, in_stream):
|
||||
data.dict = sheet['data']
|
||||
dbook.add_sheet(data)
|
||||
|
||||
|
||||
def detect(stream):
|
||||
"""Returns True if given stream is valid YAML."""
|
||||
try:
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
__all__ = ['Composer', 'ComposerError']
|
||||
|
||||
from .error import MarkedYAMLError
|
||||
from error import MarkedYAMLError
|
||||
from events import StreamEndEvent, StreamStartEvent, AliasEvent, SequenceEndEvent, SequenceStartEvent, MappingEndEvent,\
|
||||
MappingStartEvent, ScalarEvent
|
||||
from nodes import MappingNode, ScalarNode, SequenceNode
|
||||
from .events import *
|
||||
from .nodes import *
|
||||
|
||||
|
||||
class ComposerError(MarkedYAMLError):
|
||||
@@ -72,7 +70,8 @@ class Composer:
|
||||
return self.anchors[anchor]
|
||||
event = self.peek_event()
|
||||
anchor = event.anchor
|
||||
if anchor is not None and anchor in self.anchors:
|
||||
if anchor is not None:
|
||||
if anchor in self.anchors:
|
||||
raise ComposerError("found duplicate anchor %r; first occurence"
|
||||
% anchor, self.anchors[anchor].start_mark,
|
||||
"second occurence", event.start_mark)
|
||||
|
||||
@@ -5,13 +5,7 @@ __all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
|
||||
from .error import *
|
||||
from .nodes import *
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import collections
|
||||
import datetime
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
import collections, datetime, base64, binascii, re, sys, types
|
||||
|
||||
class ConstructorError(MarkedYAMLError):
|
||||
pass
|
||||
@@ -689,4 +683,3 @@ Constructor.add_multi_constructor(
|
||||
Constructor.add_multi_constructor(
|
||||
'tag:yaml.org,2002:python/object/new:',
|
||||
Constructor.construct_python_object_new)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user