Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
insights
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
insights
Commits
9f3b13e1
Commit
9f3b13e1
authored
Dec 10, 2013
by
Gabe Mulley
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from mulby/gabe-datajam-modify-playback
datajam: allow playback of entire files
parents
c56ac6dd
1223fd6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
41 deletions
+2
-41
playback.py
+2
-41
No files found.
playback.py
View file @
9f3b13e1
...
...
@@ -3,49 +3,10 @@ import sys
logging
.
handlers
.
HTTPHandler
(
''
,
''
,
method
=
'GET'
)
logger
=
logging
.
getLogger
(
'simple_example'
)
http_handler
=
logging
.
handlers
.
HTTPHandler
(
'127.0.0.1:
9022'
,
'/
event'
,
method
=
'GET'
)
http_handler
=
logging
.
handlers
.
HTTPHandler
(
'127.0.0.1:
8002'
,
'/http
event'
,
method
=
'GET'
)
logger
.
addHandler
(
http_handler
)
#logger.setLevel(logging.DEBUG)
f
=
open
(
sys
.
argv
[
1
])
for
i
in
range
(
10
):
line
=
f
.
readline
()
print
line
for
line
in
f
:
logger
.
critical
(
line
)
## For reference, the exert of the relevant Python logger
# import errno, logging, socket, os, pickle, struct, time, re
# from codecs import BOM_UTF8
# from stat import ST_DEV, ST_INO, ST_MTIME
# import queue
# try:
# import threading
# except ImportError: #pragma: no cover
# threading = None
# import http.client, urllib.parse
# port = 9022
# method = "GET"
# host = "127.0.0.1"
# url = "/"
# h = http.client.HTTPConnection(host)
# url = url + "?%s" % (sep, data)
# for item in lines:
# data = urllib.parse.urlencode(record)
# h.putrequest(method, url)
# h.putheader("Host", host)
# if method == "POST":
# h.putheader("Content-type",
# "application/x-www-form-urlencoded")
# h.putheader("Content-length", str(len(data)))
# h.send(data.encode('utf-8'))
# h.getresponse() #can't do anything with the result
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