Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
routersploit
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
czos-dpend
routersploit
Commits
46fc9ad1
Commit
46fc9ad1
authored
Aug 04, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extracting PrinterThread to separate module.
parent
f0fce106
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
18 deletions
+32
-18
interpreter.py
routersploit/interpreter.py
+1
-1
printer.py
routersploit/printer.py
+26
-0
threads.py
routersploit/threads.py
+4
-16
utils.py
routersploit/utils.py
+1
-1
No files found.
routersploit/interpreter.py
View file @
46fc9ad1
...
...
@@ -5,7 +5,7 @@ import itertools
import
traceback
import
atexit
from
routersploit.
threads
import
PrinterThread
,
printer_queue
from
routersploit.
printer
import
PrinterThread
,
printer_queue
from
routersploit.exceptions
import
RoutersploitException
from
routersploit.exploits
import
GLOBAL_OPTS
from
routersploit
import
utils
...
...
routersploit/printer.py
0 → 100644
View file @
46fc9ad1
from
__future__
import
print_function
from
__future__
import
absolute_import
import
threading
from
weakref
import
WeakKeyDictionary
try
:
import
queue
except
ImportError
:
import
Queue
as
queue
printer_queue
=
queue
.
Queue
()
thread_output_stream
=
WeakKeyDictionary
()
class
PrinterThread
(
threading
.
Thread
):
def
__init__
(
self
):
super
(
PrinterThread
,
self
)
.
__init__
()
self
.
daemon
=
True
def
run
(
self
):
while
True
:
content
,
sep
,
end
,
file_
,
thread
=
printer_queue
.
get
()
print
(
*
content
,
sep
=
sep
,
end
=
end
,
file
=
file_
)
printer_queue
.
task_done
()
routersploit/threads.py
View file @
46fc9ad1
from
__future__
import
print_function
from
__future__
import
absolute_import
import
threading
from
weakref
import
WeakKeyDictionary
import
time
try
:
import
queue
except
ImportError
:
import
Queue
as
queue
from
.
import
utils
data_queue
=
queue
.
Queue
()
printer_queue
=
queue
.
Queue
()
thread_output_stream
=
WeakKeyDictionary
()
data_queue
=
queue
.
Queue
()
class
DataProducerThread
(
threading
.
Thread
):
...
...
@@ -44,15 +44,3 @@ class WorkerThread(threading.Thread):
self
.
target
(
record
)
finally
:
data_queue
.
task_done
()
class
PrinterThread
(
threading
.
Thread
):
def
__init__
(
self
):
super
(
PrinterThread
,
self
)
.
__init__
()
self
.
daemon
=
True
def
run
(
self
):
while
True
:
content
,
sep
,
end
,
file_
,
thread
=
printer_queue
.
get
()
print
(
*
content
,
sep
=
sep
,
end
=
end
,
file
=
file_
)
printer_queue
.
task_done
()
routersploit/utils.py
View file @
46fc9ad1
...
...
@@ -18,7 +18,7 @@ from abc import ABCMeta, abstractmethod
import
requests
from
.
threads
import
printer_queue
,
thread_output_stream
from
.
printer
import
printer_queue
,
thread_output_stream
from
.exceptions
import
RoutersploitException
from
.
import
modules
as
rsf_modules
...
...
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