Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
7e51c5d5
Commit
7e51c5d5
authored
May 10, 2015
by
Ewan Klein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't pass parameter from tweets() method to Tweetviewer init.
Updated docstrings
parent
8505c04a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
nltk/twitter/twitterclient.py
+16
-7
No files found.
nltk/twitter/twitterclient.py
View file @
7e51c5d5
...
...
@@ -288,7 +288,7 @@ class Twitter(object):
:param str lang: language
"""
if
to_screen
:
handler
=
TweetViewer
(
limit
=
limit
,
date_limit
=
date_limit
,
stream
=
stream
)
handler
=
TweetViewer
(
limit
=
limit
,
date_limit
=
date_limit
)
else
:
handler
=
TweetWriter
(
limit
=
limit
,
date_limit
=
date_limit
,
stream
=
stream
,
repeat
=
False
)
...
...
@@ -311,6 +311,7 @@ class TweetViewer(TweetHandlerI):
"""
Handle data by sending it to the terminal.
"""
def
handle
(
self
,
data
):
"""
Direct data to `sys.stdout`
...
...
@@ -332,16 +333,24 @@ class TweetWriter(TweetHandlerI):
"""
Handle data by writing it to a file.
"""
def
__init__
(
self
,
limit
=
2000
,
date_limit
=
None
,
repeat
=
True
,
stream
=
True
,
fprefix
=
'tweets'
,
subdir
=
'twitter-files'
):
def
__init__
(
self
,
limit
=
2000
,
date_limit
=
None
,
repeat
=
True
,
stream
=
True
,
fprefix
=
'tweets'
,
subdir
=
'twitter-files'
):
"""
:param limit: number of data items to process in the current round of processing
:param int limit: number of data items to process in the current
\
round of processing
:param repeat: flag to determine whether multiple files should be
\
:param
bool
repeat: flag to determine whether multiple files should be
\
written. If ``True``, the length of each file will be set by the value
\
of ``limit``. See also :py:func:`handle`.
:param
:param bool stream: If ``True``, use the live public stream,
\
otherwise search past public tweets
:param str fprefix: The prefix to use in creating files for Tweet
\
collections
:param str subdir: |The name of the directory where Tweet collection
\
files should be stored
"""
self
.
repeat
=
repeat
...
...
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