Exemplo n.º 1
0
 def run(self):
     while True:
         print("\tVersion: %s" % self.this_version)
         print("\tDevice : %s exist" % base.get_device_num())
         self.display()
         self.get_num()
         if (self.input is 0):
             continue
         elif (self.input is 1):
             led.Led(led.Led.led_menu_array).run()
         elif (self.input is 2):
             wifi.Wifi(wifi.Wifi.wifi_menu_array).run()
         elif (self.input is 3):
             alexa.Alexa().run()
         elif (self.input is 4):
             bt.Bt(bt.Bt.bt_menu_array).run()
         elif (self.input is 5):
             development.Development().run()
         elif (self.input is 6):
             fastboot_all.FastbootImage().run()
         elif (self.input is 7):
             os.system('adb reboot')
             os._exit(0)
         elif (self.input is 8):
             os._exit(0)
         else:
             print("error")
             continue
Exemplo n.º 2
0
def main(_):
    logger = setup_logger()
    domains = ['.com', '.net', '.gov', '.edu', '.io', '.org']
    alexa_db = alexa.Alexa(domains, count=500)
    alexa_db.load()
    top_sites = alexa_db.get_sites()

    maxmind_db = maxmind.Maxmind()
    maxmind_db.load()

    with open('alexa-pt-paths.csv', 'w') as outfile:
        find_as_paths(top_sites, maxmind_db, outfile)

    with open('mlab-pt-paths.csv', 'w') as outfile:
        mlab_hosts = get_ndt_hostnames(6, 50)
        find_as_paths(mlab_hosts, maxmind_db, outfile)
Exemplo n.º 3
0
def main(args):
    logger = setup_logger()
    domains = ['.com', '.net', '.gov', '.edu', '.io', '.org']
    alexa_db = alexa.Alexa(domains, count=500)
    alexa_db.load()
    top_sites = alexa_db.get_sites()

    maxmind_db = maxmind.Maxmind()
    maxmind_db.load()

    #with open('alexa-pt-paths.csv', 'w') as outfile:
    #    find_as_paths(top_sites, maxmind_db, outfile)

    with open('mlab-pt-paths.csv', 'w') as outfile:
        mlab_hosts = []
        for i in range(1, 6):        
            mlab_hosts.append('ndt.iupui.mlab1.lga0%s.measurement-lab.org' %
                              i)
        find_as_paths(mlab_hosts, maxmind_db, outfile)
Exemplo n.º 4
0
def index(req):
    c = {
        "title": "Alexa Application",
        "active_menu": "Applications",
        "request": req,
        "user": auth.get_user(req)
    }
    if req.POST:
        category = req.POST['category']
        page_number = req.POST['page_number']
        try:
            if int(page_number) > 20: raise ValueError("Error")
            AlClass = alexa.Alexa()
            res = AlClass.getSitesByCategoryAndPageNumber(
                category, page_number)
            c.update({"results": res})
        except:
            c.update({"message": "Seem's there is error!"})

    c.update(csrf(req))
    return render_to_response('user/applications/alexa/index.html', c)
Exemplo n.º 5
0
import cv2
import numpy as np
from pynput.mouse import Button, Controller
from tkinter import *
from PIL import ImageTk, Image
from tkinter.ttk import *
import alexa

mouse = Controller()
alexa_assistant = alexa.Alexa()

root = Tk()
photo = ImageTk.PhotoImage(Image.open(r"alexamic.jpg"))
sx = root.winfo_screenwidth()

sy = root.winfo_screenheight()
(camx, camy) = (320, 240)

lowerBound = np.array([33, 80, 40])
upperBound = np.array([102, 255, 255])
cam = cv2.VideoCapture(1, cv2.CAP_DSHOW)

kernelOpen = np.ones((5, 5))
kernelClose = np.ones((20, 20))
pinchFlag = 0


def ignorekey():
    pass

Exemplo n.º 6
0
file top-1m.csv as the source
"""

import probedb.standalone
import probedb.probedata2.models as Probe

import alexa

import threading
import Queue, time

num_probers = 20
alexa_queue = Queue.Queue()
progress_queue = Queue.Queue()
active = True
alexa_list = alexa.Alexa("top-1m.csv")


def __ProgressCounter(queue):
    i = 0
    while True:
        queue.get()

        i += 1
        if i % 100 == 0:
            print "Updated ", i, "domains so far"


def do_save(tid, alexa_queue, progress_queue):

    while True:
Exemplo n.º 7
0
def default():
  ask_handler = alexa.Alexa(context)
  return ask_handler.default_no()
Exemplo n.º 8
0
def ask_led_pattern(pattern):
  ask_handler = alexa.Alexa(context)
  return ask_handler.set_ledstrip_pattern(pattern)
Exemplo n.º 9
0
def ask_access_key():
  ask_handler = alexa.Alexa(context)
  return ask_handler.get_arq()
Exemplo n.º 10
0
def ask_welcome():
  ask_handler = alexa.Alexa(context)
  return ask_handler.welcome()