try:
    import ConfigParser as configparser
except ImportError:
    import configparser

from .config import DumpyConfig

class DumpyReader(object):

    def __init__(self):
        self.dumpyfile = DumpyConfig.verify_dumpy_file()
        self.configp = configparser.ConfigParser()
        self.expected_keys = ['project', 'host', 'user', 'db', 'db_name']

    def add_section_project(self, **infos):
        """Add new project with infos in dumpyfile"""
        for exp_k in self.expected_keys:
            if exp_k not in infos:
                return False

        psection = infos["project"]
        del infos["project"]

        self.configp.add_section(psection)

        for key, val in infos.items():
            self.configp.set(psection, key, val)

        with open(self.dumpyfile, 'a') as dumpyfile:
            self.configp.write(dumpyfile)

        return True

    def remove_section_project(self, project):
        self.configp.read(self.dumpyfile)

        result = self.configp.remove_section(project)

        if result:
            with open(self.dumpyfile, 'w') as dumpyfile:
                self.configp.write(dumpyfile)

            return result

    def section_infos(self, project):
        """Return info of project"""
        dsection = {}
        config = self.configp.read(self.dumpyfile)
        infos = config.options(project)

        for info in infos:
            try:
                dsection[info] = config.get(project, info)

                if dsection[info] == -1:
                    pass
            except:
                dsection[info] = None
        return dsection

@@ -910,32 +910,76 @@
 self, project):%0A
+        %22%22%22Remove project from dumpyfile%22%22%22%0A
         self.con
@@ -1270,16 +1270,24 @@
 urn info
+rmations
  of proj
@@ -1289,16 +1289,31 @@
  project
+ from dumpyfile
 %22%22%22%0A    
@@ -1397,22 +1397,28 @@
 infos = 
+self.
 config
+p
 .options
@@ -1505,22 +1505,28 @@
 info%5D = 
+self.
 config
+p
 .get(pro
@@ -1537,17 +1537,16 @@
 , info)%0A
-%0A
         
@@ -1661,16 +1661,17 @@
  = None%0A
+%0A
         

fix bug