コード例 #1
0
ファイル: programs.py プロジェクト: Cybolic/vineyard
    def button_run_clicked(self, button=None):
        selected_program = self.get_program_data_from_id(self.list.get_active_text())

        if 'programcommand' in selected_program:
            command = selected_program['programcommand']
        elif 'command' in selected_program:
            command = selected_program['command']
        else:
            command = [selected_program['exe']]

        if (
            # Run in terminal
            selected_program.get('programterminal', False) or
            selected_program.get('type', 'program') == 'terminal'
        ):
            wine.run(
                command,
                name = selected_program['name'],
                use_terminal = True
            )
        else:
            # Run with monitoring
            program_handler.MonitoredProgram(
                command,
                selected_program['name'],
                disable_pulseaudio = selected_program.get('disablepulseaudio', False)
            )
コード例 #2
0
ファイル: programs.py プロジェクト: najibalghaeth/vineyard
    def button_run_clicked(self, button=None):
        selected_program = self.get_program_data_from_id(
            self.list.get_active_text())

        if 'programcommand' in selected_program:
            command = selected_program['programcommand']
        elif 'command' in selected_program:
            command = selected_program['command']
        else:
            command = [selected_program['exe']]

        if (
                # Run in terminal
                selected_program.get('programterminal', False)
                or selected_program.get('type', 'program') == 'terminal'):
            wine.run(command, name=selected_program['name'], use_terminal=True)
        else:
            # Run with monitoring
            program_handler.MonitoredProgram(
                command,
                selected_program['name'],
                disable_pulseaudio=selected_program.get(
                    'disablepulseaudio', False))
コード例 #3
0
    def __init__(self, command, name, disable_pulseaudio=False):

        if disable_pulseaudio:
            wine.common.run('killall pulseaudio', shell=True)
        self._disable_pulseaudio = disable_pulseaudio

        self.process = wine.run(command, name=name)

        self.name = name
        self.wine_index = self.process.child.log_filename_base
        self._dialog_already_shown = False

        print("Process started. PID = {0}, PGRP = {1}".format(
            self.process.pid, wine.util.get_pgid_of_pid(self.process.pid)))
        gobject.timeout_add(500, self._start_monitoring)
        # And run it now in case the program dies before the first 500 ms
        self._start_monitoring()
コード例 #4
0
ファイル: program_handler.py プロジェクト: Cybolic/vineyard
    def __init__(self, command, name, disable_pulseaudio = False):

        if disable_pulseaudio:
            wine.common.run('killall pulseaudio', shell=True)
        self._disable_pulseaudio = disable_pulseaudio

        self.process = wine.run(
            command,
            name = name
        )

        self.name = name
        self.wine_index = self.process.child.log_filename_base
        self._dialog_already_shown = False

        print("Process started. PID = {0}, PGRP = {1}".format(
            self.process.pid,
            wine.util.get_pgid_of_pid(self.process.pid)
        ))
        gobject.timeout_add(500, self._start_monitoring)
        # And run it now in case the program dies before the first 500 ms
        self._start_monitoring()
コード例 #5
0
 def button_clicked(self, button):
     if self.gobject.loading: return False
     
     wine.run('regedit')
コード例 #6
0
    def button_clicked(self, button):
        if self.gobject.loading: return False

        wine.run('cmd')
コード例 #7
0
def train_classification():
    global dataset
    global algo
    global m
    global X_t
    global Y
    if request.method == 'POST':
        form_data = request.form.to_dict()
        print(form_data)
        algo = form_data['algo']
        dataset = form_data['dataset']
        if dataset == 'wine':
            import wine as model
            code_path = "static\code_wine.txt"
            data_head_path = "static\images\datahead_wine.png"
        elif dataset == 'parkinsons':
            import parkinsons as model
            code_path = "static\code_parkinsons.txt"
            data_head_path = "static\images\datahead_parkinsons.png"
        elif dataset == 'iris':
            import iris as model
            code_path = "static\code_iris.txt"
            data_head_path = "static\images\datahead_iris.png"
        elif dataset == 'phishing_website_detection':
            import phishing_website_detection as model
            code_path = "static\code_phishing.txt"
            data_head_path = "static\images\datahead_phishing.png"
        model_details, accuracy, class_report, con_matrix, m, plot_url_0, plot_url_1, plot_url_2, plot_url_4, X_t, Y = model.run(
            algo, dataset)

        table_data = class_report
        class_report_html = tabulate(table_data, tablefmt='html')

        table_data_con = con_matrix
        con_matrix_html = tabulate(table_data_con, tablefmt='html')

        return render_template("classification_model.html",
                               model_detail=str(model_details),
                               acc=str(accuracy),
                               report=Markup(class_report_html),
                               con_matrix=con_matrix_html,
                               graph0=plot_url_0,
                               graph1=plot_url_1,
                               graph2=plot_url_2,
                               graph4=plot_url_4,
                               dataset_name=dataset,
                               algo=algo,
                               code_path=code_path,
                               data_head_path=data_head_path)

    return render_template("train_classification.html")
コード例 #8
0
 def button_clicked(self, button):
     if self.gobject.loading: return False
     
     wine.run('control')