def progbar(self):
     pb = ProgressBar()
     popup = Popup(title='Brute Forcing ...',
                   content=pb,
                   size_hint=(0.7, 0.3))
     popup.open()
     time.sleep(2)
     pb.value = 25
     time.sleep(4)
     pb.value = 50
     time.sleep(6)
     pb.value = 75
     time.sleep(8)
     pb.value = 100  #value becomes 100 of progressbar.
 def progbar(self):
     pb = ProgressBar()
     popup = Popup(title='Searching in DB... Do NOT Close This Window!', content=pb, size_hint=(0.7, 0.3))
     popup.open()
     time.sleep(2)
     pb.value = 25
     time.sleep(4)
     pb.value = 50
     time.sleep(6)
     pb.value = 75
     time.sleep(8)
     pb.value = 100
     popup = Popup(title="Password Not Found!",content=Label(text="Double check profile name OR try brute force option!"),size_hint=(0.7,0.3))
     popup.open()
    def progbar(self):
        pb = ProgressBar()
        popup = Popup(title='Brute Forcing... Do NOT Close This Window!', content=pb, size_hint=(0.7, 0.3))
        popup.open()
        time.sleep(2)
        pb.value = 25
        time.sleep(4)
        pb.value = 50
        time.sleep(6)
        pb.value = 75
        time.sleep(8)
        pb.value = 100

        popup = Popup(title="Password Not Found!",content=Label(text="Password Not Found in our dictionary, give it a try later"),size_hint=(0.7,0.3))
        popup.open()
示例#4
0
 def makeMilestoneLayout(self, tid, milestone = None, oldScore=None):
     milestone2 = getPreviousMilestone(tid, milestone)
     newScore = getScore(tid, milestone2, milestone)
     if oldScore is None:
         oldScore = newScore
     scoreLayout = GridLayout(cols=1, spacing=10, size_hint_y = None)
     milestoneButton = Button(text=getDateString(milestone, False), font_size='16sp', size_hint_y = None, height=50)
     milestoneButton.bind(on_press=self.milestoneMenu(tid, milestone))
     scoreLayout.add_widget(milestoneButton)
     progressLayout = BoxLayout(orientation='horizontal')
     prevScoreMilestone = Label(text=getScoreText(oldScore))
     prevScoreMilestone.color = (1,1-float(prevScoreMilestone.text[:-1])/100,1-float(prevScoreMilestone.text[:-1])/100,1)
     progressLayout.add_widget(prevScoreMilestone)
     scoreProgress = ProgressBar(max=0.1)
     scoreProgress.value = oldScore % 0.1
     progressLayout.add_widget(scoreProgress)
     nextScoreMilestone = Label(text=getScoreText(oldScore, True))
     nextScoreMilestone.color = (1,1-float(nextScoreMilestone.text[:-1])/100,1-float(nextScoreMilestone.text[:-1])/100,1)
     nextScoreMilestone.bold = nextScoreMilestone.text == '100%'
     progressLayout.add_widget(nextScoreMilestone)       
     Clock.schedule_interval(self.incrementScoreProgress(scoreProgress, prevScoreMilestone, nextScoreMilestone, oldScore, newScore), 0.1)
     scoreLayout.add_widget(progressLayout)
     scoreLabel = Label(text=str(int(100*newScore))+"%")
     if getNextMilestone(tid) == milestone:
         #expScore = newScore * (milestone-time.time()) / (time.time()-milestone2)
         idealScore = newScore + (milestone-time.time())/(milestone-milestone2)            
         scoreLabel.text += ' ('+ str(int(100*idealScore))+"%)"
     scoreLabel.color = (1,1-newScore,1-newScore,1)
     scoreLabel.bold = newScore>=0.99
     scoreLayout.add_widget(scoreLabel)
     return scoreLayout
示例#5
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()
示例#6
0
    def build(self):
        #Window.clearcolor = (0, 0, 0, 1)
        Window.size = (640, 387) # sizing kivy windows

        root = customlayout(rows=6, cols=1, size_hint=(1, 1)) # from kivy lang class for background
        img1 = Image(source ='safcom.png',size_hint=(1, None)) # Adding images in kivy app
        row1 = GridLayout(rows=1, cols=1, size_hint=(1, None))
        row1.add_widget(img1)
        
        row2 = GridLayout(rows=4, cols=2, size_hint=(1, None))
        #check boxes
        btn1 = CheckBox(size_hint=(None, None), height=20, color=[0, 128, 0, 1])
        lblchk1= Label(text='[b]500mb[/b]', markup=True, color=[0, 0, 0, 1], size_hint=(None, None), height=20)
        btn2 = CheckBox(size_hint=(None, None), height=20)
        lblchk2 = Label(text='[b]2gb[/b]',markup=True, color=[0, 0, 0, 1], size_hint=(None, None), height=20)
        btn3 = CheckBox(size_hint=(None, None), height=20)
        lblchk3 = Label(text='[b]4gb[/b]',markup=True, color=[0, 0, 0, 1], size_hint=(None, None), height=20)
        btn4 = CheckBox(size_hint=(None, None), height=20)
        lblchk4 = Label(text='[b]8gb[/b]',markup=True, color=[0, 0, 0, 1], size_hint=(None, None), height=20)
        row2.add_widget(btn1)
        row2.add_widget(lblchk1)
        row2.add_widget(btn2)
        row2.add_widget(lblchk2)
        row2.add_widget(btn3)
        row2.add_widget(lblchk3)
        row2.add_widget(btn4)
        row2.add_widget(lblchk4)
        
        row3 = GridLayout(rows=1, cols=2, size_hint=(1, None))
        lbl1 = Label(text='  [b]PHONE NUMBER[/b]',markup=True, color=[0, 0, 0, 1], size_hint=(0.3, None), height=30, halign='left', valign='middle')
        lbl1.bind(size=lbl1.setter('text_size'))
        txt1 = TextInput(multiline=False, size_hint=(0.7, None), height=30)
        row3.add_widget(lbl1)
        row3.add_widget(txt1)
        
        row4 = GridLayout(rows=1, cols=3)
        lbbl = Label(size_hint=(0.3, None), height=40)
        lbbbl= Label(size_hint=(0.3, None), height=40)
        btn = Button(text='Generate', color=[0, 128, 0, 1], size_hint=(0.4, None), height=40, halign='left')
        row4.add_widget(lbbl)
        row4.add_widget(btn)
        row4.add_widget(lbbbl)
        
        # loading bar in kivy
        pb = ProgressBar(max=200)
        pb.value=40
        
        row5 = Label(text=' Cytech@ 2016 computer solutions', size_hint=(1, None), height=20, halign='right')
        row5.bind(size=row5.setter('text_size'))#binding text in label helps in alignment
        
        root.add_widget(row1)
        root.add_widget(row2)
        root.add_widget(row3)
        root.add_widget(row4)
        root.add_widget(pb)
        root.add_widget(row5)
        
        return root
示例#7
0
文件: main.py 项目: niceboypy/pixapp
    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))
示例#8
0
    def getUI(self):
        """get the ui element"""
        result = ProgressBar()
        skin = sm.getSkin('meter', self.asset)
        result.size = sm.getControlSize(skin, self.asset)

        result.min = sm.getMinimum('meter', self.value, self._typeInfo)
        result.max = sm.getMaximum('meter', self.value, self._typeInfo)
        if self.value:
            result.value = self.value

        self.uiEl = result
        self.prepareUiElement()
        return result
示例#9
0
    def getUI(self):
        """get the ui element"""
        result = ProgressBar()
        skin = sm.getSkin('meter', self.asset)
        result.size = sm.getControlSize(skin, self.asset)

        result.min = sm.getMinimum('meter', self.value, self._typeInfo)
        result.max = sm.getMaximum('meter', self.value, self._typeInfo)
        if self.value:
            result.value = self.value

        self.uiEl = result
        self.prepareUiElement()
        return result
示例#10
0
	def makeCommandLayout(self, Data, itext):
		layout = self.CommandLayout
		layout.clear_widgets()
		self.commandWidget = TextInput(multiline=False)
		self.commandWidget.readonly = True	
		self.commandWidget.text = itext

		pb = ProgressBar(max=1000)	
		pb.value = (Data.total_compl*1000)/(int(Data.TotalTasks))

		layout.add_widget(self.commandWidget)
		layout.add_widget(pb)
	
		#Get current time and add the message to the log pile.	
		logmessage = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
		logmessage = logmessage + " >>> " + itext 
		Data.log = Data.log + "\n" + logmessage
示例#11
0
    def makeCommandLayout(self, Data, itext):
        layout = self.CommandLayout
        layout.clear_widgets()
        self.commandWidget = TextInput(multiline=False)
        self.commandWidget.readonly = True
        self.commandWidget.text = itext

        pb = ProgressBar(max=1000)
        pb.value = (Data.total_compl * 1000) / (int(Data.TotalTasks))

        layout.add_widget(self.commandWidget)
        layout.add_widget(pb)

        #Get current time and add the message to the log pile.
        logmessage = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        logmessage = logmessage + " >>> " + itext
        Data.log = Data.log + "\n" + logmessage
示例#12
0
 def progbar(self):
     pb = ProgressBar()
     popup = Popup(title='converting ...', content=pb, size_hint=(0.7, 0.3))
     popup.open()
     time.sleep(2)
     pb.value = 10
     time.sleep(2)
     pb.value = 20
     time.sleep(2)
     pb.value = 30
     time.sleep(4)
     pb.value = 50
     time.sleep(6)
     pb.value = 75
     time.sleep(8)
     pb.value = 100
示例#13
0
文件: main.py 项目: drwonky/NC
    def validate_pw(self, obj):
        self.popup.dismiss()
        scheme = Scheme.find(self.wifi_iface, self.ap.ssid)

        if scheme != None:
            scheme.delete()
            print('scheme found, deleting')

        scheme = Scheme.for_cell(self.wifi_iface, self.ap.ssid, self.ap,
                                 obj.text)
        scheme.save()

        progressbar = ProgressBar(max=10)
        progress = Popup(title='Connecting...',
                         size_hint=(None, None),
                         size=(400, 100),
                         content=progressbar)
        progress.open()

        activatethread = Thread(target=self.activate_thread, args=(scheme, ))
        activatethread.start()
        print('thread started')

        while self.activation_status is None:
            time.sleep(1)
            progressbar.value = (progressbar.value + 1) % 10
            print('tick')

        progress.dismiss()

        if self.activation_status:
            self.save_ap()
            print('activated')
        else:
            scheme.delete()
            self.ask_pass()
            print('failed, asking again')
        pass
示例#14
0
        path = CEF_DIR + ".dat"
        if os.path.exists(path):
            os.unlink(path)
        if not os.path.exists(CEF_DIR):
            os.makedirs(CEF_DIR)
        Logger.debug("CEFLoader: Downloading from " + s["url"] + " ...")

        from kivy.app import App
        from kivy.uix.boxlayout import BoxLayout
        from kivy.uix.label import Label
        from kivy.uix.popup import Popup
        from kivy.uix.progressbar import ProgressBar

        content = BoxLayout(orientation='vertical')
        prgr = ProgressBar(max=100)
        prgr.value = 0
        content.add_widget(prgr)
        lab = Label(text="Downloading precompiled CEFPython...")
        content.add_widget(lab)

        popup = Popup(title="Chromium Embedded Framework Installer",
                      content=content,
                      size_hint=(0.75, None),
                      height=200,
                      auto_dismiss=False)

        # content.bind(on_press=popup.dismiss) # shouldn't be, right?


        def download(s, path, progress, label_queue):
            import urllib2
示例#15
0
    def run(self):
        sweep_source_dic = {}

        source_dictionary = self.source_dictionary
        data_dictionary = self.data_dictionary
        fucntion_dictionary = self.fucntion_dictionary

        if 'sweep' in source_dictionary:
            sweep_source_dic = source_dictionary['sweep']
            self.frec_number_point = sweep_source_dic['frec_number_point']
            try:
                self.thread_source = sweep_source_dic['instance'](sweep_source_dic)
            except FailToConnectTelnet as e:
                error_label = Label(text = e.message)
                Popup(title='Source error', content=error_label, size_hint=(None, None), size=(300,300)).open()
                return
            except socket.error as e:
                error_label = Label(text = 'fail to connect,\ncheck connection.')
                Popup(title='Server error', content=error_label, size_hint=(None, None), size=(300,300)).open()
                return
        else:
            self.frec_number_point = -1
            self.thread_source = DummySourceThread()

        self.tone_source = []
        if 'tone' in source_dictionary:
            for source_config in source_dictionary['tone']:
                self.tone_source.append(source_config['instance'](source_config))
        try:
            self.thread_data = DataThread(data_dictionary['roach'])
        except MissingInformation as e:
            print 'Finish for all this %s' %(e.message)
            return

        self.thread_procesing = ProccesThread(fucntion_dictionary)

        self.end_sweep = False

        for source in self.tone_source:
            source.turn_on()

        progress_bar = ProgressBar(max=self.frec_number_point, value = 0)
        progress_bar_popup = Popup(content=progress_bar, size_hint = (None, None), size = (300,300), title='Sweep state of progress')

        progress_bar_popup.open()

        try:
            current_channel = 0

            self.thread_data.start_connections()

            while not self.end_sweep:
                self.thread_source.set_generator(current_channel)
                extract_dictionary = self.thread_data.accuaire_data()
                extract_dictionary['current_channel'] = current_channel
                self.thread_procesing.run_execute_functions(extract_dictionary)

                if self.frec_number_point - 1 == (current_channel):
                    break
                current_channel += 1

                progress_bar.value = current_channel

        except RoachException as roach_e:

            Popup(title='Error Roach', content=Label(text=roach_e.message),\
                          size_hint=(None, None), size=(300, 120)).open()

        except Exception as e:
            Popup(title='Error', content=Label(text=e.message),\
                          size_hint=(None, None), size=(400, 120)).open()

        print "stop it all lol"

        self.thread_data.close_process()
        self.thread_source.close_process()

        for source in self.tone_source:
            source.turn_off()
            source.stop_source()

        self.end_sweep = True

        progress_bar_popup.dismiss()
示例#16
0
文件: guiTest.py 项目: Emil-A/mir-r
	def load(self):
		screen = HostScreen()
		screen.ids['bar'].value = 1000
		pb = ProgressBar()
		pb.value = 1000
示例#17
0
 def buildMainScreen(self, _=None):
     self.clear_widgets()
     mainLayout = GridLayout(cols=1, spacing=10, size_hint_y=None)
     mainLayout.bind(minimum_height=mainLayout.setter('height'))
     self.scroll_y = 1
     self.add_widget(mainLayout)
     cur.execute("SELECT DISTINCT taskId, endTime FROM Fights WHERE value = 0")
     runningTaskDeadlines = {}
     for r in cur.fetchall():
         runningTaskDeadlines[r[0]] = r[1]
     runningTasks = runningTaskDeadlines.keys()
     runningTasks.sort(key = lambda tid: runningTaskDeadlines[tid], reverse = False)
     cur.execute("SELECT DISTINCT taskId FROM Milestones WHERE deadline >= ?", [time.time()])
     tasks = [t[0] for t in cur.fetchall()]
     if tasks and not MainScreen.showall:
         tasks.sort(key = lambda tid: getCompletionExpirationDate(tid), reverse = False)
     else:
         MainScreen.showall = True
         cur.execute("SELECT id FROM Tasks")
         tasks = [x[0] for x in cur.fetchall()]
         tasks.sort(key = lambda tid: getScore(tid), reverse = True)
     tasks = [t for t in tasks if t not in runningTasks]
     tasks = runningTasks + tasks
     self.progressbars = []
     for tid in tasks:
         running = isRunning(tid, True)
         completed = isComplete(tid)
         taskLayout = GridLayout(cols=2, spacing=0, size_hint_y=None, height=100)
         mainLayout.add_widget(taskLayout)
         taskButton = Button(text=getTaskName(tid),  size_hint_y=None, height=100)
         taskLayout.add_widget(taskButton)   
         pledgeButton = Button(size_hint_y=None, size_hint_x=None, width=100, height=100)
         taskLayout.add_widget(pledgeButton)
         pledgeButton.background_color = (0,1,0,1)      
         taskButton.bind(on_press=self.taskMenu(tid))
         if running:
             taskButton.background_color = (0.8,1,0.8,1)
             pledgeButton.background_color = (1,0,0,1)
             cur.execute("SELECT startTime, endTime FROM Fights WHERE value = 0 AND taskId = ?",[tid])
             startTime, endTime = cur.fetchall()[0]
             pledgeButton.bind(on_press=self.taskPopup(tid,  startTime, endTime, True))
             taskProgress = ProgressBar(max=endTime-startTime)
             self.progressbars.append(taskProgress)
             mainLayout.add_widget(taskProgress)
             timeLeft = endTime - time.time()
             if timeLeft > 0: 
                 taskProgress.value = (min(time.time()-startTime, endTime-startTime+1))
             else: 
                 taskProgress.max = taskProgress.value = 1
         else:
             pledgeButton.bind(on_press=self.taskPopup(tid))
             if completed:
                 taskButton.background_color = (1,0.8,0.8,1)        
                 
     if not MainScreen.showall:
         moreButton = Button(text=localisation.get(language,"showmore"), bold=True, size_hint_y=None, height=100)
         mainLayout.add_widget(moreButton)
         moreButton.bind(on_press=self.toggleTasksShown)
     else:
         writeTaskInput = TextInput(text='')
         writeTaskPopup = Popup(title=localisation.get(language, "createnew"),
         content=writeTaskInput,
         size_hint=(None, None), size=(400, 200))
         writeTaskPopup.bind(on_dismiss=self.addEmptyTask(writeTaskInput))
         newTaskButton = Button(text=localisation.get(language,"createnew"), bold=True, size_hint_y=None, height=100)
         newTaskButton.bind(on_release=writeTaskPopup.open)
         mainLayout.add_widget(newTaskButton)
         langDropdown = DropDown()
         for lang in localisation.sections():
             btn = Button(text=lang,background_color = (0.6,0.6,0.6,1), valign = 'middle', halign='center', size_hint_y=None, height=100)
             btn.bind(on_release=self.changeLanguage(lang))
             btn.bind(on_release=langDropdown.dismiss)
             langDropdown.add_widget(btn)
         langButton = Button(text=localisation.get(language,"language"), bold=True, size_hint_y=None, height=100)
         langButton.bind(on_press=langDropdown.open)
         mainLayout.add_widget(langButton)
         lessButton = Button(text=localisation.get(language,"showless"), bold=True, size_hint_y=None, height=100)                        
         mainLayout.add_widget(lessButton)
         lessButton.bind(on_press=self.toggleTasksShown)
                                             
     Clock.unschedule(self.incrementProgressBars)
     Clock.schedule_interval(self.incrementProgressBars, 1)     
示例#18
0
from kivy.uix.progressbar import ProgressBar
from kivy.app import App

pb = ProgressBar(max=1000)

# this will update the graphics automatically (75% done)
pb.value = 750


class Test4App(App):
    def build(self):
        return pb


if __name__ == '__main__':
    Test4App().run()