Exemple #1
0
def start():
    feedCTRL.cli('')
    #print("feed control control")
    #return
    path = str(Python.getPlatform().getApplication().getFilesDir())
    db = kotlin.KotlinFunction()
    db.get_host_master_id()
    timestamp = strftime("%Y-%m-%d %H:%M", gmtime())
    public_keys = ect.EventCreationTool.get_stored_feed_ids(directory_path=path, as_strings=False, relative=False)

    if len(public_keys) <= 1:
        eg = ect.EventFactory(path_to_keys=path, path_to_keys_relative=False)

        # VERY first event (for feedCTRL)
        #first_event = eg.next_event('KotlinUI/MASTER', {'master_feed': eg.get_feed_id()})
        first_event = eg.first_event('KotlinUI', db.get_host_master_id())
        #first_event = eg.first_event('KotlinUI', eg.get_feed_id())
        #first_event = eg.next_event('KotlinUI', eg.get_feed_id())

        db.insert_data(first_event)
        first_event_byApp = eg.next_event('KotlinUI/username', {"newUsername": "******", "oldUsername": "", "timestamp": timestamp})
        db.insert_data(first_event_byApp)
        set_master_uname("Anonymous")

    #feedCTRL.cli('-t 0 0')
    #feedCTRL.cli('-t 0 1')
    #feedCTRL.cli('-t 1 0')
    #feedCTRL.cli('-t 1 1')

    #print("printing the len of public keys")
    #print(len(public_keys))
    #print("finished printing len of public keys")
    #print("This should contain AT LEAST 2 events")
    #print(db.get_all_kotlin_events())
    #print("-----------------------")
    print('TESTING CLI FUNCTION')
Exemple #2
0
def get_all_DB_users():
    return feedCTRL.cli('-p')
Exemple #3
0
def trust(master_idx, feed_idx):
    feedCTRL.cli("-t {} {}".format(master_idx, feed_idx))
    ufh = ui.UiFunctionHandler()
Exemple #4
0
def block(master_idx, feed_idx):
    feedCTRL.cli("-ut {} {}".format(master_idx, feed_idx))
Exemple #5
0
def set_master_uname(uname):
    feedCTRL.cli("-n {}".format(uname))