3 from board
import Board
4 from plugins
.wakaba_thread
import WakabaThread
9 INTERFACE
= 'py.chans.dbus'
11 class MetaBoard(Board
):
12 """Wakaba board class."""
14 def __init__(self
, bus_name
, obj_path
, name
, base_uri
):
15 Board
.__init
__(self
, bus_name
, obj_path
, name
, base_uri
)
17 #TODO: _normal_ parsing needs
18 @dbus.service
.method(dbus_interface
=INTERFACE
, in_signature
='', out_signature
='')
20 """Parsing board threads."""
22 def get_threads_ids():
23 data
= urllib
.urlopen(self
.board_uri
).read()
24 threads
= re
.findall('<hr />.*?<a name="([0-9]+)"', data
)
27 threads_ids
= get_threads_ids()
28 for thread_id
in threads_ids
:
29 if not thread_id
in self
.get_threads():
30 self
.threads
.append( WakabaThread(bus_name
=self
.bus_name
, obj_path
=self
.obj_path
+'/'+ thread_id
, board
=self
, id=thread_id
) )