Example #1
0
    def __init__(self, master, **kwargs):
        super().__init__(**kwargs)
        self.master = master

        self.btn_texts = ["Download Manga", "Read Manga          "]

        self.download_btn = MDRectangleFlatIconButton(
            text=self.btn_texts[0],
            icon="download-box",
            pos_hint={
                "center_x": .5,
                "center_y": .4
            },
            user_font_size="64sp",
            on_release=self.go_to_screen)
        self.read_btn = MDRectangleFlatIconButton(
            text=self.btn_texts[1],
            icon="book-open-page-variant",
            pos_hint={
                "center_x": .5,
                "center_y": .6
            },
            user_font_size="64sp",
            on_release=self.go_to_screen)
        self.add_widget(self.read_btn)
        self.add_widget(self.download_btn)
Example #2
0
 def add_date_widgets(self, date_to=False):
     date_from_button = MDRectangleFlatIconButton(
         text=self.app.date_from.strftime('%d-%m-%Y'),
         icon="timetable",
         pos_hint={
             'center_x': .5,
             'center_y': .65
         },
         size_hint=(0.49, 0.085),
         on_release=lambda x: self.show_date_from())
     self.ids['date_from'] = WeakProxy(date_from_button)
     self.add_widget(date_from_button)
     if date_to:
         date_from_button.pos_hint = {'center_x': .25, 'center_y': .65}
         date_to_button = MDRectangleFlatIconButton(
             text=self.app.date_to.strftime('%d-%m-%Y'),
             icon="timetable",
             pos_hint={
                 'center_x': .75,
                 'center_y': .65
             },
             size_hint=(0.49, 0.085),
             on_release=lambda x: self.show_date_to())
         self.ids['date_to'] = WeakProxy(date_to_button)
         self.add_widget(date_to_button)
Example #3
0
 def ctx_password(self, instance):
     """Shows dialog with options what to do with password."""
     ctx_dialog = MDDialog(
         title=f'[color=#{self.text_color_hex}]{instance.text.capitalize()}[/color]',
         text='Choose what do you want to do wth this password.',
         auto_dismiss=False,
         buttons=[
             MDRectangleFlatIconButton(
                 icon='content-copy',
                 text='Copy',
                 on_release=lambda x: [
                     self.copy_password(instance.text),
                     ctx_dialog.dismiss()
                 ]
             ),
             MDRectangleFlatIconButton(
                 icon='trash-can-outline',
                 text='Delete',
                 on_release=lambda x: [
                     self.del_password(instance.text),
                     ctx_dialog.dismiss()
                 ]
             ),
             MDRectangleFlatIconButton(
                 icon='arrow-left-circle-outline',
                 text='Nothing',
                 on_release=lambda x: ctx_dialog.dismiss()
             )
         ]
     )
     ctx_dialog.open()
Example #4
0
 def _ctx_password(self, instance):
     """Shows dialog with options what to do with password."""
     ctx_dialog = MDDialog(
         title=f'[color=#{self.text_color_hex}]{instance.text.capitalize()}'
               f'[/color]',
         text=self.tr('ctx_text'),
         auto_dismiss=False,
         buttons=[
             MDRectangleFlatIconButton(
                 icon='content-copy',
                 text=self.tr('copy'),
                 on_release=lambda x: [
                     self.copy_password(instance.text),
                     ctx_dialog.dismiss()
                 ]
             ),
             MDRectangleFlatIconButton(
                 icon='trash-can-outline',
                 text=self.tr('delete'),
                 on_release=lambda x: [
                     self.del_password(instance.text, True),
                     ctx_dialog.dismiss()
                 ]
             ),
             MDRectangleFlatIconButton(
                 icon='arrow-left-circle-outline',
                 text=self.tr('nothing'),
                 on_release=lambda x: ctx_dialog.dismiss()
             )
         ]
     )
     ctx_dialog.open()
Example #5
0
class TimePane(MDGridLayout):
    """
    Displays and updates the current clock time
    """
    def __init__(self, audio_player, config_handler, **kwargs):
        """
        Create a TimePane object
        :param kwargs: Kwargs for MDGridLayout
        """
        super(TimePane, self).__init__(**kwargs)
        self.cols = 1
        self.rows = 3

        self.audio_player = audio_player
        self.config_handler = config_handler

        self.time_widget = Label(
            text=datetime.datetime.now().strftime("%I:%M %p"),
            color=DARK_THEME_CLOCK_COLOR
            if self.config_handler.get_setting(CONFIG_ENABLE_DARK_MODE_KEY)
            else LIGHT_THEME_CLOCK_COLOR,
            font_name="RobotoMono-Regular",
            size_hint=(1, 0.5),
            font_size="50sp",
        )

        self.add_widget(CalendarBox(config_handler, size_hint=(1, 0.5)))
        self.add_widget(self.time_widget)

        Clock.schedule_once(self.update,
                            60 - datetime.datetime.now().second % 60)

        self.adhan_play_button = MDRectangleFlatIconButton(
            icon="play",
            text="Play adhan",
            text_color=DARK_THEME_CLOCK_COLOR
            if self.config_handler.get_setting(CONFIG_ENABLE_DARK_MODE_KEY)
            else LIGHT_THEME_CLOCK_COLOR,
        )
        self.adhan_play_button.bind(on_press=self.play_adhan)
        self.add_widget(self.adhan_play_button)

    def update(self, *args):
        """
        Schedules the clock time to update every minute
        :param args: Args given by Kivy
        :return: None
        """
        self.time_widget.text = datetime.datetime.now().strftime("%I:%M %p")
        Clock.schedule_once(self.update,
                            60 - datetime.datetime.now().second % 60)

    def play_adhan(self, *args):
        """
        Plays adhan sound
        :param args: Args given by Kivy
        :return: None
        """
        self.audio_player.play_adhan()
Example #6
0
    def on_start(self):

        if not self.dialog:
            self.dialog = MDDialog(
                #text="Discard draft?",
                buttons=[
                    MDFlatButton(text="     ",
                                 text_color=self.theme_cls.primary_color),
                    MDRectangleFlatIconButton(
                        text="I know!",
                        text_color=self.theme_cls.primary_color,
                        font_name='msjhbd.ttc',
                        on_release=self.dialog_vanish)
                    #],
                    #items=[
                    #Widget.add_widget(Image(source='test.png'))
                ]
                #on_click=self.dialog_vanish
                #events_callback=self.dialog_vanish
            )
            self.dialog.add_widget(Image(source='tutorial.png'))
            self.dialog.auto_dismiss = False
            self.dialog.size_hint = [0.74, 0.74]
            self.dialog.children[1].size_hint = [1, 1]
            self.dialog.md_bg_color = [1, 1, 1, 1]

            #self.dialog.children[1].children[0].pos = [180.39, 180]  # children[0].children[0]是按鈕

        self.dialog.open()
Example #7
0
 def __init__(self, **kwargs):
     super(ContentNavigationDrawer, self).__init__(**kwargs)
     ###############################
     self.orientation = 'vertical'
     self.padding = '8dp'
     self.spacing = '8dp'
     ###############################
     self.Anchor1 = AnchorLayout()
     self.Label1 = MDLabel()
     self.LSpace = MDLabel()
     self.Label2 = MDLabel()
     ###
     self.Button1 = MDRectangleFlatIconButton(icon="face", text='Users')
     self.Button2 = MDRectangleFlatIconButton(icon="folder",
                                              text='DB Import')
     self.Button3 = MDRectangleFlatIconButton(icon="folder-download",
                                              text='DB Export')
     self.Button4 = MDRectangleFlatIconButton(icon="information",
                                              text='About')
     ###
     self.Scrll = ScrollView()
     self.Pic1 = Image(source='icon.png')
     ###############################
     return
Example #8
0
 def detailed_info(self, name: str):
     """Opens dialog about specific info about program in ``info`` screen."""
     info_dialog = MDDialog(
         title=self.tr(name, is_title=True),
         text=self.info[name],
         auto_dismiss=False,
         buttons=[
             MDRaisedButton(text='OK',
                            on_release=lambda x: info_dialog.dismiss()),
             MDRectangleFlatIconButton(text='Freepik',
                                       icon='web',
                                       on_release=lambda x: self.open_url(
                                           'https://www.freepik.com/'))
             if name == 'icon' else None
         ])
     info_dialog.open()
Example #9
0
 def detailed_info(self, name):
     """Opens dialog about specific info about program in ``info`` screen."""
     info_dialog = MDDialog(
         title=f'[color={self.text_color_hex}]' +
               (name.capitalize() if name != 'rd_party' else '3rd party software') + '[/color]',
         text=self.info[name],
         auto_dismiss=False,
         buttons=[
             MDRaisedButton(
                 text='OK', on_release=lambda x: info_dialog.dismiss()),
             MDRectangleFlatIconButton(
                 text='Freepik', icon='web',
                 on_release=lambda x:
                 self.open_url('https://www.freepik.com/')
             ) if name == 'icon' else None
             ]
     )
     info_dialog.open()
    def on_start(self):

        if not self.dialog:
            self.dialog = MDDialog(
                #text="Discard draft?",
                buttons=[
                    MDFlatButton(text="     ",
                                 text_color=self.theme_cls.primary_color),
                    MDRectangleFlatIconButton(
                        text="I know!",
                        text_color=self.theme_cls.primary_color,
                        font_name='msjhbd.ttc',
                        on_release=self.dialog_vanish)
                ])
            self.dialog.add_widget(Image(source='tutorial.png'))
            self.dialog.auto_dismiss = False
            self.dialog.size_hint = [0.74, 0.74]
            self.dialog.children[1].size_hint = [1, 1]
            self.dialog.md_bg_color = [1, 1, 1, 1]

        self.dialog.open()
    def __init__(self, **kwargs):
        super().__init__()

        with self.canvas.before:
            Color(rgb=(.9, .9, .9, 0.1)) #r g b transparencia
            self.rect = RoundedRectangle(radius=[(40.0,40.0),(40.0,40.0),(40.0,40.0),(40.0,40.0)])
        
        self.bind(pos = self.update_rect, size = self.update_rect)
        
        self.operation = kwargs["operation"]
        
        self.title = MDLabel(text = kwargs["title"],
                             pos_hint = {"center_x": .5, "top":.99},
                             size_hint = (.3,.2),
                             theme_text_color = "Primary", 
                             font_style= "Subtitle1",
                             halign = "center")
        
        self.text_field = MDTextFieldRect(pos_hint = {"center_x": .5, "top": .7},
                                          size_hint = (.4, .13),
                                          hint_text = "Ingresa el Valor",
                                          halign = "center")       
        
        self.button = MDRectangleFlatIconButton(on_release = self.ejecutar,                                        
                                               pos_hint = {"center_x":.5, "top": .5},
                                               size_hint = (.3,.1),
                                               icon = "math-compass",
                                               text = "Convertir")
        
        self.result = MDLabel(pos_hint = {"center_x": .5, "top": .3},
                              size_hint = (.5,.2),
                              halign = "center")
        
        self.add_widget(self.title)
        self.add_widget(self.text_field)
        self.add_widget(self.button)
        self.add_widget(self.result)
    def __init__(self, Mlist, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.app = MDApp.get_running_app()
        self.title = f"New Product"
        self.P_list = Mlist
        self.size_hint = (0.7, 0.9)
        self.materials_list = self.app.customconfig.load_materials()

        self.selected_materials_list = []
        app = MDApp.get_running_app()

        vlayout = BoxLayout()
        vlayout.orientation = "vertical"

        # name
        namerow = BoxLayout(size_hint=(1, 0.25))
        namerow.orientation = "horizontal"
        namerow.add_widget(Label(text="Product name: "))
        self.name_widget = MDTextField()
        namerow.add_widget(self.name_widget)

        scroll = ScrollView()
        self.Mlist = MDList()
        self.build_list()

        scroll.add_widget(self.Mlist)

        material_chooser_layout = BoxLayout()
        material_chooser_layout.orientation = "horizontal"
        material_chooser_layout.size_hint = (1, 0.2)

        self.menu_items = self.build_material_chooser_list()

        self.add_material_btn = MDRectangleFlatIconButton()
        self.add_material_btn.text = "Material"
        self.add_material_btn.icon = "plus"
        self.add_material_menu = MDDropdownMenu(
            items=self.menu_items,
            width_mult=4,
            caller=self.add_material_btn,
            callback=self.add_material_callback)
        self.add_material_btn.on_release = self.add_material_menu.open

        self.remove_material_btn = MDRectangleFlatIconButton()
        self.remove_material_btn.text = "Material"
        self.remove_material_btn.icon = "minus"
        self.remove_material_menu = MDDropdownMenu(
            items=self.menu_items,
            width_mult=4,
            caller=self.remove_material_btn,
            callback=self.remove_material_callback)
        self.remove_material_btn.on_release = self.remove_material_menu.open

        material_chooser_layout.add_widget(self.add_material_btn)
        material_chooser_layout.add_widget(self.remove_material_btn)

        vlayout.add_widget(namerow)
        vlayout.add_widget(material_chooser_layout)
        vlayout.add_widget(scroll)

        buttonlayout = BoxLayout()
        buttonlayout.orientation = "horizontal"
        buttonlayout.size_hint = (1, 0.2)
        buttonlayout.add_widget(
            MDRectangleFlatButton(text="Discard", on_release=self.dismiss))
        buttonlayout.add_widget(
            MDRectangleFlatButton(text="Save", on_release=self.save))
        vlayout.add_widget(buttonlayout)
        self.content = vlayout
Example #13
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.app = MDApp.get_running_app()
        self.valorbarra = 0

        self.buttonactualizar = MDRectangleFlatIconButton(
            pos_hint={
                "center_x": .5,
                "top": .95
            },
            #size_hint = (.3,.1),
            icon="cart-arrow-down",
            text=" Precios",
        )
        self.msgactualiza = MDLabel(text='Actualizando, espera por favor',
                                    pos_hint={
                                        "center_x": .5,
                                        "top": .87
                                    },
                                    size_hint=(.8, .1),
                                    theme_text_color="Primary",
                                    font_style="Subtitle1",
                                    halign="center")

        self.barra = MDProgressBar(id="barrasss",
                                   value=0,
                                   pos_hint={
                                       "center_x": .5,
                                       "center_y": .80
                                   },
                                   size_hint=(.9, .1))

        self.etiqueta1 = MDLabel(text='Consultar por Tienda',
                                 pos_hint={
                                     "center_x": .5,
                                     "top": .80
                                 },
                                 size_hint=(.5, .1),
                                 theme_text_color="Primary",
                                 font_style="Subtitle1",
                                 halign="center")

        self.buttonche = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .6
            },
            size_hint=(.40, .1),
            text="Chedraui",
            on_release=lambda x: self.verboton('che'))

        self.buttonsor = MDFillRoundFlatButton(
            pos_hint={
                "x": .55,
                "y": .6
            },
            size_hint=(.40, .1),
            text="Soriana",
            on_release=lambda x: self.verboton('sor'))

        self.buttonhbe = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .45
            },
            size_hint=(.40, .1),
            #theme_text_color = "Primary",
            text="HBE",
            on_release=lambda x: self.verboton('hbe'))

        self.buttoncomer = MDFillRoundFlatButton(
            pos_hint={
                "x": .55,
                "y": .45
            },
            size_hint=(.40, .1),
            text="La Comer",
            on_release=lambda x: self.verboton('comer'))

        self.etiqueta2 = MDLabel(text='Consultar por Categoría',
                                 pos_hint={
                                     "center_x": .5,
                                     "top": .40
                                 },
                                 size_hint=(.5, .1),
                                 theme_text_color="Primary",
                                 font_style="Subtitle1",
                                 halign="center")

        self.buttonfrutas = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .20
            },
            size_hint=(.25, .1),
            text="Frutas",
            on_release=lambda x: self.verboton('frutas'))

        self.buttonverduras = MDFillRoundFlatButton(
            pos_hint={
                "x": .35,
                "y": .20
            },
            size_hint=(.25, .1),
            text="Verduras",
            on_release=lambda x: self.verboton('verduras'))

        self.buttoncarnes = MDFillRoundFlatButton(
            pos_hint={
                "x": .65,
                "y": .20
            },
            size_hint=(.25, .1),
            text='Carnes',
            on_release=lambda x: self.verboton('carnes'))

        self.buttonlacteos = MDFillRoundFlatButton(
            pos_hint={
                "x": .20,
                "y": .05
            },
            size_hint=(.25, .1),
            text='Lácteos',
            on_release=lambda x: self.verboton('lacteos'))

        self.buttonenlatados = MDFillRoundFlatButton(
            pos_hint={
                "x": .50,
                "y": .05
            },
            size_hint=(.25, .1),
            text='Enlatados',
            on_release=lambda x: self.verboton('enlatados'))

        self.buttonactualizar.bind(on_press=lambda x: self.ActualizaPrecio())

        self.add_widget(self.buttonactualizar)

        self.add_widget(self.buttonche)
        self.add_widget(self.buttonsor)
        self.add_widget(self.buttonhbe)
        self.add_widget(self.buttoncomer)
        self.add_widget(self.etiqueta1)
        self.add_widget(self.etiqueta2)
        self.add_widget(self.buttonfrutas)
        self.add_widget(self.buttonverduras)
        self.add_widget(self.buttoncarnes)
        self.add_widget(self.buttonlacteos)
        self.add_widget(self.buttonenlatados)
Example #14
0
class FirstScreen(Screen):  #Pantalla comparador de precios
    """Clase principal donde se ejecuta el modulo comparador de precios, en ella se inicializan las variables correspondientes que se
    utilizaran en el módulo"""
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.app = MDApp.get_running_app()
        self.valorbarra = 0

        self.buttonactualizar = MDRectangleFlatIconButton(
            pos_hint={
                "center_x": .5,
                "top": .95
            },
            #size_hint = (.3,.1),
            icon="cart-arrow-down",
            text=" Precios",
        )
        self.msgactualiza = MDLabel(text='Actualizando, espera por favor',
                                    pos_hint={
                                        "center_x": .5,
                                        "top": .87
                                    },
                                    size_hint=(.8, .1),
                                    theme_text_color="Primary",
                                    font_style="Subtitle1",
                                    halign="center")

        self.barra = MDProgressBar(id="barrasss",
                                   value=0,
                                   pos_hint={
                                       "center_x": .5,
                                       "center_y": .80
                                   },
                                   size_hint=(.9, .1))

        self.etiqueta1 = MDLabel(text='Consultar por Tienda',
                                 pos_hint={
                                     "center_x": .5,
                                     "top": .80
                                 },
                                 size_hint=(.5, .1),
                                 theme_text_color="Primary",
                                 font_style="Subtitle1",
                                 halign="center")

        self.buttonche = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .6
            },
            size_hint=(.40, .1),
            text="Chedraui",
            on_release=lambda x: self.verboton('che'))

        self.buttonsor = MDFillRoundFlatButton(
            pos_hint={
                "x": .55,
                "y": .6
            },
            size_hint=(.40, .1),
            text="Soriana",
            on_release=lambda x: self.verboton('sor'))

        self.buttonhbe = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .45
            },
            size_hint=(.40, .1),
            #theme_text_color = "Primary",
            text="HBE",
            on_release=lambda x: self.verboton('hbe'))

        self.buttoncomer = MDFillRoundFlatButton(
            pos_hint={
                "x": .55,
                "y": .45
            },
            size_hint=(.40, .1),
            text="La Comer",
            on_release=lambda x: self.verboton('comer'))

        self.etiqueta2 = MDLabel(text='Consultar por Categoría',
                                 pos_hint={
                                     "center_x": .5,
                                     "top": .40
                                 },
                                 size_hint=(.5, .1),
                                 theme_text_color="Primary",
                                 font_style="Subtitle1",
                                 halign="center")

        self.buttonfrutas = MDFillRoundFlatButton(
            pos_hint={
                "x": .05,
                "y": .20
            },
            size_hint=(.25, .1),
            text="Frutas",
            on_release=lambda x: self.verboton('frutas'))

        self.buttonverduras = MDFillRoundFlatButton(
            pos_hint={
                "x": .35,
                "y": .20
            },
            size_hint=(.25, .1),
            text="Verduras",
            on_release=lambda x: self.verboton('verduras'))

        self.buttoncarnes = MDFillRoundFlatButton(
            pos_hint={
                "x": .65,
                "y": .20
            },
            size_hint=(.25, .1),
            text='Carnes',
            on_release=lambda x: self.verboton('carnes'))

        self.buttonlacteos = MDFillRoundFlatButton(
            pos_hint={
                "x": .20,
                "y": .05
            },
            size_hint=(.25, .1),
            text='Lácteos',
            on_release=lambda x: self.verboton('lacteos'))

        self.buttonenlatados = MDFillRoundFlatButton(
            pos_hint={
                "x": .50,
                "y": .05
            },
            size_hint=(.25, .1),
            text='Enlatados',
            on_release=lambda x: self.verboton('enlatados'))

        self.buttonactualizar.bind(on_press=lambda x: self.ActualizaPrecio())

        self.add_widget(self.buttonactualizar)

        self.add_widget(self.buttonche)
        self.add_widget(self.buttonsor)
        self.add_widget(self.buttonhbe)
        self.add_widget(self.buttoncomer)
        self.add_widget(self.etiqueta1)
        self.add_widget(self.etiqueta2)
        self.add_widget(self.buttonfrutas)
        self.add_widget(self.buttonverduras)
        self.add_widget(self.buttoncarnes)
        self.add_widget(self.buttonlacteos)
        self.add_widget(self.buttonenlatados)

        #food-steak carne food-drumstick
        #food-apple fruta
        #cheese lacteos
        #carrot verduras
        #dome-light
        #return self.button

    #def tabla(self, widget):

    def MuestraNotificacionComparador(self):
        """Se muestra las notificaciones que se anexaron al modulo del comparador de precios"""
        self.a = randint(1, 6)
        print(self.a)
        if self.a == 1:

            notification.notify(
                title='Como Actualizar los precios',
                message=
                'Puedes actualizar los precios de los productos pulsando el boton de Actualizar que se encuentra en'
                'la parte superior',
                timeout=20)
            snackbar = Snackbar(
                text=
                "Puedes actualizar los precios de los productos pulsando el boton de Actualizar que se encuentra en la parte superior"
            )
            snackbar.show()

        if self.a == 2:
            notification.notify(
                title='Visualización de los Precios',
                message=
                'Los precios pueden ser consultados deslizando la tabla que se muestra al consultar alguna categoría',
                timeout=20)
            snackbar = Snackbar(
                text=
                "Los precios pueden ser consultados deslizando la tabla que se muestra al consultar alguna categoría"
            )
            snackbar.show()

        pass

    def ActualizaPrecio(self):
        """Función desde la cual se obtienen los precios, se llama una funcion que esta en el fichero Actualiza Precios, se ejecutan hilos
        para obtener los precios simultaneamente, de esta manera se previene el congelamiento de la aplicación, en esta función tambien se
        llama a la funcion actualiza barra"""
        ap.main()

        self.add_widget(self.barra)
        self.add_widget(self.msgactualiza)
        self.buttonactualizar.disabled = True
        self.hiloactualiza = threading.Thread(
            target=self.actualizabarra
        )  # Inicializar un hilo llamando a una funcion
        self.hiloactualiza.start()

        #self.actualizabarra()

        self.dialog = MDDialog(
            title="Actualización de Precios",
            text=
            "Se actualizarán los precios que se muestran en cada una de las categorías del comparador de precios,"
            " este proceso puede demorar algunos  un par de minutos, por favor sea paciente",
            size_hint=[.9, .9],
            auto_dismiss=True,
            buttons=[
                MDFlatButton(text="CERRAR", on_release=self.dialog_close),
            ])
        self.dialog.open()

    def actualizabarra(self):
        """Funcion que actualiza la barra mostrada en el módulo comparador de precios"""
        #if ap.sor.correccion_datos_sor() == True:
        for a in range(100):
            self.valorbarra = self.valorbarra + 1
            self.barra.value = self.valorbarra
            sleep(1.3)

        sleep(5)
        self.remove_widget(self.msgactualiza)
        sleep(1)
        self.remove_widget(self.barra)

    def dialog_close(self, *args):  # Cierra el dialog del boton ayuda
        """Funcion que cierra el dialog que se despliega al oprimir el botón actualizar"""
        print("Cerrando Dialog")
        self.dialog.dismiss()

    def verboton(self, valor):
        self.MuestraNotificacionComparador()
        if valor == 'comer':
            datos = pd.read_csv("csv/info_lacomer.csv", encoding='utf8')
        elif valor == 'hbe':
            datos = pd.read_csv("csv/info_hbe.csv", encoding='utf8')
        elif valor == 'sor':
            datos = pd.read_csv("csv/info_sor.csv", encoding='utf8')
        elif valor == 'che':
            datos = pd.read_csv("csv/info_che.csv", encoding='utf8')
        elif valor == 'frutas':
            datos = pd.read_csv("csv/infofrutas.csv", encoding='utf8')
        elif valor == 'verduras':
            datos = pd.read_csv("csv/infoverduras.csv", encoding='utf8')
        elif valor == 'carnes':
            datos = pd.read_csv("csv/infocarnes.csv", encoding='utf8')
        elif valor == 'lacteos':
            datos = pd.read_csv("csv/infolacteos.csv", encoding='utf8')
        elif valor == 'enlatados':
            datos = pd.read_csv("csv/infoenlatados.csv", encoding='utf8')

        datos = datos.iloc[:,
                           1:]  # primer arg selecciona todas las filas, segundo
        cols = datos.columns.values
        values = datos.values

        self.table = MDDataTable(
            pos_hint={
                'center_x': 0.5,
                'center_y': 0.5
            },
            size_hint=(0.99, 0.99),
            #font_size = 10,
            #check= True,
            use_pagination=True,
            rows_num=10,
            column_data=[(col, dp(40)) for col in cols],
            row_data=values)

        self.table.bind(on_check_press=self.check_press)
        self.table.bind(on_check_press=self.row_press)

        self.table.open()
        print(valor)

    def my_callback(
        self, texto, popup_widget
    ):  # funcion que ayuda a cerrar el dialog del boton actualizar
        print(texto)
        print(popup_widget)

    def open_table(self, instance):
        """Despliega el contenido de la tabla correpondiente al boton pulsado"""
        #screen.add_widget(table)
        self.table.open()

    def check_press(self, instance_table, current_row):
        print(instance_table, current_row)

    def row_press(self, instance_table, instance_row):
        print(instance_table, instance_row)
        #self.sub_title = "Comparador"

    def on_pre_enter(self, *args):
        self.app.title = "Comparador de precios"

    pass