Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
da8fd096
Commit
da8fd096
authored
11 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
improved csv parsing from memory
parent
52f76158
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
helios/models.py
+3
-3
3 additions, 3 deletions
helios/models.py
with
3 additions
and
3 deletions
helios/models.py
+
3
−
3
View file @
da8fd096
...
@@ -11,7 +11,7 @@ from django.utils import simplejson
...
@@ -11,7 +11,7 @@ from django.utils import simplejson
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.mail
import
send_mail
from
django.core.mail
import
send_mail
import
datetime
,
logging
,
uuid
,
random
,
StringIO
import
datetime
,
logging
,
uuid
,
random
,
StringIO
,
io
from
crypto
import
electionalgs
,
algs
,
utils
from
crypto
import
electionalgs
,
algs
,
utils
from
helios
import
utils
as
heliosutils
from
helios
import
utils
as
heliosutils
...
@@ -653,7 +653,7 @@ class VoterFile(models.Model):
...
@@ -653,7 +653,7 @@ class VoterFile(models.Model):
def
itervoters
(
self
):
def
itervoters
(
self
):
if
self
.
voter_file_content
:
if
self
.
voter_file_content
:
voter_stream
=
StringIO
.
StringIO
(
self
.
voter_file_content
)
voter_stream
=
io
.
StringIO
(
self
.
voter_file_content
,
newline
=
None
)
else
:
else
:
voter_stream
=
open
(
self
.
voter_file
.
path
,
"
rU
"
)
voter_stream
=
open
(
self
.
voter_file
.
path
,
"
rU
"
)
...
@@ -683,7 +683,7 @@ class VoterFile(models.Model):
...
@@ -683,7 +683,7 @@ class VoterFile(models.Model):
# now we're looking straight at the content
# now we're looking straight at the content
if
self
.
voter_file_content
:
if
self
.
voter_file_content
:
voter_stream
=
StringIO
.
StringIO
(
self
.
voter_file_content
.
encode
(
'
utf-8
'
))
voter_stream
=
io
.
StringIO
(
self
.
voter_file_content
.
encode
(
'
utf-8
'
)
,
newline
=
None
)
else
:
else
:
voter_stream
=
open
(
self
.
voter_file
.
path
,
"
rU
"
)
voter_stream
=
open
(
self
.
voter_file
.
path
,
"
rU
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment