Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/cca/diff/ef8839e99f34/interface.py
Дата изменения: Unknown
Дата индексирования: Fri Feb 28 18:25:01 2014
Кодировка:
cca: interface.py diff

cca

diff interface.py @ 105:ef8839e99f34

Adding GPLv2
author darkhan
date Sat, 18 Dec 2010 13:58:03 +0300
parents 136a16e31a57
children
line diff
     1.1 --- a/interface.py	Wed Dec 15 22:39:49 2010 +0300
     1.2 +++ b/interface.py	Sat Dec 18 13:58:03 2010 +0300
     1.3 @@ -1,3 +1,21 @@
     1.4 +"""Copyright 2010 Aydarkhanov Ruslan, Kurochkin Ilya, Rusinov Ivan
     1.5 +
     1.6 +This file is part of Foobar.
     1.7 +
     1.8 +Foobar is free software: you can redistribute it and/or modify it under
     1.9 +the terms of the GNU General Public License as published
    1.10 +by the Free Software Foundation, either version 2 of the License,
    1.11 +or (at your option) any later version.
    1.12 +
    1.13 +Foobar is distributed in the hope that it will be useful,
    1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty
    1.15 +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1.16 +See the GNU General Public License for more details.
    1.17 +
    1.18 +You should have received a copy of the GNU General Public License
    1.19 +along with Foobar. If not, see http://www.gnu.org/licenses/.
    1.20 +"""
    1.21 +
    1.22  import math
    1.23  import pickle
    1.24  import random
    1.25 @@ -56,13 +74,15 @@
    1.26  	def save_file(self, event=None):
    1.27  		file = tkFileDialog.asksaveasfile(defaultextension=".caf",
    1.28  											title="Save automata as",
    1.29 -											filetypes=[('CCA File', '*.caf')])
    1.30 +											filetypes=[('CCA File', '*.caf')],
    1.31 +											mode="wb")
    1.32  		if file is not None:
    1.33  			pickle.dump([automata.field, automata.states], file)
    1.34  	
    1.35  	def open_file(self, event=None):
    1.36  		file = tkFileDialog.askopenfile(title="Open file",
    1.37 -										filetypes=[('CCA File', '*.caf')])
    1.38 +										filetypes=[('CCA File', '*.caf')],
    1.39 +										mode="rb")
    1.40  		if file is not None:
    1.41  			from_file = pickle.load(file)
    1.42  			automata.field = from_file[0]