@@ -48,7 +48,7 @@ class Indent:
4848 :param type: The indent character.
4949 """
5050
51- def __init__ (self , size : int = 0 , type : str = " \t " ): # noqa A002 # pylint: disable=redefined-builtin
51+ def __init__ (self , size : int = 0 , type : str = ' \t ' ): # noqa A002 # pylint: disable=redefined-builtin
5252 self .size = int (size )
5353 self .type = str (type )
5454
@@ -134,18 +134,18 @@ class StringList(List[str]):
134134
135135 def __init__ (self , iterable : Iterable [String ] = (), convert_indents : bool = False ) -> None :
136136 if isinstance (iterable , str ):
137- iterable = iterable .split (" \n " )
137+ iterable = iterable .split (' \n ' )
138138
139139 self .indent = Indent ()
140140 self .convert_indents = convert_indents
141141 super ().__init__ ([self ._make_line (str (x )) for x in iterable ])
142142
143143 def _make_line (self , line : str ) -> str :
144144 if not str (self .indent_type ).strip (" \t " ) and self .convert_indents :
145- if self .indent_type == " \t " :
146- line = convert_indents (line , tab_width = 1 , from_ = " " , to = " \t " )
145+ if self .indent_type == ' \t ' :
146+ line = convert_indents (line , tab_width = 1 , from_ = " " , to = ' \t ' )
147147 else : # pragma: no cover
148- line = convert_indents (line , tab_width = 1 , from_ = " \t " , to = self .indent_type )
148+ line = convert_indents (line , tab_width = 1 , from_ = ' \t ' , to = self .indent_type )
149149
150150 return f"{ self .indent } { line } " .rstrip ()
151151
@@ -156,7 +156,7 @@ def append(self, line: String) -> None:
156156 :param line:
157157 """
158158
159- for inner_line in str (line ).split (" \n " ):
159+ for inner_line in str (line ).split (' \n ' ):
160160 super ().append (self ._make_line (inner_line ))
161161
162162 def extend (self , iterable : Iterable [String ]) -> None :
@@ -199,9 +199,9 @@ def insert(self, index: int, line: String) -> None:
199199 lines : List [str ]
200200
201201 if index < 0 or index > len (self ):
202- lines = str (line ).split (" \n " )
202+ lines = str (line ).split (' \n ' )
203203 else :
204- lines = cast (list , reversed (str (line ).split (" \n " )))
204+ lines = cast (list , reversed (str (line ).split (' \n ' )))
205205
206206 for inner_line in lines :
207207 super ().insert (index , self ._make_line (inner_line ))
@@ -278,7 +278,7 @@ def set_indent_size(self, size: int = 0):
278278
279279 self .indent .size = int (size )
280280
281- def set_indent_type (self , indent_type : str = " \t " ):
281+ def set_indent_type (self , indent_type : str = ' \t ' ):
282282 """
283283 Sets the type of the indent to insert at the beginning of new lines.
284284
@@ -340,7 +340,7 @@ def __str__(self) -> str:
340340 Returns the :class:`~domdf_python_tools.stringlist.StringList` as a string.
341341 """
342342
343- return " \n " .join (self )
343+ return ' \n ' .join (self )
344344
345345 def __eq__ (self , other ) -> bool :
346346 """
@@ -398,7 +398,7 @@ def with_indent_size(self, size: int = 0):
398398 self .indent_size = original_indent_size
399399
400400 @contextmanager
401- def with_indent_type (self , indent_type : str = " \t " ):
401+ def with_indent_type (self , indent_type : str = ' \t ' ):
402402 """
403403 Context manager to temporarily use a different indent type.
404404
0 commit comments