Package ajango :: Package core
[hide private]
[frames] | no frames]

Source Code for Package ajango.core

 1  ########################################################################### 
 2  #                                                                         # 
 3  #  Copyright (C) 2016  Rafal Kobel <rafyco1@gmail.com>                    # 
 4  #                                                                         # 
 5  #  This program is free software: you can redistribute it and/or modify   # 
 6  #  it under the terms of the GNU General Public License as published by   # 
 7  #  the Free Software Foundation, either version 3 of the License, or      # 
 8  #  (at your option) any later version.                                    # 
 9  #                                                                         # 
10  #  This program is distributed in the hope that it will be useful,        # 
11  #  but WITHOUT ANY WARRANTY; without even the implied warranty of         # 
12  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the           # 
13  #  GNU General Public License for more details.                           # 
14  #                                                                         # 
15  #  You should have received a copy of the GNU General Public License      # 
16  #  along with this program.  If not, see <http://www.gnu.org/licenses/>.  # 
17  #                                                                         # 
18  ########################################################################### 
19  """ Zestaw funkcji pomocniczych pakietu Ajango. """ 
20   
21 -def add_to_python_array(buffor, pattern, value):
22 """ Dodaje do zdefiniowanej tabeli wybrane wartosci. """ 23 pattern = pattern + " = [" 24 buffor = buffor.replace(pattern, pattern + value) 25 return buffor
26
27 -def file_to_buffor(address):
28 """ Odczytuje dane z pliku i zwraca do buffora. """ 29 buffor = '' 30 try: 31 fsettings = open(address, "r") 32 buffor = fsettings.read() 33 finally: 34 fsettings.close() 35 return buffor
36
37 -def buffor_to_file(address, buffor):
38 """ Zapisuje wartosc buffora do pliku. """ 39 try: 40 fsettings = open(address, "w") 41 fsettings.write(buffor) 42 finally: 43 fsettings.close()
44