Created
November 28, 2017 14:46
-
-
Save Bjwebb/e997ce4ad4960284a7aef1f9a0df02ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import translate.tools.pocount | |
import logging | |
logger = logging.getLogger(__name__) | |
ch = logging.StreamHandler() | |
ch.setLevel(logging.WARNING) | |
logger.addHandler(ch) | |
translate.tools.pocount.logger.addHandler(ch) | |
def summarize(title, stats, style=None, indent=8, incomplete_only=False): | |
return 0 | |
translate.tools.pocount.summarize = summarize | |
class summarizer(translate.tools.pocount.summarizer): | |
def __init__(self, filenames, style=None, incomplete_only=False): | |
self.totals = {} | |
self.filecount = 0 | |
self.longestfilename = 0 | |
self.style = style | |
self.incomplete_only = incomplete_only | |
self.complete_count = 0 | |
for filename in filenames: | |
if not os.path.exists(filename): | |
logger.error("cannot process %s: does not exist", filename) | |
continue | |
elif os.path.isdir(filename): | |
self.handledir(filename) | |
else: | |
self.handlefile(filename) | |
return print(self.totals) | |
summarizer(['docs/locale/es/LC_MESSAGES']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment