<commit_before>#lang racket/unit

(require drracket/tool
         framework
         racket/class
         racket/gui/base
         racket/draw
         "editor.rkt")


(import drracket:tool^)
(export drracket:tool-exports^)

(define video-frame-mixin
  (mixin (drracket:unit:frame<%>) ()
    (super-new)
    (inherit get-insert-menu
             get-editor
             get-button-panel
             register-toolbar-button)
    (new menu-item%
         [parent (get-insert-menu)]
         [label "Insert Video Editor"]
         [callback
          (λ (i e)
            (define editor (get-editor))
            (define video (new video-editor%))
            (send editor insert
                  (new video-snip%
                       [editor video]
                       [min-width (send video get-min-width)]
                       [min-height (send video get-min-height)])))])))

(define (phase1) (void))
(define (phase2) (void))

(drracket:get/extend:extend-unit-frame video-frame-mixin)

(send (get-the-snip-class-list) add video-snip-class)
<commit_msg>The tool should 'hopefully' not crash when video is not installed<commit_after>#lang racket/unit

(require drracket/tool
         framework
         racket/class
         racket/gui/base
         racket/draw)

(import drracket:tool^)
(export drracket:tool-exports^)

(define-values (video-editor%
                video-snip%
                video-snip-class)
  (with-handlers ([exn:fail? (values #f #f #f)])
    (values
     (dynamic-require "editor.rkt" 'video-editor%)
     (dynamic-require "editor.rkt" 'video-snip%)
     (dynamic-require "editor.rkt" 'video-snip-class))))

(define video-frame-mixin
  (mixin (drracket:unit:frame<%>) ()
    (super-new)
    (inherit get-insert-menu
             get-editor
             get-button-panel
             register-toolbar-button)
    (new menu-item%
         [parent (get-insert-menu)]
         [label "Insert Video Editor"]
         [callback
          (λ (i e)
            (define editor (get-editor))
            (define video (new video-editor%))
            (send editor insert
                  (new video-snip%
                       [editor video]
                       [min-width (send video get-min-width)]
                       [min-height (send video get-min-height)])))])))

(define (phase1) (void))
(define (phase2) (void))

(when video-editor%
  (drracket:get/extend:extend-unit-frame video-frame-mixin)
  (send (get-the-snip-class-list) add video-snip-class))

{'fraction_non_alphanumeric': 0.13143086816720256, 'fraction_numerical': 0.001607717041800643, 'mean_word_length': 1.9386068476977567, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6048223', 'n_tokens_mistral': 787, 'n_tokens_neox': 765, 'n_words': 169}