Beispiel #1
0
def substitute_phrase():

    phrase = " ".join(argv[2:])

    replace_keys_raw = re.findall(r"\^.*?\^",
                                  phrase)  # regexes keywords from cml argumend
    replace_keys_stripped = [item.strip("^") for item in replace_keys_raw
                             ]  # strips keyword markers (^^)
    symbols = get_from_map_super(
        replace_keys_stripped)  # gets symbols from map

    summarized = zip(replace_keys_raw, replace_keys_stripped,
                     symbols)  # creates a list of 3-tuples

    for item in summarized:  # do the substituion
        if item[2] != "None":  # if the symbol was not found, leave the keywod in the output string
            phrase = phrase.replace(item[0], item[2])
        else:
            continue

    if replace_keys_raw != []:
        print "Subsituted phrase: {}".format(phrase)
    else:
        print "No keywords subsituted."

    symget_basefunctions.put_to_clipboard(phrase)
Beispiel #2
0
def get_from_map_super(keyword=argv[1:]):

    symbols = symget_basefunctions.get_from_map_base(keyword)
    clean_symbols = [item for item in symbols if item != "None"]

    if clean_symbols != []: # check whether any symbol has been retrieved from map
        print "Symbols: {}".format(" ".join(clean_symbols)) # if yes, prints them out
    else:
        pass 

    symget_basefunctions.put_to_clipboard(" ".join(clean_symbols))
    symget_basefunctions.log_last_call(clean_symbols)

    return symbols
Beispiel #3
0
def get_from_map_super(keyword=argv[1:]):

    symbols = symget_basefunctions.get_from_map_base(keyword)
    clean_symbols = [item for item in symbols if item != "None"]

    if clean_symbols != []:  # check whether any symbol has been retrieved from map
        print "Symbols: {}".format(
            " ".join(clean_symbols))  # if yes, prints them out
    else:
        pass

    symget_basefunctions.put_to_clipboard(" ".join(clean_symbols))
    symget_basefunctions.log_last_call(clean_symbols)

    return symbols
Beispiel #4
0
def substitute_phrase():
    
    phrase = " ".join(argv[2:])

    replace_keys_raw = re.findall(r"\^.*?\^", phrase) # regexes keywords from cml argumend
    replace_keys_stripped = [item.strip("^") for item in replace_keys_raw] # strips keyword markers (^^)
    symbols = get_from_map_super(replace_keys_stripped) # gets symbols from map

    summarized = zip(replace_keys_raw, replace_keys_stripped, symbols) # creates a list of 3-tuples
    
    for item in summarized: # do the substituion
        if item[2] != "None": # if the symbol was not found, leave the keywod in the output string
            phrase = phrase.replace(item[0], item[2])
        else:
            continue

    if replace_keys_raw != []:
        print "Subsituted phrase: {}".format(phrase)
    else:
        print "No keywords subsituted."  
    
    symget_basefunctions.put_to_clipboard(phrase)