Example #1
0
	def __len__(self):
		if self._len is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._len = fileCountLines(
				self._filename + ".index"
			) - self._leadingLinesCount
		return self._len
Example #2
0
	def __len__(self) -> int:
		if self._len is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._len = fileCountLines(
				self._filename + ".index"
			) - self._leadingLinesCount
		return self._len
Example #3
0
    def __len__(self):
        from pyglossary.file_utils import fileCountLines

        if self._len is None:
            log.debug("Try not to use len(reader) as it takes extra time")
            self._len = fileCountLines(self._filename, newline="\nmsgid")
        return self._len
Example #4
0
	def __len__(self):
		if self._wordCount is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._wordCount = fileCountLines(
				self._filename,
				newline="\n\n",
			) - self._leadingLinesCount
		return self._wordCount
Example #5
0
	def __len__(self):
		if self._wordCount is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._wordCount = fileCountLines(
				self._filename,
				newline="\n\n",
			) - self._leadingLinesCount
		return self._wordCount
Example #6
0
 def __len__(self):
     if self._len is None:
         log.warning('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(
             self._filename,
             newline='\nmsgid',
         )
     return self._len
Example #7
0
 def __len__(self):
     if self._len is None:
         log.warning('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(
             self._filename,
             newline='\nmsgid',
         )
     return self._len
Example #8
0
 def __len__(self):
     from pyglossary.file_utils import fileCountLines
     if self._wordCount is None:
         log.debug("Try not to use len(reader) as it takes extra time")
         self._wordCount = fileCountLines(
             self._filename,
             newline="\nmsgid",
         )
     return self._wordCount
Example #9
0
 def __len__(self):
     from pyglossary.file_utils import fileCountLines
     if self._len is None:
         log.warning('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(
             self._filename,
             newline='\nmsgid',
         )
     return self._len
Example #10
0
 def __len__(self) -> int:
     from pyglossary.file_utils import fileCountLines
     if self._wordCount is None:
         if hasattr(self._file, "compression"):
             return 0
         log.debug("Try not to use len(reader) as it takes extra time")
         self._wordCount = fileCountLines(self._filename) - \
          self._leadingLinesCount
     return self._wordCount + len(self._resFileNames)
Example #11
0
 def __len__(self):
     from pyglossary.file_utils import fileCountLines
     if self._len is None:
         log.debug('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(
             self._filename,
             newline='\nmsgid',
         )
     return self._len
Example #12
0
 def __len__(self):
     if self._len is None:
         log.warning('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(
             self._filename) - self._leadingLinesCount
     return self._len
Example #13
0
	def __len__(self) -> int:
		if self._wordCount is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._wordCount = fileCountLines(self._filename) - \
				self._leadingLinesCount
		return self._wordCount + len(self._resFileNames)
Example #14
0
 def __len__(self):
     if self._len is None:
         log.warning('Try not to use len(reader) as it takes extra time')
         self._len = fileCountLines(self._filename) - self._leadingLinesCount
     return self._len
Example #15
0
	def __len__(self):
		if self._wordCount is None:
			log.debug("Try not to use len(reader) as it takes extra time")
			self._wordCount = fileCountLines(self._filename) - \
				self._leadingLinesCount
		return self._wordCount + len(self._resFileNames)
Example #16
0
 def __len__(self):
     if self._wordCount is None:
         log.debug('Try not to use len(reader) as it takes extra time')
         self._wordCount = fileCountLines(self._filename) - \
          self._leadingLinesCount
     return self._wordCount