#!/usr/bin/python

import sys , os
from urlparse import urlparse
from urlparse import urlunparse
from ConfigParser import ConfigParser
cfg = ConfigParser()

if os.path.exists("config.ini"):
	cfg.read("config.ini")
else:
	raise ConfigFileNotExist

CFG = {}

for sections in cfg.sections():
	CFG[sections] = {}
	for keys , data in cfg.items(sections):
		CFG[sections][keys] = data
tmptpl = urlparse(CFG["ZBINFO"]["url"])
BASEURL = urlunparse((tmptpl[0] , tmptpl[1] , os.path.dirname(tmptpl[2]),'','',''))
CFG["BASEURL"] = BASEURL
