This commit is contained in:
Marc Aymerich 2014-12-22 11:40:02 +00:00
parent f3551bb13e
commit 1fe98f434d
3 changed files with 34 additions and 19 deletions

12
TODO.md
View File

@ -172,6 +172,8 @@
* Webapp options and type compatibility
* SaaS model splitted into SaaSUser and SaaSSite?
Multi-tenant WebApps
--------------------
* SaaS - Those apps that can't use custom domain
@ -179,5 +181,13 @@ Multi-tenant WebApps
* Howto upgrade webapp PHP version? <FilesMatch \.php$> SetHandler php54-cgi</FilesMatch> ? or create a new app
* prevent @pangea.org email addresses on contacts
* fcgid kill instead of apache reload?
* chomod user:group
* username maximum as group user in UNIX

View File

@ -64,7 +64,7 @@ class SendEmail(object):
return render(request, self.template, self.context)
def get_queryset_emails(self):
return self.queryset.value_list('email', flat=True)
return self.queryset.values_list('email', flat=True)
def confirm_email(self, request, **options):
email_from = options['email_from']

View File

@ -61,30 +61,35 @@ def runiterator(command, display=False, error_codes=[0], silent=False, stdin='')
make_async(p.stdout)
make_async(p.stderr)
stdout = unicode()
stderr = unicode()
# Async reading of stdout and sterr
while True:
# Wait for data to become available
select.select([p.stdout, p.stderr], [], [])
# TODO https://github.com/isagalaev/ijson/issues/15
stdout = unicode()
sdterr = unicode()
# Get complete unicode chunks
while True:
select.select([p.stdout, p.stderr], [], [])
stdoutPiece = read_async(p.stdout)
stderrPiece = read_async(p.stderr)
try:
stdout += stdoutPiece.decode("utf8")
sdterr += stderrPiece.decode("utf8")
except UnicodeDecodeError:
pass
else:
break
# Try reading some data from each
stdoutPiece = read_async(p.stdout)
stderrPiece = read_async(p.stderr)
if display and stdoutPiece:
sys.stdout.write(stdoutPiece)
if display and stdout:
sys.stdout.write(stdout)
if display and stderrPiece:
sys.stderr.write(stderrPiece)
sys.stderr.write(stderr)
return_code = p.poll()
state = _AttributeUnicode(stdoutPiece.decode("utf8"))
state.stderr = stderrPiece.decode("utf8")
state.return_code = return_code
state = _AttributeUnicode(stdout)
state.stderr = sdterr
state.return_code = p.poll()
yield state
if return_code != None:
if state.return_code != None:
p.stdout.close()
p.stderr.close()
raise StopIteration