/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/postgisdb.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/postgisdb.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1605 by bh, Tue Aug 19 11:00:40 2003 UTC revision 1620 by bh, Wed Aug 20 13:14:22 2003 UTC
# Line 48  class PostGISConnection: Line 48  class PostGISConnection:
48          self.user = user          self.user = user
49          self.password = password          self.password = password
50          self.dbtype = dbtype          self.dbtype = dbtype
51            self.connect()
52    
53        def connect(self):
54            """Internal: Establish the database connection"""
55          params = []          params = []
56          for name in ("host", "port", "dbname", "user", "password"):          for name in ("host", "port", "dbname", "user", "password"):
57              val = getattr(self, name)              val = getattr(self, name)
# Line 67  class PostGISConnection: Line 71  class PostGISConnection:
71          else:          else:
72              raise ValueError("Can't determine postgres type of geometries")              raise ValueError("Can't determine postgres type of geometries")
73    
74        def BriefDescription(self):
75            """Return a brief, one-line description of the connection
76    
77            The return value is suitable for a list box of all database
78            connections.
79            """
80            return ("postgis://%(user)s@%(host)s:%(port)s/%(dbname)s"
81                    % self.__dict__)
82    
83      def Close(self):      def Close(self):
84          """Close the database connection"""          """Close the database connection"""
85          self.connection.close()          self.connection.close()

Legend:
Removed from v.1605  
changed lines
  Added in v.1620

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26