Beispiel #1
0
 def __init__(self, filename, **keywords):
     BookWriter.__init__(self, filename, **keywords)
     if is_string(type(filename)):
         self.f = open(filename, 'w')
     else:
         self.f = filename
     self.filename = filename
Beispiel #2
0
def test_is_string():
    if PY2:
        assert is_string(type(u'a')) == True
    else:
        assert is_string(type('a')) == True
Beispiel #3
0
 def close(self):
     if is_string(type(self.filename)):
         self.f.close()