Changeset 22f92f5 in osmose-backend


Ignore:
Timestamp:
Mar 10, 2013 5:22:36 PM (7 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
a910761
Parents:
b4fca9b
git-author:
Frédéric Rodrigo <frodrigo@…> (10/03/2013 16:41:11)
git-committer:
Frédéric Rodrigo <frodrigo@…> (10/03/2013 17:22:36)
Message:

Remove hard dependency to osmose db schema

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser_Merge.py

    rb4fca9b r22f92f5  
    4444    * 
    4545FROM 
    46     osmose.%(table)s 
     46    %(table)s 
    4747WHERE 
    4848    %(x)s IS NOT NULL AND 
     
    5959    * 
    6060FROM 
    61     osmose.%(table)s 
     61    %(table)s 
    6262WHERE 
    6363    %(x)s IS NOT NULL AND 
     
    270270        def setDataTrue(): 
    271271            self.data=True 
    272         self.run0("SELECT * FROM osmose.meta WHERE name='%s' AND update=%s" % (self.sourceTable, time), lambda res: setDataTrue()) 
     272        self.run0("SELECT * FROM meta WHERE name='%s' AND update=%s" % (self.sourceTable, time), lambda res: setDataTrue()) 
    273273        if not self.data: 
    274274            self.logger.log(u"Load CSV into database") 
    275             self.run("DROP TABLE IF EXISTS osmose.%s" % self.sourceTable) 
    276             self.run("CREATE TABLE osmose.%s (%s)" % (self.sourceTable, self.create_table)) 
     275            self.run("DROP TABLE IF EXISTS %s" % self.sourceTable) 
     276            self.run("CREATE TABLE %s (%s)" % (self.sourceTable, self.create_table)) 
    277277            f = io.StringIO(self.csv_filter(bz2.BZ2File(self.csv_file+".bz2").read().decode(self.csv_encoding))) 
    278278            f.seek(0) 
    279             self.giscurs.copy_expert("COPY osmose.%s FROM STDIN %s" % (self.sourceTable, self.csv_format), f) 
    280  
    281             self.run("DELETE FROM osmose.meta WHERE name LIKE '%s%%'" % self.sourceTable) 
    282             self.run("INSERT INTO osmose.meta VALUES ('%s', %s, NULL)" % (self.sourceTable, time)) 
     279            self.giscurs.copy_expert("COPY %s FROM STDIN %s" % (self.sourceTable, self.csv_format), f) 
     280 
     281            self.run("DELETE FROM meta WHERE name LIKE '%s%%'" % self.sourceTable) 
     282            self.run("INSERT INTO meta VALUES ('%s', %s, NULL)" % (self.sourceTable, time)) 
    283283            self.run0("COMMIT") 
    284284            self.run0("BEGIN") 
     
    289289        def setDataTrue(res): 
    290290            self.data=res 
    291         self.run0("SELECT bbox FROM osmose.meta WHERE name='%s'" % tableOfficial, lambda res: setDataTrue(res)) 
     291        self.run0("SELECT bbox FROM meta WHERE name='%s'" % tableOfficial, lambda res: setDataTrue(res)) 
    292292        if not self.data: 
    293293            self.run(sql00 % {"official": tableOfficial}) 
     
    306306            self.run(sql03 % {"official": tableOfficial}) 
    307307 
    308             self.run("DELETE FROM osmose.meta WHERE name='%s'" % tableOfficial) 
    309             self.run("INSERT INTO osmose.meta VALUES ('%s', NULL, '%s')" % (tableOfficial, bbox)) 
     308            self.run("DELETE FROM meta WHERE name='%s'" % tableOfficial) 
     309            self.run("INSERT INTO meta VALUES ('%s', NULL, '%s')" % (tableOfficial, bbox)) 
    310310            self.run0("COMMIT") 
    311311            self.run0("BEGIN") 
  • osmose_config.py

    r998372a r22f92f5  
    247247france_local_db.db_user     = "osmose" 
    248248france_local_db.db_password = "clostAdtoi" 
    249 france_local_db.db_schema   = "osmose,osmosis" 
     249france_local_db.db_schema   = "\"$user\",osmosis" 
    250250 
    251251france_local_db.analyser["merge_merimee"] = "xxx" 
Note: See TracChangeset for help on using the changeset viewer.