示例#1
0
文件: main.py 项目: ievans/SimmonsLED
def whitelist(text):
    cleaned = ''
    for c in text:
        #prevent XSS just in case <> is added to LED characters. DO NOT REMOVE.
        if c in LEDCharacters.allowedChars() and c != '>' and c != '<':
            cleaned += c
    return cleaned
示例#2
0
文件: main.py 项目: ievans/SimmonsLED
def whitelist(text):
    cleaned = ''
    for c in text:
        #prevent XSS just in case <> is added to LED characters. DO NOT REMOVE.
        if c in LEDCharacters.allowedChars() and c != '>' and c != '<':
            cleaned += c
    return cleaned
示例#3
0
def test():
    allowedChars = LEDCharacters.allowedChars()
    test = MatrixScroller(allowedChars, 6, 6)
    for i in range(len(allowedChars)*10):
        test.next()
    print 'all tests OK'
    test = MatrixScroller('A', 6, 6)
    msr = MatrixScrollRepeater(2, test)
    for i in range(20):
        msr.next()
        print msr.getMatrix()

    test = MatrixScroller('....', 6, 6)
    test.next()
    test.next()
    test.next()
    test.next()
    test.next()
    print test #.getArduinoMatrix()
    print test.getArduinoList()