Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
e2d401b5
Commit
e2d401b5
authored
Apr 16, 2014
by
marianitadn
Browse files
Raise error if locations list has the wrong length
parent
d626a964
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
e2d401b5
...
...
@@ -254,7 +254,9 @@ class Stream(object):
if
replies
:
self
.
parameters
[
'replies'
]
=
replies
if
locations
and
len
(
locations
)
>
0
:
assert
len
(
locations
)
%
4
==
0
if
len
(
locations
)
%
4
!=
0
:
raise
TweepError
(
"Wrong number of locations points, "
"it has to be a multiple of 4"
)
self
.
parameters
[
'locations'
]
=
','
.
join
([
'%.2f'
%
l
for
l
in
locations
])
if
track
:
encoded_track
=
[
s
.
encode
(
encoding
)
for
s
in
track
]
...
...
@@ -301,7 +303,9 @@ class Stream(object):
encoded_track
=
[
s
.
encode
(
encoding
)
for
s
in
track
]
self
.
parameters
[
'track'
]
=
','
.
join
(
encoded_track
)
if
locations
and
len
(
locations
)
>
0
:
assert
len
(
locations
)
%
4
==
0
if
len
(
locations
)
%
4
!=
0
:
raise
TweepError
(
"Wrong number of locations points, "
"it has to be a multiple of 4"
)
self
.
parameters
[
'locations'
]
=
','
.
join
([
'%.4f'
%
l
for
l
in
locations
])
if
stall_warnings
:
self
.
parameters
[
'stall_warnings'
]
=
stall_warnings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment