<commit_before>#!/usr/bin/env python
import sys
from gi.repository import Gtk, Gio, Gdk, GObject
from asciiplayback import *

class HeaderBarWindow(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title="ASCIIPlayback")
        self.set_default_size(400, 200)

        self.player = ASCIIPlayback(filename=sys.argv[1])

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        labelbox = Gtk.Box()
        label = Gtk.Label()
        label.set_alignment(0, 0)
        label.set_width_chars(self.player.asciimation.size[0])
        label.set_max_width_chars(self.player.asciimation.size[0])
        labelbox.pack_start(label, True, True, 0)
        box.pack_start(labelbox, True, True, 0)
        self.do_animate(label)

        ab = Gtk.ActionBar()

        ab_buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        Gtk.StyleContext.add_class(ab_buttons.get_style_context(), "linked")<commit_msg>Center the ASCIImation and fit it on startup.<commit_after>#!/usr/bin/env python
import sys
from gi.repository import Gtk, Gio, Gdk, GObject
from asciiplayback import *

class HeaderBarWindow(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title="ASCIIPlayback")
        self.set_default_size(0, 0)

        self.player = ASCIIPlayback(filename=sys.argv[1])

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        labelbox = Gtk.Box()
        label = Gtk.Label()
        label.set_alignment(0, 0)
        label.set_width_chars(self.player.asciimation.size[0])
        label.set_max_width_chars(self.player.asciimation.size[0])
        labelbox.pack_start(label, True, False, 0)
        box.pack_start(labelbox, True, False, 0)
        self.do_animate(label)

        ab = Gtk.ActionBar()

        ab_buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        Gtk.StyleContext.add_class(ab_buttons.get_style_context(), "linked")
{'fraction_non_alphanumeric': 0.11663179916317992, 'fraction_numerical': 0.011506276150627616, 'mean_word_length': 3.279642058165548, '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': '1323938', 'n_tokens_mistral': 676, 'n_tokens_neox': 635, 'n_words': 104}