<commit_before>#!/usr/bin/python

import pygtk
pygtk.require('2.0')
import gtk

import fontTools.ttx

class FontTreeStoreBuilder:

	def __init__(self, treestore):
		self.ts = treestore

	def add_object(self, parent, key, value):
		# Make sure item is decompiled
		try:
			getattr(value, "asdf")
		except AttributeError:
			pass
		if value.__class__ == fontTools.ttLib.getTableModule('glyf').Glyph:
			# Glyph type needs explicit expanding to be useful
			value.expand(self.font['glyf'])

		item = self.ts.append(parent, [key, '%s' % value.__class__.__name__])
		for k,v in sorted(value.__dict__.items()):<commit_msg>Expand CFF Index tables<commit_after>#!/usr/bin/python

import pygtk
pygtk.require('2.0')
import gtk

import fontTools.ttx
import fontTools.ttLib
import fontTools.cffLib

class FontTreeStoreBuilder:

	def __init__(self, treestore):
		self.ts = treestore

	def add_object(self, parent, key, value):
		# Make sure item is decompiled
		try:
			getattr(value, "asdf")
		except AttributeError:
			pass
		if isinstance(value, fontTools.ttLib.getTableModule('glyf').Glyph):
			# Glyph type needs explicit expanding to be useful
			value.expand(self.font['glyf'])
		if isinstance(value, fontTools.cffLib.Index):
			# Load all items
			for i in range(len(value)):
				value[i]

		item = self.ts.append(parent, [key, '%s' % value.__class__.__name__])
		for k,v in sorted(value.__dict__.items()):
{'fraction_non_alphanumeric': 0.12419700214132762, 'fraction_numerical': 0.0028551034975017845, 'mean_word_length': 4.519685039370079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3983688', 'n_tokens_mistral': 533, 'n_tokens_neox': 479, 'n_words': 121}