<commit_before>#!/usr/bin/env python

# Scalpel sound editor (http://stackp.online.fr/?p=48)
# Copyright 2008 (C) <NAME> <<EMAIL>>
# Licensed under the Python Software Foundation License
# (http://www.python.org/psf/license/)

from gtkui import MainWindow
from control import Controller
from graphmodel import Graph
from selection import Selection
from player import Player
from edit import Sound
import gtk
gtk.gdk.threads_init()

def run():
    sound = Sound()
    player = Player(sound)
    graph = Graph(sound)
    selection = Selection(graph)
    controller = Controller(sound, player, graph, selection)
    win = MainWindow(controller, graph, selection)
    win.resize(700, 500)
    win.show_all()
    gtk.main()

if __name__ == "__main__":
    run()
<commit_msg>Open file passed as first command-line argument.<commit_after>#!/usr/bin/env python

# Scalpel sound editor (http://stackp.online.fr/?p=48)
# Copyright 2008 (C) <NAME> <<EMAIL>>
# Licensed under the Python Software Foundation License
# (http://www.python.org/psf/license/)

from gtkui import MainWindow
from control import Controller
from graphmodel import Graph
from selection import Selection
from player import Player
from edit import Sound
import sys
import os.path
import gtk
gtk.gdk.threads_init()

def run():
    sound = Sound()
    player = Player(sound)
    graph = Graph(sound)
    selection = Selection(graph)
    controller = Controller(sound, player, graph, selection)
    win = MainWindow(controller, graph, selection)
    win.resize(700, 500)
    win.show_all()
    if len(sys.argv) > 1:
        filename = sys.argv[1]
        controller.open(filename)
        win.filedialog.curdir = os.path.dirname(filename)
    gtk.main()

if __name__ == "__main__":
    run()

{'fraction_non_alphanumeric': 0.11212814645308924, 'fraction_numerical': 0.014874141876430207, 'mean_word_length': 3.912921348314607, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4897207', 'n_tokens_mistral': 549, 'n_tokens_neox': 520, 'n_words': 164}