From 27c3a0ab2ec2b377f2300e42383fce1ff62b8c2c Mon Sep 17 00:00:00 2001 From: yaderv Date: Tue, 22 Mar 2011 15:43:27 +0000 Subject: bug fixed --- (limited to 'archivo.py') diff --git a/archivo.py b/archivo.py index 73e7f13..75748cc 100644 --- a/archivo.py +++ b/archivo.py @@ -95,21 +95,23 @@ def abrir_archivo(path, archivo): archivo.close() return texto -def guardar_archivo(path, file_name, archivo): +def guardar_archivo(path, file_name, tipo_archivo): '''import, convert and save a new ephemeris/phrases database''' - if archivo is 1: + if tipo_archivo is 1: path = path + '/data/efemerides.pkl' - elif archivo is 2: + elif tipo_archivo is 2: path = path + '/data/frase.pkl' di = {} archivo = open(file_name, 'r') lines = archivo.readlines() for i in range(len(lines)): - current_text = lines[i][10 : len(lines[i]) - 2] - + if tipo_archivo is 1: + current_text = lines[i][10 : len(lines[i]) - 2] + else: + current_text = lines[i][4 : len(lines[i]) - 2] for j in range(30, len(current_text),30): current_text = current_text[:j] + '\n' + current_text[j:] - if archivo is 1: + if tipo_archivo is 1: current_id = lines[i][0 : 8] else: current_id = lines[i][0 : 2] -- cgit v0.9.1