Erster Commit: nativer Linux-Port aus macOS-Bytecode
Läuft die Voice Acoustic VA-Remotecontrol (AllDSP AllControl) nativ unter Linux auf echtem wxGTK 3.0 — ohne Wine und ohne dekompilierten App-Code. Ausgeführt wird das unveränderte Python-2.7-Bytecode aus dem macOS-.app; C-Extensions (wxGTK/numpy/ scipy/PortAudio) kommen nativ aus Debian stretch. Enthält: va/ (Original-.pyc + pure-Python-Libs + Assets + launch.py mit den drei Linux-Fixes), Dockerfile/run.sh/entrypoint.sh, reference/ (dekompilierter Quellcode zum Debuggen) und README/STATUS. img.cache (378 MB, regenerierbar) ist per .gitignore ausgeschlossen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,258 @@
|
||||
# uncompyle6 version 3.9.3
|
||||
# Python bytecode version base 2.6 (62161)
|
||||
# Decompiled from: Python 3.9.25 (main, Oct 31 2025, 23:16:49)
|
||||
# [GCC 14.2.0]
|
||||
# Embedded file name: network_settings.pyc
|
||||
# Compiled at: 2023-12-05 14:43:06
|
||||
import wx, wx.lib, os, data_model, traceback, one_unit, protocol, sys, future, mytime
|
||||
from definitions import *
|
||||
import wx.lib.buttons
|
||||
|
||||
def getString(str):
|
||||
return one_unit.getString(str)
|
||||
|
||||
|
||||
class Dialog(wx.Dialog):
|
||||
|
||||
def __init__(self, parent, id, title, infotext='', optkey=None, optmask=0, opttext={}, bgcolour=(220, 220, 220), fgcolour=(70, 70, 70), OK_Only=False, ipkey=None, maskkey=None, default_text=None, IsPassword=False, Set=True, Wrap=0, size=(400, 270), bg=None):
|
||||
wx.Dialog.__init__(self, None, wx.ID_ANY, title, size=size, style=wx.DEFAULT_DIALOG_STYLE)
|
||||
self.parent = parent
|
||||
if bg != None:
|
||||
self.bg = bg
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
print mytime.displayTime() + ' wxPython version: ' + str(wx.VERSION_STRING)
|
||||
self.optkey = optkey
|
||||
self.ipkey = ipkey
|
||||
self.maskkey = maskkey
|
||||
self.optmask = protocol.confTelnetEnabled
|
||||
self.frame_height = 2 * wx.SystemSettings.GetMetric(wx.SYS_CAPTION_Y) + wx.SystemSettings.GetMetric(wx.SYS_BORDER_Y)
|
||||
if os.name in mac_names:
|
||||
self.frame_height = 24
|
||||
self.chkboxes = {}
|
||||
self.Set = Set
|
||||
self.infotext = None
|
||||
if infotext != '':
|
||||
textstring = wx.StaticText(self, -1, infotext, style=wx.ALIGN_LEFT, pos=(25,
|
||||
10))
|
||||
textstring.SetForegroundColour(fgcolour)
|
||||
self.infotext = textstring
|
||||
self.infostring = infotext
|
||||
if os.name in mac_names:
|
||||
textstring.SetFont(wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL))
|
||||
textstring.Wrap(350)
|
||||
try:
|
||||
self.telnet_enabled = int(self.parent.model.get(optkey)) & protocol.confTelnetEnabled
|
||||
except:
|
||||
self.telnet_enabled = 0
|
||||
|
||||
if self.telnet_enabled > 0:
|
||||
self.telnet_enabled = True
|
||||
else:
|
||||
self.telnet_enabled = False
|
||||
print mytime.displayTime() + ' Open Interface Enabled:', self.telnet_enabled
|
||||
mvlabel = wx.StaticText(self, -1, '3rd Party Control', style=wx.ALIGN_LEFT, pos=(25,
|
||||
180))
|
||||
if self.telnet_enabled == True:
|
||||
self.mvindication = wx.StaticText(self, -1, 'Enabled', style=wx.ALIGN_LEFT, pos=(170,
|
||||
180))
|
||||
self.mv_button = wx.lib.buttons.GenButton(self, 13, 'Disable', pos=(280,
|
||||
180), size=(100,
|
||||
20))
|
||||
else:
|
||||
self.mvindication = wx.StaticText(self, -1, 'Disabled', style=wx.ALIGN_LEFT, pos=(170,
|
||||
180))
|
||||
self.mv_button = wx.lib.buttons.GenButton(self, 13, 'Enable', pos=(280,
|
||||
180), size=(100,
|
||||
20))
|
||||
self.DHCP_checkbox1 = wx.RadioButton(self, -1, 'Configure Network Automatically (DHCP)', pos=(25,
|
||||
75), style=wx.RB_GROUP)
|
||||
self.DHCP_checkbox2 = wx.RadioButton(self, -1, 'Configure Network Manually:', pos=(25,
|
||||
95))
|
||||
iplabel = wx.StaticText(self, -1, 'IP Address:', style=wx.ALIGN_LEFT, pos=(50,
|
||||
120))
|
||||
ipstring = None
|
||||
if ipkey != None:
|
||||
textval = ''
|
||||
try:
|
||||
ip = int(self.parent.model.get(ipkey))
|
||||
ip1 = str(ip / 16777216)
|
||||
ip -= int(ip1) * 256 * 256 * 256
|
||||
ip2 = str(ip / 65536)
|
||||
ip -= int(ip2) * 256 * 256
|
||||
ip3 = str(ip / 256)
|
||||
ip -= int(ip3) * 256
|
||||
ip4 = str(ip)
|
||||
ipstring = ip1 + '.' + ip2 + '.' + ip3 + '.' + ip4
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if ipstring == None:
|
||||
ipstring = ' . . . '
|
||||
if default_text != None:
|
||||
ipstring = default_text
|
||||
style = wx.TE_PROCESS_ENTER
|
||||
ipfield = wx.TextCtrl(self, 3, unicode(ipstring), style=style, pos=(170,
|
||||
120))
|
||||
ipfield.SetFocus()
|
||||
self.ipfield = ipfield
|
||||
masklabel = wx.StaticText(self, -1, 'Subnet Mask:', style=wx.ALIGN_LEFT, pos=(50,
|
||||
150))
|
||||
ipstring = None
|
||||
if maskkey != None:
|
||||
textval = ''
|
||||
try:
|
||||
ip = int(self.parent.model.get(maskkey))
|
||||
ip1 = str(ip / 16777216)
|
||||
ip -= int(ip1) * 256 * 256 * 256
|
||||
ip2 = str(ip / 65536)
|
||||
ip -= int(ip2) * 256 * 256
|
||||
ip3 = str(ip / 256)
|
||||
ip -= int(ip3) * 256
|
||||
ip4 = str(ip)
|
||||
ipstring = ip1 + '.' + ip2 + '.' + ip3 + '.' + ip4
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if ipstring == None:
|
||||
ipstring = ' . . . '
|
||||
if default_text != None:
|
||||
ipstring = default_text
|
||||
maskfield = wx.TextCtrl(self, 3, unicode(ipstring), style=style, pos=(170,
|
||||
150))
|
||||
self.maskfield = maskfield
|
||||
ok_button = wx.lib.buttons.GenButton(self, 1, 'Ok', pos=(235, 220), size=(70,
|
||||
20))
|
||||
cancel_button = wx.lib.buttons.GenButton(self, 2, 'Cancel', pos=(315, 220), size=(70,
|
||||
20))
|
||||
if self.parent.model.get(ipkey) == 0:
|
||||
self.ipfield.Disable()
|
||||
self.maskfield.Disable()
|
||||
self.DHCP_checkbox1.SetValue(1)
|
||||
else:
|
||||
self.DHCP_checkbox2.SetValue(1)
|
||||
self.Centre()
|
||||
self.parent = parent
|
||||
self.SetBackgroundColour(bgcolour)
|
||||
self.Bind(wx.EVT_TEXT_ENTER, self.OnOK, id=3)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnOK, id=1)
|
||||
self.Bind(wx.EVT_BUTTON, self.OnCancel, id=2)
|
||||
self.Bind(wx.EVT_RADIOBUTTON, self.OnDHCPSelect, id=self.DHCP_checkbox1.GetId())
|
||||
self.Bind(wx.EVT_RADIOBUTTON, self.OnDHCPSelect, id=self.DHCP_checkbox2.GetId())
|
||||
self.Bind(wx.EVT_BUTTON, self.OnMV, id=13)
|
||||
self.CenterOnScreen()
|
||||
self.response = None
|
||||
return
|
||||
|
||||
def OnMV(self, e):
|
||||
if self.telnet_enabled == True:
|
||||
self.telnet_enabled = False
|
||||
self.mvindication.SetLabel('Disabled')
|
||||
self.mv_button.SetLabel('Enable')
|
||||
else:
|
||||
print 'ns.verify PIC version', self.parent.active_unit.PICVersion
|
||||
dlgMessage = getString('ifvn')
|
||||
if self.parent.verifyInterfaceVersion(dlgMessage) == False:
|
||||
print 'ns.PIC version too low, disabling open interface'
|
||||
self.telnet_enabled = False
|
||||
self.mvindication.SetLabel('Disabled')
|
||||
self.mv_button.SetLabel('Enable')
|
||||
return
|
||||
self.telnet_enabled = True
|
||||
self.mvindication.SetLabel('Enabled')
|
||||
self.mv_button.SetLabel('Disable')
|
||||
return
|
||||
|
||||
def OnDHCPSelect(self, e):
|
||||
if self.DHCP_checkbox1.GetValue() == True:
|
||||
self.ipfield.Disable()
|
||||
self.maskfield.Disable()
|
||||
else:
|
||||
self.ipfield.Enable()
|
||||
self.maskfield.Enable()
|
||||
return
|
||||
|
||||
def OnEraseBackground(self, evt):
|
||||
"""
|
||||
Add a picture to the background
|
||||
"""
|
||||
dc = evt.GetDC()
|
||||
if not dc:
|
||||
dc = wx.ClientDC(self)
|
||||
rect = self.GetUpdateRegion().GetBox()
|
||||
dc.SetClippingRect(rect)
|
||||
dc.Clear()
|
||||
bmp = wx.Bitmap(self.bg)
|
||||
dc.DrawBitmap(bmp, 0, 0)
|
||||
return
|
||||
|
||||
def msgNW(self, msg):
|
||||
dial = wx.MessageDialog(None, msg, 'Error', wx.OK | wx.ICON_ERROR)
|
||||
dial.Raise()
|
||||
dial.ShowModal()
|
||||
dial.Destroy()
|
||||
return
|
||||
|
||||
def OnOK(self, evt):
|
||||
if self.DHCP_checkbox1.GetValue() == True:
|
||||
self.parent.set_value(self.ipkey, 0)
|
||||
self.parent.set_value(self.maskkey, 0)
|
||||
elif self.ipkey != None and self.Set == True:
|
||||
ipval = 0
|
||||
try:
|
||||
iplist = self.ipfield.GetValue().split('.')
|
||||
if int(iplist[3]) > 223:
|
||||
msg = 'Class D and E addresses are not supported. Please specify a value between 1 and 223 for the 4th octet.'
|
||||
future.Future(0.1, self.msgNW, msg)
|
||||
return
|
||||
for i in iplist:
|
||||
ipval *= 256
|
||||
ipval += int(i)
|
||||
|
||||
self.parent.set_value(self.ipkey, ipval)
|
||||
except:
|
||||
msg = 'Please enter a valid IP address.'
|
||||
future.Future(0.1, self.msgNW, msg)
|
||||
return
|
||||
|
||||
if self.maskkey != None and self.Set == True:
|
||||
ipval = 0
|
||||
try:
|
||||
iplist = self.maskfield.GetValue().split('.')
|
||||
for i in iplist:
|
||||
ipval *= 256
|
||||
ipval += int(i)
|
||||
|
||||
self.parent.set_value(self.maskkey, ipval)
|
||||
except:
|
||||
msg = 'Please enter a valid subnet mask.'
|
||||
future.Future(0.1, self.msgNW, msg)
|
||||
return
|
||||
|
||||
if self.optkey != None and self.optmask != 0:
|
||||
try:
|
||||
options = int(self.parent.model.get(self.optkey))
|
||||
options &= protocol.confTelnetEnabled ^ 268435455
|
||||
if self.telnet_enabled:
|
||||
options |= protocol.confTelnetEnabled
|
||||
self.parent.set_value(self.optkey, options)
|
||||
except:
|
||||
traceback.print_exc(file=sys.stdout)
|
||||
|
||||
self.response = 'OK'
|
||||
if self.IsModal() == False:
|
||||
self.Destroy()
|
||||
else:
|
||||
self.Close()
|
||||
return
|
||||
|
||||
def OnCancel(self, evt):
|
||||
self.response = 'Cancel'
|
||||
if self.IsModal == False:
|
||||
self.Destroy()
|
||||
else:
|
||||
self.Close()
|
||||
return
|
||||
|
||||
|
||||
|
||||
# okay decompiling pycode/network_settings.pyc
|
||||
Reference in New Issue
Block a user