import gettext
import os
import re
-from urllib.request import urlopen
from lxml import etree
+import six
from .parser import parser
-from . import dcparser
+from . import dcparser, DCNS
from .functions import lang_code_3to2
class WLDocument:
def __init__(self, filename=None, url=None):
- source = filename or urlopen(url)
+ source = filename or six.moves.urllib.request.urlopen(url)
tree = etree.parse(source, parser=parser)
self.tree = tree
tree.getroot().document = self
- self.base_meta = dcparser.BookInfo({}, {}, validate_required=False)
+ self.base_meta = dcparser.BookInfo({}, {
+ DCNS('language'): ["pol"],
+ }, validate_required=False)
@property
def meta(self):