libffado-2.4.0-additional-py3-fixes.patch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. --- a/support/mixer-qt4/ffado/panelmanager.py 2018-01-11 12:27:20.518923209 +0900
  2. +++ a/support/mixer-qt4/ffado/panelmanager.py 2018-01-11 12:31:03.956299962 +0900
  3. @@ -38,6 +38,7 @@
  4. import sys
  5. import time
  6. +import importlib
  7. import logging
  8. log = logging.getLogger('panelmanager')
  9. @@ -302,20 +303,15 @@
  10. #
  11. # Specific (or dummy) mixer widgets get loaded in the following
  12. #
  13. + found = False
  14. if 'mixer' in dev and dev['mixer'] != None:
  15. mixerapp = dev['mixer']
  16. - global mixerwidget
  17. - exec( """
  18. -try:
  19. - import ffado.mixer.%s
  20. - globals()["mixerwidget"] = ffado.mixer.%s.%s( w )
  21. - found = True
  22. -except ImportError:
  23. - log.debug("bypassdbus set, %s module not available: ignored")
  24. - found = False
  25. -""" % (mixerapp.lower(), mixerapp.lower(), mixerapp, mixerapp.lower()) )
  26. - else:
  27. - found = False
  28. + try:
  29. + mixer_module = importlib.import_module("ffado.mixer.%s" % mixerapp.lower())
  30. + mixerwidget = getattr(mixer_module, mixerapp)(w)
  31. + found = True
  32. + except ImportError:
  33. + log.debug("bypassdbus set, %s module not available: ignored" % mixerapp.lower())
  34. if not found:
  35. mixerwidget = Dummy( w )
  36. --- a/support/mixer-qt4/ffado/widgets/crossbarrouter.py 2018-01-11 12:34:10.200777889 +0900
  37. +++ b/support/mixer-qt4/ffado/widgets/crossbarrouter.py 2018-01-11 12:45:13.278911705 +0900
  38. @@ -194,7 +194,7 @@
  39. #log.debug("Got %i peaks" % len(peakvalues))
  40. for peak in peakvalues:
  41. #log.debug("peak = [%s,%s]" % (str(peak[0]),str(peak[1])))
  42. - if peak[0] >= 0:
  43. + if peak[1] >= 0:
  44. self.switchers[peak[0]].peakValue(peak[1])
  45. def updateMixerRouting(self):
  46. --- a/support/mixer-qt4/ffado/widgets/matrixmixer.py 2018-01-11 12:54:27.545361864 +0900
  47. +++ b/support/mixer-qt4/ffado/widgets/matrixmixer.py 2018-01-11 12:56:36.899124318 +0900
  48. @@ -512,7 +512,7 @@
  49. self.rowHeaders[j].lbl.setText(row_name)
  50. def updateValues(self, n):
  51. - nbitems = len(n)/3
  52. + nbitems = len(n) // 3
  53. for i in range(nbitems):
  54. n_0 = n[3*i]
  55. n_1 = n[3*i+1]
  56. @@ -951,7 +951,7 @@
  57. return self.interface.setValue(In, Out, val)
  58. def updateValues(self, n):
  59. - nbitems = len(n)/3
  60. + nbitems = len(n) // 3
  61. for j in range(nbitems):
  62. n_0 = n[3*j]
  63. n_1 = n[3*j+1]
  64. @@ -1406,7 +1406,7 @@
  65. def matrixControlChanged(self, n):
  66. # Update value needed for "per Out" view
  67. #log.debug("Update per Output( %s )" % str(n))
  68. - nbitems = len(n)/3
  69. + nbitems = len(n) // 3
  70. if (self.rule == "Columns_are_inputs"):
  71. n_t = n
  72. else:
  73. @@ -1420,7 +1420,7 @@
  74. def sliderControlChanged(self, n):
  75. # Update value needed for matrix view
  76. #log.debug("Update Matrix( %s )" % str(n))
  77. - nbitems = len(n)/3
  78. + nbitems = len(n) // 3
  79. if (((self.rule == "Columns_are_inputs") and not self.transpose) or ((self.rule != "Columns_are_inputs") and self.transpose)):
  80. n_t = ()
  81. for i in range(nbitems):
  82. @@ -1512,7 +1512,7 @@
  83. log.debug("Number of stereo output channels must be specified")
  84. return False
  85. n = int(readMixerString[idx+2])
  86. - if n > self.perOut.nbOut/2:
  87. + if n > self.perOut.nbOut // 2:
  88. log.debug("Incoherent number of stereo channels")
  89. return False
  90. if n > 0: