Removed checkinep.py

This file is no longer necessary
Signed-off-by: default avatarRicardo Tavares de Oliveira <rto07@c3sl.ufpr.br>
parent 2d648da8
#!/usr/bin/env python
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-proinfodata
#
# le-proinfodata is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
""" This program checks whether a INEP number is valid or not, returning 0
if it is, and 1 otherwise."""
import sys
# Federal states code
fsc = [11, 12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 25, 26, 27,
28, 29, 31, 32, 33, 35, 41, 42, 43, 50, 51, 52, 53]
def checkinep(inep):
"""Verify whether a INEP number is valid or not """
try:
checksum = int(inep[-1])
schoolnum = int(inep[-6:-1])
fsccode = int(inep[-8:-6])
except:
return False
if fsccode in fsc and schoolnum >=1 and schoolnum % 11 == checksum:
return True
else:
return False
if len(sys.argv) != 2:
print "Usage:", sys.argv[0], "<INEP>"
sys.exit(1)
if checkinep(sys.argv[1]):
sys.exit(0)
else:
sys.exit(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment