Commit 011e76d1 authored by Bruno Laurencich's avatar Bruno Laurencich

mDNS resolve with python-dns

parent f404be37
[submodule "dnspython"]
path = dnspython
url = git://github.com/rthalley/dnspython.git
bl_info = {
"name": "Test_addon",
"category": "Object",
"name": "Test_addon",
"category": "Object",
}
# To support reload properly, try to access a package var,
# if it's there, reload everything
if "bpy" in locals():
import imp
# imp.reload(mycube)
# imp.reload(mysphere)
# imp.reload(mycylinder)
# print("Reloaded multifiles")
import imp
# imp.reload(mysphere)
else:
pass
# from . import mycube, mysphere, mycylinder
pass
# from . import mysphere
import bpy
from python-zeroconf import zeroconf
from sys import path
from os.path import join, abspath, dirname
path.append(join(dirname(abspath(__file__)), "dnspython"))
from dns.resolver import Resolver
import bpy
class Zeroconf_Explore(bpy.types.Operator):
"""TODO Add description"""
bl_idname = "object.test_addon"
bl_label = "Test Addon"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
print("test addon.")
return {'FINISHED'}
"""TODO Add description"""
bl_idname = "object.test_addon"
bl_label = "Test Addon"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
myRes=Resolver()
myRes.nameservers=['224.0.0.251'] #mdns multicast address
myRes.port=5353 #mdns port
a=myRes.query('raspberrypi.local','A')
print( "FOUND IP:)",a[0].to_text())
# print("test addon.")
return {'FINISHED'}
def register():
bpy.utils.register_class(Zeroconf_Explore)
bpy.utils.register_class(Zeroconf_Explore)
def unregister():
bpy.utils.unregister_class(Zeroconf_Explore)
bpy.utils.unregister_class(Zeroconf_Explore)
if __name__ == "__main__":
register()
\ No newline at end of file
register()
Subproject commit fed4e0c5371ed513dbc2d4ad477ce1bd1c940114
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment