Example #1
0
def main():
    filename = sys.argv[1] if len(sys.argv) == 2 else "seating.xls"
    if filename.endswith('.xls') or filename.endswith('.xlsx'):
        state = read_excel(open(filename).read())
    elif filename.endswith('.txt'):
        state = read_text(open(filename).read())
    else:
        state = start_seating()

    state.shuffle()
    state = fast_search(state)

    print dump(state)
    print report(state)
    print repr(state)
    print write_text(state)
    with open("seating.xls", "wb") as f:
        f.write(write_excel(state))
Example #2
0
def main():
    filename = sys.argv[1] if len(sys.argv) == 2 else "seating.xls"
    if filename.endswith('.xls') or filename.endswith('.xlsx'):
        state = read_excel(open(filename).read())
    elif filename.endswith('.txt'):
        state = read_text(open(filename).read())
    else:
        state = start_seating()

    state.shuffle()
    state = fast_search(state)

    print dump(state)
    print report(state)
    print repr(state)
    print write_text(state)
    with open("seating.xls", "wb") as f:
        f.write(write_excel(state))
Example #3
0
def test_text_format(initial):
    text_content = write_text(initial)
    actual = read_text(text_content)
    print repr(actual)
    _assert_same_state(initial, actual)
Example #4
0
 def export(self):
     return write_text(self.state_keeper.get_current_state())
Example #5
0
 def export(self):
     return write_text(self.state_keeper.get_current_state())