Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hacksaar
Sphinx
Commits
960dd08b
Commit
960dd08b
authored
Oct 25, 2013
by
Constantin
Browse files
concept space api
parent
91c34513
Changes
1
Hide whitespace changes
Inline
Side-by-side
concept_spaceapi.py
0 → 100644
View file @
960dd08b
class
SpaceApi
:
__init__
(
self
):
self
.
state_to_set
=
None
# public write, TODO: getters, setters?
self
.
state_last_set
=
None
# public read
self
.
_running
=
True
self
.
_t
=
threading
.
Thread
(
target
=
self
.
loop
)
_t
.
start
()
def
stop
(
self
):
self
.
_running
=
False
def
loop
(
self
):
while
self
.
_running
:
if
(
self
.
state_to_set
is
not
None
):
if
self
.
state_to_set
!=
self
.
state_last_set
:
stts
=
self
.
state_to_set
# cache for parallelism
error
=
do_request
(
stts
)
# TODO
#TODO logging
if
not
error
:
self
.
state_last_set
=
stts
#TODO logging
time
.
sleep
(
SPACE_API_LOOP_DELAY
)
\ No newline at end of file
Write
Preview
Supports
Markdown
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