Example #1
0
 def __init__(self,
              bulletin=None,
              schedule_generator=lambda courses, N: [],
              *args,
              **kwargs):
     super(type(self), self).__init__(*args, **kwargs)
     self.bulletin = bulletin
     self.schedule_generator = schedule_generator
     self.schedules = []
     self.stored_schedules = []
     self.gen_sched = False
     self.schedule_index = -1
     self.schedule_generation_thread = threading.Thread(
         target=self.generation_object)
     self.on_touch_down = lambda e: exclusion.on_touch_down(self, e)
     self.on_touch_move = lambda e: exclusion.on_touch_move(self, e)
     self.on_touch_up = lambda e: exclusion.on_touch_up(self, e)
     self.active_button = None  #for class-block popups
     self.create_layers()
     self.pb1 = ProgressBar(max=1000)
     self.pb2 = ProgressBar(max=1000, pos=(w / 2, 0))
     self.top_layer.add_widget(self.pb1)
     #self.top_layer.add_widget( self.pb2 )
     self.build_middle_layer()
     draw_window_frame(self.bottom_layer)
     draw_border(self.bottom_layer)
     hold_hz = 7.0
     Clock.schedule_interval(self.hold_checker, 1.0 / hold_hz)
Example #2
0
 def on_enter(self):
     layout = self.ids.otherlayout
     floatEr = FloatLayout(size=(480,800))
     player = Music_Player()
     self.label = Label(text=str(self.slider_val))
     s = Slider(min=0, max=player.current_playing.length, value_track=True, value_track_color=[1, 0, 0, 1], sensitivity='handle', pos = (0, 300), size = (100, 30))
     s.step = .01
     btnp = Button(text='play', size=(96,72), pos = (0,72))
     btnpau = Button(text='pause', size=(96,72), pos = (96,72))
     btnb = Button(text='back', size=(96,72), pos = (192,72))
     btn2 = Button(text='go to list', size=(96,72), pos = (288,72))
     btnn = Button(text='next', size=(96,72), pos = (384,72))
     pb = ProgressBar(max=player.current_playing.length)
     pb.bind(value=lambda
         x:self.sliderProgress(player.current_playing.get_pos()))
     btn2.bind(on_press=self.changer)
     btnp.bind(on_press=lambda x:player.play())
     btnpau.bind(on_press=lambda x:player.pause())
     btnb.bind(on_press=lambda x:player.back())
     btnn.bind(on_press=lambda x:player.next())
     s.bind(value=self.sliderProgress)
     s.bind(on_touch_up=lambda x, y:player.playAtTime(self.sliderProgress))
     floatEr.add_widget(btn2)
     floatEr.add_widget(btnp)
     floatEr.add_widget(btnpau)
     floatEr.add_widget(btnn)
     floatEr.add_widget(btnb)
     floatEr.add_widget(s)
     floatEr.add_widget(pb)
     layout.add_widget(self.label)
     layout.add_widget(floatEr)
Example #3
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.format_list = ["png", "gif", "jpeg", "jpg"]

        self.img_path = "img/"
        self.img_list = list()
        self.img_index = 0

        self.counter = 0

        self.uploading_text = Label(text="Uploading...")

        self.bar = ProgressBar()
        self.body = BoxLayout(orientation="vertical")

        self.info = Label(
            text="[color=#05f]A. Ihsan Erdem[/color] Image Viewer",
            markup=True,
            size_hint_y=.1)

        self.button_bar = BoxLayout(size_hint_y=.15)
        self.next_button = Button(text='Next',
                                  size_hint_x=.2,
                                  on_release=self.forward)
        self.prev_button = Button(text='Previous',
                                  size_hint_x=.2,
                                  on_release=self.backward)
    def __init__(self, **kwa):
        super(CustomProgressbar, self).__init__(**kwa)

        self.progress_bar = ProgressBar()
        self.popup = Popup(title=TagApp.lang("analysing"),
                           content=self.progress_bar,
                           size_hint=(.75, .75))
    def openfile(obj, value, selected, event):
        progbar = ProgressBar()

        obj.logpath = selected
        obj.switchscreen(progbar)
        obj.tlog = mp.TelemetryLog(selected[0], progbar, obj.postopen,
                                   obj.posterror)
    def popup_dictionary(self, dictionary, instance):

        lay_minmax_words = BoxLayout(orientation='vertical', spacing=6)
        lay_center_minmaxbtn = AnchorLayout(anchor_x='center',
                                            anchor_y='center',
                                            size_hint=(1, .3))

        self.popup = Popup(title="Create my dictionary",
                           content=lay_minmax_words,
                           size=(400, 370),
                           size_hint=(None, None))
        inp_min_len = TextInput(text='',
                                hint_text='minimum length',
                                size_hint=(1, .4))
        inp_max_len = TextInput(text='',
                                hint_text='maximum length',
                                size_hint=(1, .4))
        filename = TextInput(text='', hint_text='file name', size_hint=(1, .4))

        self.progressbar = ProgressBar(max=1100, size_hint=(1, .2))
        self.update_bar = Clock.create_trigger(self.update_bar_event)

        btn_minmax_submit = Button(text="Submit",
                                   size_hint=(.5, 1),
                                   on_press=partial(self.submit_dictionary,
                                                    dictionary, inp_min_len,
                                                    inp_max_len, filename,
                                                    self.update_bar_event))
        self.progressbar.value = 0
        lay_center_minmaxbtn.add_widget(btn_minmax_submit)

        lay_minmax_words.add_widget(
            Label(text='File Name:', size_hint=(1, .2), font_size='16sp'))
        lay_minmax_words.add_widget(
            Label(text='(For default length leave empty):',
                  size_hint=(1, .2),
                  font_size='14sp'))
        lay_minmax_words.add_widget(filename)
        lay_minmax_words.add_widget(
            Label(text='Words minimum length:',
                  size_hint=(1, .2),
                  font_size='16sp'))
        lay_minmax_words.add_widget(
            Label(text='(For default length leave empty):',
                  size_hint=(1, .2),
                  font_size='14sp'))
        lay_minmax_words.add_widget(inp_min_len)
        lay_minmax_words.add_widget(
            Label(text='Words maximum length:',
                  size_hint=(1, .2),
                  font_size='16sp'))
        lay_minmax_words.add_widget(
            Label(text='(For default length leave empty):',
                  size_hint=(1, .2),
                  font_size='14sp'))
        lay_minmax_words.add_widget(inp_max_len)
        lay_minmax_words.add_widget(self.progressbar)
        lay_minmax_words.add_widget(lay_center_minmaxbtn)

        self.popup.open()
Example #7
0
    def Show(self,*,uTitle:str,uMessage:str,iMax:int) -> Popup:
        """ Shows the Popup """
        self.iMax           = iMax
        self.bCancel        = False
        oContent:BoxLayout  = BoxLayout(orientation='vertical', spacing='5dp')
        iHeight:int         = int(Globals.iAppHeight*0.5)
        if Globals.uDeviceOrientation=="landscape":
            iHeight=int(Globals.iAppHeight*0.9)
        self.oPopup         = Popup(title=ReplaceVars(uTitle),content=oContent, size=(Globals.iAppWidth*0.9,iHeight),size_hint=(None, None),auto_dismiss=False)
        self.oLabel         = Label(text=ReplaceVars(uMessage), text_size=(Globals.iAppWidth*0.86, None), shorten=True, valign='top',halign='left')
        self.oProgressText  = Label(valign='top',halign='center',text_size=(Globals.iAppWidth*0.86, None), shorten=True)
        oContent.add_widget(Widget())
        oContent.add_widget(self.oLabel)
        oContent.add_widget(Widget())
        self.oProgressText.text=""

        self.oProgressBar = ProgressBar(size_hint_y=None, height='50dp', max=iMax)
        oContent.add_widget(self.oProgressBar)
        oContent.add_widget(self.oProgressText)
        oContent.add_widget(SettingSpacer())
        oBtn:Button = Button(size_hint_y=None, height='50dp',text=ReplaceVars('$lvar(5009)'))
        oBtn.bind(on_release=self.OnCancel)
        oContent.add_widget(oBtn)
        self.oPopup.open()
        return self.oPopup
Example #8
0
async def popup_task(title, func, *args, **kwargs):
    content = ProgressBar(value=0.7, max=1)
    popup = Popup(title=title, content=content, size_hint=(.8, .1))
    popup.open()
    result = await thread(func, *args, **kwargs)
    popup.dismiss()
    return result
Example #9
0
    def process(self):
        try:
            if not self.path:
                raise ValueError('No burst selected.')
            # Get slider values for compression, gain, and contrast
            self.compression = self.ids.compression.value
            self.gain = self.ids.gain.value
            self.contrast = self.ids.contrast.value

            self.progress_bar = ProgressBar()
            self.progress_popup = Popup(title=f'Processing {self.path}',
                                        content=self.progress_bar,
                                        size_hint=(0.7, 0.2),
                                        auto_dismiss=False)
            self.progress_popup.bind(on_dismiss=self.reload_images)
            self.progress_bar.value = 1
            self.progress_popup.open()
            Clock.schedule_interval(self.next, 0.1)

            HDR_thread = threading.Thread(target=HDR,
                                          args=(self.path, self.compression, self.gain, self.contrast, self,))
            HDR_thread.start()

        except Exception as e:
            self.show_error(e)
Example #10
0
    def send_message(self, text):
        if text.strip():
            self.pb = None

            def loading(request, current_size, total_size):
                self.pb.value += current_size
                if self.pb.value >= total_size:
                    self.popup.dismiss()
                    if os.path.exists(IMG_PATH):
                        os.remove(IMG_PATH)

            token = get_app().user_store.get('auth')['token']
            headers = {
                'Content-type': 'application/x-www-form-urlencoded',
                'Authorization': 'Token {0}'.format(token)
            }
            data_to_send = {'message': text}
            if os.path.exists(IMG_PATH):
                data_to_send['photo'] = base64.b64encode(
                    open(IMG_PATH, 'rb').read())
            params = urllib.urlencode(data_to_send)
            host = get_app().config_store.get('config')['host']
            port = get_app().config_store.get('config')['port']
            req = UrlRequest('http://{0}:{1}/messages/'.format(host, port),
                             req_body=params,
                             req_headers=headers,
                             timeout=10,
                             on_progress=loading)
            self.pb = ProgressBar()
            self.popup = Popup(title='Sending message',
                               content=self.pb,
                               size_hint=(0.7, 0.3))
            self.popup.open()
Example #11
0
    def __init__(self, **kwa):
        super(MyWidget, self).__init__(**kwa)

        self.progress_bar = ProgressBar()
        self.popup = Popup(title='Download', content=self.progress_bar)
        self.popup.bind(on_open=self.puopen)
        self.add_widget(Button(text='Download', on_release=self.pop))
Example #12
0
    def login(self, user, pwd):
        if user.strip() and pwd.strip():

            def loading(request, current_size, total_size):
                self.pb.value += current_size
                if self.pb.value >= total_size:
                    self.popup.dismiss()

            def save_auth(req, result):
                if 'token' in result:
                    get_app().user_store.put('auth', token=result['token'])
                    sm.current = 'messages'

            params = json.dumps({'username': user, 'password': pwd})
            headers = {
                'Content-type': 'application/json',
                'Accept': 'application/json'
            }
            host = get_app().config_store.get('config')['host']
            port = get_app().config_store.get('config')['port']
            req = UrlRequest('http://{0}:{1}/api-token-auth/'.format(
                host, port),
                             req_body=params,
                             req_headers=headers,
                             timeout=10,
                             on_success=save_auth,
                             on_progress=loading)
            self.pb = ProgressBar()
            self.popup = Popup(title='Get token from the server...',
                               content=self.pb,
                               size_hint=(0.7, 0.3))
            self.popup.open()
Example #13
0
class ProcessesIndicatorPopup(Popup):
    ProcesPopup = ObjectProperty()
    ecxept_trone = ObjectProperty()
    Progress_Bar = ProgressBar()

    #sets ecxeption errors trown on ProcessesIndicatorPopup conten label
    def set_conn_error_msg(self, ecxeptiontrone):

        if ecxeptiontrone == "ConnectionError":
            self.title = "No internet connection found"
            self.content = Label(text="could not connect to the internet")

        elif ecxeptiontrone == "Timeout":
            self.title = "Connection timed out"
            self.content = Label(text="Check device internet connection")

        elif ecxeptiontrone == "KeyError":
            self.title = "Location not found"
            self.content = Label(text="The location entered is not found")

        else:
            pass

    def conn_indicator_popup(self):
        self.title = "connecting......"
        self.content = self.Progress_Bar.value = 1
        self.open()

    def calc_conn_progres(self):
        if self.Progress_Bar.value >= 100:
            return False
            self.Progress_Bar.value += 1

    def conn_indicator_popup_on_open(self):
        Clock.schedule_interval(self.calc_conn_progres, 1 / 25)
    def start(self, difficulty):
        if difficulty == 1:
            self.play_zones = [
                'N. America',
                'C. America',
                'S. America',
                'Europe',
                'Greenland',
                'Australia',
                'Russia',
                'Anime',
            ]
        else:
            self.play_zones = [x for x in ZONES.keys()]

        self.points = 0
        self.life = LIFE
        self.controls = GControls()
        self.bar = ProgressBar(max=self.time, value=self.time)
        self.bar.pos = 20, BOTTOM_BORDER
        self.bar.size = Window.width - 40, (Window.height / 12.0)
        self.top_border = TopBorder()

        self.add_widget(self.controls)
        self.add_widget(self.bar)
        self.add_widget(self.top_border)
        self.select_country()
Example #15
0
def download_apk(instance, answer):
    global popup
    if answer == "yes":
        global apk_url
        apk_path = os.path.join(main_utils.get_mobileinsight_path(),
                                "update.apk")
        if os.path.isfile(apk_path):
            os.remove(apk_path)

        t = threading.Thread(target=download_thread, args=(apk_url, apk_path))
        t.start()

        progress_bar = ProgressBar()
        progress_bar.value = 1

        def download_progress(instance):
            def next_update(dt):
                if progress_bar.value >= 100:
                    return False
                progress_bar.value += 1

            Clock.schedule_interval(next_update, 1 / 25)

        progress_popup = Popup(title='Downloading MobileInsight...',
                               content=progress_bar)

        progress_popup.bind(on_open=download_progress)
        progress_popup.open()

    popup.dismiss()
Example #16
0
    def __init__(self, **kwargs):
        super(DataGen, self).__init__(**kwargs)
        self.add_widget(
            Label(text='Enter The Id:', size_hint=(.05, .05), pos=(55, 30)))
        self.Id = TextInput(multiline=False,
                            size_hint=(.2, .05),
                            pos=(120, 30))
        self.add_widget(self.Id)
        self.progress = ProgressBar(max=100, size_hint=(.99, .05), pos=(5, 75))
        self.add_widget(self.progress)

        self.buttn = Button(text="Generate",
                            size_hint=(.6, .05),
                            pos=(260, 30))
        self.buttn.bind(on_press=self.gen)
        self.add_widget(self.buttn)
        with self.canvas:
            Line(points=[12, 20, 690, 20, 690, 75, 12, 75, 12, 20], width=2)
        self.sampleNum = 0
        # ----camera coding starts here----
        self.img1 = Image(source='images/1.jpg',
                          size_hint=(.9, .80),
                          pos=(40, 100))
        self.add_widget(self.img1)
        self.capture = cv2.VideoCapture(0)
        self.cascadePath = "xml/haarcascade_frontalface_default.xml"
        self.faceCascade = cv2.CascadeClassifier(self.cascadePath)
        Clock.schedule_interval(self.still, 1.0 / 1000)
    def __init__(self, **kwargs):
        super(Gauge, self).__init__(**kwargs)

        self._gauge = Scatter(size=(self.size_gauge, self.size_gauge),
                              do_rotation=False,
                              do_scale=False,
                              do_translation=False)

        _img_gauge = Image(source=self.file_gauge,
                           size=(self.size_gauge, self.size_gauge))

        self._needle = Scatter(size=(self.size_gauge, self.size_gauge),
                               do_rotation=False,
                               do_scale=False,
                               do_translation=False)

        _img_needle = Image(source=self.file_needle,
                            size=(self.size_gauge, self.size_gauge))

        self._glab = Label(font_size=self.size_text, markup=True)
        self._progress = ProgressBar(max=100, height=20, value=self.value)

        self._gauge.add_widget(_img_gauge)
        self._needle.add_widget(_img_needle)

        self.add_widget(self._gauge)
        self.add_widget(self._needle)
        self.add_widget(self._glab)
        self.add_widget(self._progress)

        self.bind(pos=self._update)
        self.bind(size=self._update)
        self.bind(value=self._turn)
Example #18
0
    def import_lesson(self, button_sub):

        button_sub.state = "down"
        print(self.text_classid + self.text_userid + self.text_lessonid)
        response_code = 0
        if self.lesson_import_flag == 0:
            response_code, json_object = data_lessons.import_new_lesson(
                self.text_userid, self.text_classid, self.text_lessonid)

        if response_code == 1:
            self.text_status = "There was an error accessing the lesson. Check your access details."
            button_sub.disabled = False
            button_sub.state = "normal"
            self.lesson_import_flag = 0
        else:

            self.text_status = "Access details correct. Downloading the lesson..."
            self.call_update = Thread(
                target=data_lessons.update_lesson_details,
                args=(json_object, ))
            self.call_update.start()
            self.progress_bar = ProgressBar()
            self.popup = Popup(title='Importing lesson',
                               content=self.progress_bar,
                               size_hint=(1, 0.3),
                               auto_dismiss=False)
            self.popup.open()
            Clock.schedule_interval(self.next, 0.5)
Example #19
0
    def __init__(self, movie, labels, params, parallel, **kwargs):
        super().__init__(**kwargs)

        self.params = params['seg_param'][...]

        # Classifier is used if training data is present
        self.clf = 0
        if 'seg_training' in params:
            self.clf = classifypixels.train_clf(params['seg_training'])

        self.movie = movie
        self.labels = labels
        self.layout = FloatLayout(size=(Window.width, Window.height))

        if parallel:

            # Cannot provide loading bar if parallel processing is used with current structure

            self.seg_message = Label(text='[b][color=000000]Parallel Processing' \
                                          '\n   No Loading Bar[/b][/color]', markup=True,
                                     size_hint=(.2, .05), pos_hint={'x': .4, 'y': .65})
            with self.canvas:

                self.add_widget(self.layout)
                self.layout.add_widget(self.seg_message)

        else:

            # Add loading bar to canvas and initiate scheduling of segmentation

            self.seg_message = Label(
                text='[b][color=000000]Segmenting Images[/b][/color]',
                markup=True,
                size_hint=(.2, .05),
                pos_hint={
                    'x': .4,
                    'y': .65
                })

            self.layout2 = GridLayout(rows=1,
                                      padding=2,
                                      size_hint=(.9, .1),
                                      pos_hint={
                                          'x': .05,
                                          'y': .5
                                      })
            self.pb = ProgressBar(max=1000,
                                  size_hint=(8., 1.),
                                  pos_hint={
                                      'x': .1,
                                      'y': .6
                                  },
                                  value=1000 / self.movie.frames)
            self.layout2.add_widget(self.pb)

            with self.canvas:

                self.add_widget(self.layout)
                self.layout.add_widget(self.seg_message)
                self.layout.add_widget(self.layout2)
Example #20
0
 def newFile(self, title):
     self.stat.append(Label(text='', size_hint=(1, None), height=30))
     self.p_bar.append(ProgressBar())
     self.my_grid.add_widget(
         Label(text=title, size_hint=(1, None), height=30))
     self.my_grid.add_widget(self.stat[-1])
     self.my_grid.add_widget(self.p_bar[-1])
Example #21
0
 def __init__(self, **kwargs):
     super(MainScreenSW, self).__init__(**kwargs)
     #   self.pop = LoginPopup()
     self.progress = ProgressBar()
     self.progressPopup = Popup(title='loading',
                                content=self.progress,
                                background_color=(1, 1, 4, .9))
     self.progressPopup.bind(on_open=self.puopen)
Example #22
0
    def __init__(self, **kwa):
        super( MyPopupProgressBar, self).__init__(**kwa)

        self.progress_bar = ProgressBar()
        self.popup = Popup(title='Loading: {}%'.format(int(self.progress_bar.value)),
            content=self.progress_bar)
        self.popup.bind(on_open=self.puopen)
        Clock.schedule_once(self.pop)
Example #23
0
 def add_progress(self):
     self.pb = ProgressBar(max=self.a.__len__())
     self.pb.value = 0
     self.progress_pop = Popup(title='Translating...',
                               content=self.pb,
                               size_hint=(0.5, 0.1),
                               auto_dismiss=False)
     self.progress_pop.open()
Example #24
0
    def build(self):
        self.bar = ProgressBar(max=100)
        self.deger = 0

        Clock.schedule_once(self.say,
                            1)  # 1 ms sonra self.say adlı fonksiyona git

        return self.bar
Example #25
0
 def addProgressbar(self):
     self.recordingProgressBar = ProgressBar(max=1000,
                                             pos=(0, -220),
                                             width=100,
                                             height=400)
     #self.add_widget(self.recordingProgressBar)
     self.currentProgress = 0
     self.recordingProgressBar.value = self.currentProgress
Example #26
0
 def display(self):
     #dfatrans(txt1,txt2,typ)
     pb = ProgressBar(max=1000)
     popup = Popup(title="Result",
                   content=Label(text=self.show),
                   size_hint=(None, None),
                   size=(500, 500))
     popup.open()
Example #27
0
File: dr.py Project: Sentynel/drpy
 def build(self):
     self.title = "DR tool"
     self.layout = BoxLayout(orientation="vertical")
     self.prog = ProgressBar(size_hint=(1, .1))
     self.layout.add_widget(self.prog)
     self.text = TextInput(readonly=True,
                           font_name="RobotoMono-Regular")
     self.layout.add_widget(self.text)
     return self.layout
Example #28
0
class ProgressScreen(Screen):
    pb = ProgressBar(max=1000)
    pb.value = 500

    def on_back(self):
        pass

    def on_next(self):
        pass
Example #29
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.padding = "10dp"
        progress = ProgressBar(max=100, size_hint_y=0.01)

        self.add_widget(progress)
        self.add_widget(Apiholder(size_hint_y=.2))
        progress.value = 50
        self.add_widget(Paramholder(size_hint_y=1))
Example #30
0
 def gen_xlsx(self, btn: Button):
     if self.trace is not None:
         pb = ProgressBar(max=len(self.trace.rows) * 2,
                          value=0,
                          size_hint_y=None,
                          height=30)
         self.bl.clear_widgets([btn])
         self.bl.add_widget(pb, 3)
         self.trace.regular_as_xlsx(pb, self.popup, self.bl, btn)