# # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # author Salvo "LtWorf" Tomaselli <*****@*****.**> import urllib2 import urllib import datetime import re try: import json except: import simplejson json = simplejson.simplejson() try: from xtermcolor import colorize except: colorize = lambda x,rgb=None, ansi=None, bg=None, ansi_bg=None, fd=1: x def get_key(): ''' This function tries to load the API key from some configuration files. It will try, in the order: - /etc/pysttrafik.conf - ~/.pysttrafik If the files aren't found or they don't contain the key attribute then None will be returned, otherwise, a string containing the key will be
def __init__(self): self.jsonParser = simplejson()
def __init__(self): self.jsonParser = simplejson()