| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Mon, 10 Mar 2014 14:10:43 +0100 | |
| changeset 1078 | 263d6f313055 |
| parent 957 | e4d0094f097b |
| child 1496 | 184372ec27e2 |
| permissions | -rw-r--r-- |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
1 |
#from models import setup_database |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
2 |
from iri_tweet.models import setup_database, TweetSource, Tweet, TweetLog |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
3 |
from iri_tweet.processor import TwitterProcessorStatus |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
4 |
from iri_tweet.utils import get_oauth_token, show_progress |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
5 |
import anyjson |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
6 |
import argparse |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
7 |
import codecs |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
8 |
import logging |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
9 |
import re |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
10 |
import sys |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
11 |
|
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
12 |
logger = logging.getLogger(__name__) |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
13 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
14 |
def get_option(): |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
15 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
16 |
parser = argparse.ArgumentParser(description='Merge tweets databases') |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
17 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
18 |
parser.add_argument("-l", "--log", dest="logfile", |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
19 |
help="log to file", metavar="LOG", default="stderr") |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
20 |
parser.add_argument("-v", dest="verbose", action="count", |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
21 |
help="verbose", default=0) |
|
957
e4d0094f097b
upgrade virtualenv + script
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
888
diff
changeset
|
22 |
parser.add_argument("-k", "--key", dest="consumer_key", |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
23 |
help="Twitter consumer key", metavar="CONSUMER_KEY") |
|
957
e4d0094f097b
upgrade virtualenv + script
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
888
diff
changeset
|
24 |
parser.add_argument("-s", "--secret", dest="consumer_secret", |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
25 |
help="Twitter consumer secret", metavar="CONSUMER_SECRET") |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
26 |
parser.add_argument("-q", dest="quiet", action="count", |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
27 |
help="quiet", default=0) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
28 |
parser.add_argument("--query-user", dest="query_user", action="store_true", |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
29 |
help="Query twitter for user information", default=False) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
30 |
parser.add_argument("-t", dest="token_filename", metavar="TOKEN_FILENAME", default=".oauth_token", |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
31 |
help="Token file name") |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
32 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
33 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
34 |
parser.add_argument("source", action="store", nargs=1, type=str, metavar="SOURCE") |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
35 |
parser.add_argument("target", action="store", nargs=1, type=str, metavar="TARGET") |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
36 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
37 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
38 |
return parser.parse_args() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
39 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
40 |
if __name__ == "__main__": |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
41 |
|
|
957
e4d0094f097b
upgrade virtualenv + script
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
888
diff
changeset
|
42 |
#sys.stdout = codecs.getwriter(sys.stdout.encoding)(sys.stdout) |
|
e4d0094f097b
upgrade virtualenv + script
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
888
diff
changeset
|
43 |
writer = None |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
44 |
options = get_option() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
45 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
46 |
access_token = None |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
47 |
if options.query_user: |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
48 |
access_token = get_oauth_token(options.consumer_key, options.consumer_secret, options.token_filename) |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
49 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
50 |
#open source |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
51 |
src_conn_str = options.source[0].strip() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
52 |
if not re.match("^\w+://.+", src_conn_str): |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
53 |
src_conn_str = 'sqlite:///' + src_conn_str |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
54 |
tgt_conn_str = options.target[0].strip() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
55 |
if not re.match("^\w+://.+", tgt_conn_str): |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
56 |
tgt_conn_str = 'sqlite:///' + tgt_conn_str |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
57 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
58 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
59 |
engine_src, metadata_src, Session_src = setup_database(src_conn_str, echo=((options.verbose-options.quiet)>0), create_all = False) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
60 |
engine_tgt, metadata_tgt, Session_tgt = setup_database(tgt_conn_str, echo=((options.verbose-options.quiet)>0), create_all = False) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
61 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
62 |
conn_src = conn_tgt = session_src = session_tgt = None |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
63 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
64 |
try: |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
65 |
#conn_src = engine_src.connect() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
66 |
#conn_tgt = engine_tgt.connect() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
67 |
session_src = Session_src() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
68 |
session_tgt = Session_tgt() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
69 |
|
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
70 |
count_tw_query = Tweet.__table__.count() # @UndefinedVariable |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
71 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
72 |
count_tw = engine_src.scalar(count_tw_query) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
73 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
74 |
if count_tw == 0: |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
75 |
print "No tweet to process : exit" |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
76 |
sys.exit() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
77 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
78 |
query_src = session_src.query(Tweet).join(TweetSource).yield_per(100) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
79 |
added = 0 |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
80 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
81 |
for i,tweet in enumerate(query_src): |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
82 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
83 |
tweet_count = session_tgt.query(Tweet).filter(Tweet.id == tweet.id).count() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
84 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
85 |
progress_text = u"Process: " |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
86 |
if tweet_count == 0: |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
87 |
added += 1 |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
88 |
progress_text = u"Adding : " |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
89 |
tweet_source = tweet.tweet_source.original_json |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
90 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
91 |
tweet_obj = anyjson.deserialize(tweet_source) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
92 |
if 'text' not in tweet_obj: |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
93 |
tweet_log = TweetLog(tweet_source_id=tweet.tweet_source.id, status=TweetLog.TWEET_STATUS['NOT_TWEET']) |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
94 |
session_tgt.add(tweet_log) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
95 |
else: |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
96 |
tp = TwitterProcessorStatus(None, tweet_source, None, session_tgt, access_token, options.token_filename, user_query_twitter=options.query_user, logger=logger) |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
97 |
tp.process() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
98 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
99 |
session_tgt.flush() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
100 |
|
|
693
2ef837069108
Starting 'listener_update' branch
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
464
diff
changeset
|
101 |
ptext = progress_text + tweet.text |
|
957
e4d0094f097b
upgrade virtualenv + script
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
888
diff
changeset
|
102 |
writer = show_progress(i+1, count_tw, ptext.replace("\n",""), 70, writer) |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
103 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
104 |
session_tgt.commit() |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
105 |
print u"%d new tweet added" % (added) |
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
106 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
107 |
finally: |
|
888
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
108 |
if session_tgt is not None: |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
109 |
session_tgt.close() |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
110 |
if session_src is not None: |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
111 |
session_src.close() |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
112 |
if conn_tgt is not None: |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
113 |
conn_tgt.close() |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
114 |
if conn_src is not None: |
|
6fc6637d8403
update listener. add support for twitter regulation messages. update virtualenv
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
886
diff
changeset
|
115 |
conn_src.close() |
|
464
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
116 |
|
|
b9243ade95e2
code cleaning and reorganisation for scripts
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
117 |