<commit_before>#!/usr/bin/env ruby
# encoding: utf-8

# File: pendant_table.rb
# Created:  24/09/13
#
# (c) <NAME> <<EMAIL>>

# script methods for Jacinthe Management
module JacintheManagement
  # all classes and methods for both GUIs
  module GuiQt
    # suspending user events for at most 20 seconds
    # @yieldparam [Block] block to be executed during the suspension
    def self.suspending_user_events
      Qt::CoreApplication.processEvents(1, 20_000)
      yield
      Qt::CoreApplication.process_events
    end

    WAITING_TEXT = [
        'Importation des Ventes en cours',
        'ATTENDRE',
        'Ne pas fermer la fenêtre'
    ].join("\n")

    # showing a message box while a task is processed
    # @param [Qt::Widget] parent parent widget
    # @yieldparam [Block] block to be executed while box is shown
    def self.under_warning(parent)
      msg = Qt::MessageBox.new(parent)
      #  msg.set_window_flags(msg.window_flags & ~Qt::WindowCloseButtonHint)
      #  msg.set_modal(false)
      msg.set_window_title('IMPORTATION EN COURS')
      msg.set_text(WAITING_TEXT)
      msg.show
      yield
      msg.close
    end

    # Table widget for showing pendant actions
    class PendantTable < Table
      # Headers for the table
      HEADERS = [
          'Fichier ventes GESCOM',
          'Ventes non importées',
          'Fichiers clients non lus',
          'Clients à exporter',
          'Notifications à faire',
          'Plages non valides',
          'E-abonnés sans mail'
      ]
      # whether column may have button
      BUTTONS = [true, true, false, false, true, true]
      # Actions corresponding to the second row
      ACTION_FOR = [nil,
                    -> { Core::Sales.show_remaining_sales },
                    -> { Core::Utils.open_file(Core::Clients::TRANSFERT_CLIENT_SAGE_DIR) },
                    nil,
                    nil,
                    -> { Core::Electronic.show_invalid_ranges },
                    -> { Core::Notification.show_tiers_without_mail }
      ]
<commit_msg>extracted client method<commit_after>#!/usr/bin/env ruby
# encoding: utf-8

# File: pendant_table.rb
# Created:  24/09/13
#
# (c) <NAME> <<EMAIL>>

# script methods for Jacinthe Management
module JacintheManagement
  # all classes and methods for both GUIs
  module GuiQt
    # suspending user events for at most 20 seconds
    # @yieldparam [Block] block to be executed during the suspension
    def self.suspending_user_events
      Qt::CoreApplication.processEvents(1, 20_000)
      yield
      Qt::CoreApplication.process_events
    end

    WAITING_TEXT = [
        'Importation des Ventes en cours',
        'ATTENDRE',
        'Ne pas fermer la fenêtre'
    ].join("\n")

    # showing a message box while a task is processed
    # @param [Qt::Widget] parent parent widget
    # @yieldparam [Block] block to be executed while box is shown
    def self.under_warning(parent)
      msg = Qt::MessageBox.new(parent)
      #  msg.set_window_flags(msg.window_flags & ~Qt::WindowCloseButtonHint)
      #  msg.set_modal(false)
      msg.set_window_title('IMPORTATION EN COURS')
      msg.set_text(WAITING_TEXT)
      msg.show
      yield
      msg.close
    end

    # Table widget for showing pendant actions
    class PendantTable < Table
      # Headers for the table
      HEADERS = [
          'Fichier ventes GESCOM',
          'Ventes non importées',
          'Fichiers clients non lus',
          'Clients à exporter',
          'Notifications à faire',
          'Plages non valides',
          'E-abonnés sans mail'
      ]
      # whether column may have button
      BUTTONS = [true, true, false, false, true, true]

      # Actions corresponding to the second row
      ACTION_FOR = [nil,
                    -> { Core::Sales.show_remaining_sales },
                    -> { Core::Clients::show_client_files },
                    nil,
                    nil,
                    -> { Core::Electronic.show_invalid_ranges },
                    -> { Core::Notification.show_tiers_without_mail }
      ]

{'fraction_non_alphanumeric': 0.08999013806706115, 'fraction_numerical': 0.0073964497041420114, 'mean_word_length': 2.222398729150119, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '5261727', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1176, 'n_words': 332}