[Python-modules-commits] [forgetsql] 01/06: unapply patches from master
Mattia Rizzolo
mattia at mapreri.org
Sun Dec 13 14:56:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository forgetsql.
commit ac87a3f83e33882bade1f09c107f7828de33bc5b
Author: Mattia Rizzolo <mattia at debian.org>
Date: Sun Dec 13 14:18:50 2015 +0000
unapply patches from master
---
bin/forgetsql-generate | 13 +++----------
lib/forgetSQL.py | 13 ++++++-------
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/bin/forgetsql-generate b/bin/forgetsql-generate
index 3452a81..9d80afb 100755
--- a/bin/forgetsql-generate
+++ b/bin/forgetsql-generate
@@ -193,7 +193,7 @@ stdin or as a file using option --tables."""
if options.output:
try:
# Override print.. dirty.
- sys.stdout = open(options.output, "w")
+ sys.stdout = open(output, "w")
except IOError, e:
print >>sys.stderr, "%s: %s" % (e.strerror, e.filename)
sys.exit(3)
@@ -220,10 +220,7 @@ stdin or as a file using option --tables."""
else:
params = {}
if options.database:
- if options.dbmodule == "MySQLdb":
- params['db'] = options.database
- else:
- params['database'] = options.database
+ params['database'] = options.database
else:
print >>sys.stderr, "Missing required option --database or --connect"
sys.exit(7)
@@ -232,11 +229,7 @@ stdin or as a file using option --tables."""
if options.username:
params['user'] = options.username
if options.password:
- if options.dbmodule == "MySQLdb":
- params['passwd'] = options.password
- else:
- params['password'] = options.password
-
+ params['password'] = options.password
connectstring = ", ".join(["%s=%r" % (key, value)
for (key,value) in params.items()
# filter out password for 'security reasons'
diff --git a/lib/forgetSQL.py b/lib/forgetSQL.py
index df54cdb..0ce8bea 100755
--- a/lib/forgetSQL.py
+++ b/lib/forgetSQL.py
@@ -1,4 +1,5 @@
-#-*- coding: iso-8859-1 -*-
+#!/usr/bin/env python
+
__version__ = "0.5.1"
## Distributed under LGPL
@@ -209,18 +210,18 @@ class Forgetter(object):
try: # to implement 'goto' in Python.. UGH
if not cls._cache.has_key(args):
# unknown
- raise NotFound
+ raise "NotFound"
(ref, updated) = cls._cache[args]
realObject = ref()
if realObject is None:
# No more real references to it, dead object
- raise NotFound
+ raise "NotFound"
age = time.time() - updated
if age > cls._timeout:
# Too old!
- raise NotFound
+ raise "NotFound"
updated = time.time()
- except NotFound:
+ except "NotFound":
# We'll need to create it
realObject = object.__new__(cls, *args)
ref = weakref.ref(realObject)
@@ -666,8 +667,6 @@ My fields: %s""" % (selectfields, cls._sqlFields)
# cursor.commit()
cursor.close()
self._new = False
- # Make sure we don't think we're still modified after a save
- self._changed = None
def getAll(cls, where=None, orderBy=None):
"""Retrieves all the objects, possibly matching
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/forgetsql.git
More information about the Python-modules-commits
mailing list