From cdaded1f639650037b97f500371ad383d4e3f490 Mon Sep 17 00:00:00 2001 From: Nagy Karoly Gabriel Date: Mon, 29 Mar 2010 12:26:27 +0300 Subject: [PATCH] ecn-robots: removed some superfluous strip()s from pgdb.py --- pgdb.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pgdb.py b/pgdb.py index 46f3e52..9d68c70 100644 --- a/pgdb.py +++ b/pgdb.py @@ -46,7 +46,7 @@ class Db(object): information['size'] = self._runsql("SELECT pg_size_pretty(pg_database_size('"+self._name+"'));").strip() information['encoding'], information['collation'], \ information['ctype'] = self._runsql("""SELECT pg_encoding_to_char(encoding), - datcollate, datctype FROM pg_database WHERE datname='"""+self._name+"';").strip().split('|') + datcollate, datctype FROM pg_database WHERE datname='"""+self._name+"';").split('|') return information @property @@ -57,14 +57,14 @@ class Db(object): def user_exists(self, user): sql = "SELECT rolname FROM pg_authid WHERE rolname = '"+user+"';" - u = self._runsql(sql).strip() + u = self._runsql(sql) if (u == ""): return False return True def db_exists(self, xdb): sql = "SELECT datname FROM pg_database WHERE datname = '"+xdb+"';" - d = self._runsql(sql).strip() + d = self._runsql(sql) if (d == ""): return False return True @@ -112,8 +112,8 @@ class Db(object): return usrlist def _test(): - #test = Db(u'postgres') - #print test.info['encoding'], test.info['collation'], test.info['ctype'] + test = Db(u'postgres') + print test.info['encoding'], test.info['collation'], test.info['ctype'] #print test.owner #print test.connections #print "User aaa is ",test.user_exists("aaa") @@ -130,9 +130,9 @@ def _test(): #print test2.owner #test2.owner = u'karasz' #print test2.owner - test = Db(u'aaa') - test.create(u'postgres', u'en_US.UTF-8', u'en_US.UTF-8') - print test.dump('/tmp/aaa.gz',u'p') + #test = Db(u'aaa') + #test.create(u'postgres', u'en_US.UTF-8', u'en_US.UTF-8') + #print test.dump('/tmp/aaa.gz',u'p') #test.delete() if __name__ == '__main__': _test()