--- /dev/null
+*.py[cod]
+*.so
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+lib
+lib64
+__pycache__
+pip-log.txt
+.coverage
+.tox
+nosetests.xml
+.project
+.pydevproject
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="main_window">
+ <property name="width_request">435</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">5</property>
+ <property name="margin_right">5</property>
+ <property name="margin_top">5</property>
+ <property name="margin_bottom">5</property>
+ <signal name="delete-event" handler="on_window_destroy" swapped="no"/>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="ypad">7</property>
+ <property name="label" translatable="yes">OpenERP Easy Starter</property>
+ <attributes>
+ <attribute name="font-desc" value="Ubuntu Medium 17"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">10</property>
+ <property name="column_spacing">5</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.20000000298023224</property>
+ <property name="label" translatable="yes">Bases</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.20000000298023224</property>
+ <property name="label" translatable="yes">Actions</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.20000000298023224</property>
+ <property name="label" translatable="yes">Scripts
+post install</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkRadioButton" id="radio_start">
+ <property name="label" translatable="yes">Démarrer</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radio_maj">
+ <property name="label" translatable="yes">Mettre à jour</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_start</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radio_reinstall">
+ <property name="label" translatable="yes">Réinstaller</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_start</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="txtmodules">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="width_request">0</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="txtbases">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="width_request">0</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="txtscripts">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="width_request">92</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.20000000298023224</property>
+ <property name="label" translatable="yes">Modules</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button">
+ <property name="label" translatable="yes">Démarrer</property>
+ <property name="use_action_appearance">False</property>
+ <property name="height_request">35</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text" translatable="yes">Démarrer OpenERP</property>
+ <property name="margin_top">5</property>
+ <property name="use_action_appearance">False</property>
+ <signal name="clicked" handler="on_start_button_clicked" object="main_window" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+from ihm import GladeWindowManager
+from ihm import MainWindow
+
+from manager import test_action_on_start_button
+
+GladeWindowManager.append("OpenERPEasyStarter.glade")
+appli = MainWindow()
+
+if __name__ == "__main__":
+ # Test de l'application.
+ appli.set_action_on_start_button(test_action_on_start_button)
+ appli.start()
--- /dev/null
+#!/usr/bin/python3
+#-*- coding: utf-8 -*-
+
+
+from gi.repository import Gtk
+
+
+class GladeWindowManager:
+ builder = Gtk.Builder()
+
+ @classmethod
+ def append(cls, glade_file):
+ cls.builder.add_from_file(glade_file)
+
+ @classmethod
+ def initWindow(cls, window_name, window_instance):
+ cls.builder.connect_signals(window_instance)
+ return cls.builder.get_object(window_name)
+
+
+class MainWindow:
+
+ @staticmethod
+ def start():
+ Gtk.main()
+
+ def on_window_destroy(self, widget, data=None):
+ Gtk.main_quit()
+
+ def __init__(self):
+ self.window = GladeWindowManager.initWindow("main_window", self)
+ self.window.show_all()
+
+ def set_action_on_start_button(self, action):
+ self.action_on_start_button = action
+
+ @staticmethod
+ def _get_all_textlines_from_buffer(buffer):
+ start, end = buffer.get_start_iter(), buffer.get_end_iter()
+ return buffer.get_text(start, end, True).splitlines()
+
+ def on_start_button_clicked(self, widget, data=None):
+ # Récupération des widgets utiles à partir du widget général
+ grid = widget.get_children()[0].get_children()[1]
+ widgets = [e.get_children() for e in grid.get_children()
+ if type(e) != Gtk.Label]
+ # Récupération des valeurs dans "Scripts"
+ scripts = self._get_all_textlines_from_buffer(
+ widgets[0][0].get_buffer()
+ )
+ # Récupération des valeurs dans "Bases"
+ bases = self._get_all_textlines_from_buffer(
+ widgets[1][0].get_buffer()
+ )
+ # Récupération des valeurs dans "Modules"
+ modules = self._get_all_textlines_from_buffer(
+ widgets[2][0].get_buffer()
+ )
+ # Récupération de la valeur dans "Actions"
+ action = [rb.get_label() for rb in widgets[3] if rb.get_active()][0]
+
+ # Appel de l'action à réaliser lorsque l'on clique sur le bouton
+ self.action_on_start_button(action, modules, bases, scripts)
+
+if __name__ == "__main__":
+ GladeWindowManager.append("OpenERPEasyStarter.glade")
+ appli = MainWindow()
+
+ # Définition d'une action de test
+ def test_action_on_start_button(action, modules, bases, scripts):
+ print("""Éléments récupérés :
+modules :
+%s
+bases
+%s
+scripts
+%s
+action
+%s""" % (modules, bases, scripts, action))
+
+ # Connection de l'action à l'IHM
+ appli.set_action_on_start_button(test_action_on_start_button)
+ # Lancement de l'IHM
+ appli.start()
--- /dev/null
+#!/usr/bin/python3
+#-*- coding: utf-8 -*-
+
+
+def test_action_on_start_button(action, modules, bases, scripts):
+ print("""Éléments récupérés :
+modules :
+%s
+bases
+%s
+scripts
+%s
+action
+%s""" % (modules, bases, scripts, action))
+++ /dev/null
-*.py[cod]
-*.so
-*.egg
-*.egg-info
-dist
-build
-eggs
-parts
-bin
-var
-sdist
-develop-eggs
-.installed.cfg
-lib
-lib64
-__pycache__
-pip-log.txt
-.coverage
-.tox
-nosetests.xml
-.project
-.pydevproject
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkWindow" id="main_window">
- <property name="width_request">435</property>
- <property name="can_focus">False</property>
- <property name="margin_left">5</property>
- <property name="margin_right">5</property>
- <property name="margin_top">5</property>
- <property name="margin_bottom">5</property>
- <signal name="delete-event" handler="on_window_destroy" swapped="no"/>
- <child>
- <object class="GtkBox" id="box1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="ypad">7</property>
- <property name="label" translatable="yes">OpenERP Easy Starter</property>
- <attributes>
- <attribute name="font-desc" value="Ubuntu Medium 17"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">10</property>
- <property name="column_spacing">5</property>
- <property name="row_homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.20000000298023224</property>
- <property name="label" translatable="yes">Bases</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.20000000298023224</property>
- <property name="label" translatable="yes">Actions</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.20000000298023224</property>
- <property name="label" translatable="yes">Scripts
-post install</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="radio_start">
- <property name="label" translatable="yes">Démarrer</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radio_maj">
- <property name="label" translatable="yes">Mettre à jour</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radio_start</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radio_reinstall">
- <property name="label" translatable="yes">Réinstaller</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radio_start</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTextView" id="txtmodules">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="width_request">0</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTextView" id="txtbases">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="width_request">0</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTextView" id="txtscripts">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="width_request">92</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.20000000298023224</property>
- <property name="label" translatable="yes">Modules</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button">
- <property name="label" translatable="yes">Démarrer</property>
- <property name="use_action_appearance">False</property>
- <property name="height_request">35</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes">Démarrer OpenERP</property>
- <property name="margin_top">5</property>
- <property name="use_action_appearance">False</property>
- <signal name="clicked" handler="on_start_button_clicked" object="main_window" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
+++ /dev/null
-from ihm import GladeWindowManager
-from ihm import MainWindow
-
-from manager import test_action_on_start_button
-
-GladeWindowManager.append("OpenERPEasyStarter.glade")
-appli = MainWindow()
-
-if __name__ == "__main__":
- # Test de l'application.
- appli.set_action_on_start_button(test_action_on_start_button)
- appli.start()
+++ /dev/null
-#!/usr/bin/python3
-#-*- coding: utf-8 -*-
-
-
-from gi.repository import Gtk
-
-
-class GladeWindowManager:
- builder = Gtk.Builder()
-
- @classmethod
- def append(cls, glade_file):
- cls.builder.add_from_file(glade_file)
-
- @classmethod
- def initWindow(cls, window_name, window_instance):
- cls.builder.connect_signals(window_instance)
- return cls.builder.get_object(window_name)
-
-
-class MainWindow:
-
- @staticmethod
- def start():
- Gtk.main()
-
- def on_window_destroy(self, widget, data=None):
- Gtk.main_quit()
-
- def __init__(self):
- self.window = GladeWindowManager.initWindow("main_window", self)
- self.window.show_all()
-
- def set_action_on_start_button(self, action):
- self.action_on_start_button = action
-
- @staticmethod
- def _get_all_textlines_from_buffer(buffer):
- start, end = buffer.get_start_iter(), buffer.get_end_iter()
- return buffer.get_text(start, end, True).splitlines()
-
- def on_start_button_clicked(self, widget, data=None):
- # Récupération des widgets utiles à partir du widget général
- grid = widget.get_children()[0].get_children()[1]
- widgets = [e.get_children() for e in grid.get_children()
- if type(e) != Gtk.Label]
- # Récupération des valeurs dans "Scripts"
- scripts = self._get_all_textlines_from_buffer(
- widgets[0][0].get_buffer()
- )
- # Récupération des valeurs dans "Bases"
- bases = self._get_all_textlines_from_buffer(
- widgets[1][0].get_buffer()
- )
- # Récupération des valeurs dans "Modules"
- modules = self._get_all_textlines_from_buffer(
- widgets[2][0].get_buffer()
- )
- # Récupération de la valeur dans "Actions"
- action = [rb.get_label() for rb in widgets[3] if rb.get_active()][0]
-
- # Appel de l'action à réaliser lorsque l'on clique sur le bouton
- self.action_on_start_button(action, modules, bases, scripts)
-
-if __name__ == "__main__":
- GladeWindowManager.append("OpenERPEasyStarter.glade")
- appli = MainWindow()
-
- # Définition d'une action de test
- def test_action_on_start_button(action, modules, bases, scripts):
- print("""Éléments récupérés :
-modules :
-%s
-bases
-%s
-scripts
-%s
-action
-%s""" % (modules, bases, scripts, action))
-
- # Connection de l'action à l'IHM
- appli.set_action_on_start_button(test_action_on_start_button)
- # Lancement de l'IHM
- appli.start()
+++ /dev/null
-#!/usr/bin/python3
-#-*- coding: utf-8 -*-
-
-
-def test_action_on_start_button(action, modules, bases, scripts):
- print("""Éléments récupérés :
-modules :
-%s
-bases
-%s
-scripts
-%s
-action
-%s""" % (modules, bases, scripts, action))