Browse Source

Cort on IRC ran into a few problems and we discovered that,

<slicer> From DBus 1.2.<something> on, you HAVE to set the interface in function calls, or it will be denied.
He was so kind as to send me a patch, which I now applied.
Natenom/support-murmur-13-1446181288462
root 16 years ago
parent
commit
99bac3f6d9
  1. 4
      pyweb/mumble/mmobjects.py
  2. 6
      pyweb/mumble/models.py
  3. 26
      template/mumble/content.htm

4
pyweb/mumble/mmobjects.py

@ -228,7 +228,7 @@ if __name__ == '__main__':
# get our murmur servers # get our murmur servers
dbus_base = 'net.sourceforge.mumble.murmur'; dbus_base = 'net.sourceforge.mumble.murmur';
murmur = bus.get_object( dbus_base, '/' );
murmur = dbus.Interface( bus.get_object( dbus_base, '/' ), 'net.sourceforge.mumble.Meta')
# example callback # example callback
def travrz( obj, lvl ): def travrz( obj, lvl ):
@ -236,7 +236,7 @@ if __name__ == '__main__':
# show each server # show each server
for srv in murmur.getBootedServers(): for srv in murmur.getBootedServers():
theSrv = bus.get_object( dbus_base, '/%d' % srv );
theSrv = dbus.Interface( bus.get_object( dbus_base, '/%d' % self.srvid ), 'net.sourceforge.mumble.Murmur' );
srvobj = mmServer( srv, theSrv, 'teh %d srvz root' % srv ); srvobj = mmServer( srv, theSrv, 'teh %d srvz root' % srv );
srvobj.visit( travrz ); srvobj.visit( travrz );

6
pyweb/mumble/models.py

@ -55,17 +55,17 @@ class Mumble( models.Model ):
booted = models.BooleanField( 'Boot Server', default = True ); booted = models.BooleanField( 'Boot Server', default = True );
def getDbusMeta( self ): def getDbusMeta( self ):
return dbus.SystemBus().get_object( self.dbus, '/' );
return dbus.Interface( dbus.SystemBus().get_object( self.dbus, '/' ), 'net.sourceforge.mumble.Meta' );
def getDbusObject( self ): def getDbusObject( self ):
"Connects to DBus and returns an mmServer object representing this Murmur instance." "Connects to DBus and returns an mmServer object representing this Murmur instance."
bus = dbus.SystemBus(); bus = dbus.SystemBus();
murmur = bus.get_object( self.dbus, '/' );
murmur = dbus.Interface( bus.get_object( self.dbus, '/' ), 'net.sourceforge.mumble.Meta')
if self.srvid not in murmur.getBootedServers(): if self.srvid not in murmur.getBootedServers():
raise Exception, 'No murmur process with the given server ID (%d) is running and attached to system dbus under %s.' % ( self.srvid, self.dbus ); raise Exception, 'No murmur process with the given server ID (%d) is running and attached to system dbus under %s.' % ( self.srvid, self.dbus );
return bus.get_object( self.dbus, '/%d' % self.srvid );
return dbus.Interface( bus.get_object( self.dbus, '/%d' % self.srvid ), 'net.sourceforge.mumble.Murmur' );
def getServerObject( self ): def getServerObject( self ):
return mmServer( self.srvid, self.getDbusObject(), self.name ); return mmServer( self.srvid, self.getDbusObject(), self.name );

26
template/mumble/content.htm

@ -10,6 +10,10 @@
{% for item in ChannelTable %} {% for item in ChannelTable %}
<tr> <tr>
<td class="mumble mm-left"> <td class="mumble mm-left">
<span
class="mumble_{%if item.1.is_channel%}channel{%else%}{%if item.1.is_player%}player{%endif%}{%endif%}"
title="{{ item.1.name }} - Online since {{item.1.onlinesince|time:"H:i"}}&lt;br /&gt;&lt;a href=&quot;/accounts/profiles/{{item.1.mumbleuser.owner.id}}&quot;&gt;{{item.1.mumbleuser.owner}}&lt;/a&gt;"
>
{% spaceless %} {% spaceless %}
{% for num in item.0|mrange %} {% for num in item.0|mrange %}
<img src="/static/mumble/linie_v_trans.png" alt="|" /> <img src="/static/mumble/linie_v_trans.png" alt="|" />
@ -17,16 +21,17 @@
<img src="/static/mumble/knoten_v_trans.png" alt="+-" /> <img src="/static/mumble/knoten_v_trans.png" alt="+-" />
{% endspaceless %} {% endspaceless %}
{% if item.1.userid %} {% if item.1.userid %}
<img src="/static/mumble/talking_off.png" alt="player" title="Player" />
<span title="Online since {{item.1.onlinesince|time:"H:i"}}">{{ item.1.name }}</span>
<img src="/static/mumble/talking_off.png" alt="player" />
{{ item.1.name }}
{% else %} {% else %}
{% if item.1.linked %} {% if item.1.linked %}
<img src="/static/mumble/channel_linked.png" alt="linked channel" title="Channel with links" />
<img src="/static/mumble/channel_linked.png" alt="linked channel"/>
{% else %} {% else %}
<img src="/static/mumble/channel.png" alt="channel" title="Channel" />
<img src="/static/mumble/channel.png" alt="channel"/>
{% endif %} {% endif %}
<a href="mumble://{% if mumbleAccount %}{{ mumbleAccount.name }}@{% endif %}{{ DBaseObject.addr }}/{% for chan in item.2 %}{{ chan|urlencode }}/{% endfor %}{{ item.1.name|urlencode }}" class="dingen">{{ item.1.name }}</a> <a href="mumble://{% if mumbleAccount %}{{ mumbleAccount.name }}@{% endif %}{{ DBaseObject.addr }}/{% for chan in item.2 %}{{ chan|urlencode }}/{% endfor %}{{ item.1.name|urlencode }}" class="dingen">{{ item.1.name }}</a>
{% endif %} {% endif %}
</span>
</td> </td>
<td class="mumble"> <td class="mumble">
{% if item.1.userid %} {% if item.1.userid %}
@ -52,3 +57,16 @@
</table> </table>
<p><a href="/mumble/reg/{{DBaseObject.id}}" class="dingen">Mumble-Account verwalten</a></p> <p><a href="/mumble/reg/{{DBaseObject.id}}" class="dingen">Mumble-Account verwalten</a></p>
</div> </div>
<script type="text/javascript">
$( "span.mumble_player" ).tooltip({
track: false,
delay: 0,
showURL: false,
opacity: 1,
fixPNG: true,
showBody: " - ",
extraClass: "pretty",
top: -15,
left: 5
});
</script>
Loading…
Cancel
Save