Merge lp:~muktupavels/compiz/ccsm-python3 into lp:compiz/0.9.13
- ccsm-python3
- Merge into 0.9.13
Status: | Merged |
---|---|
Approved by: | Dmitry Shachnev |
Approved revision: | 4187 |
Merged at revision: | 4190 |
Proposed branch: | lp:~muktupavels/compiz/ccsm-python3 |
Merge into: | lp:compiz/0.9.13 |
Diff against target: |
560 lines (+88/-132) 18 files modified
compizconfig/ccsm/CMakeLists.txt (+7/-11) compizconfig/ccsm/ccsm (+1/-1) compizconfig/ccsm/setup.cfg (+2/-0) compizconfig/ccsm/setup.py (+10/-10) compizconfig/cmake/exec_setup_py_with_destdir.cmake (+2/-1) compizconfig/compizconfig-python/CMakeLists.txt (+9/-30) compizconfig/compizconfig-python/compizconfig-python.pc.in (+0/-13) compizconfig/compizconfig-python/setup.py (+2/-3) compizconfig/compizconfig-python/src/compizconfig.pyx (+4/-3) compizconfig/compizconfig-python/tests/test_backend.py (+9/-9) compizconfig/compizconfig-python/tests/test_plugin.py (+10/-10) compizconfig/compizconfig-python/tests/test_setting.py (+14/-14) debian/compizconfig-settings-manager.install (+1/-2) debian/control (+14/-14) debian/python-compizconfig.install (+0/-3) debian/python-compizconfig.lintian-overrides (+0/-1) debian/python3-compizconfig.install (+2/-0) debian/rules (+1/-7) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/ccsm-python3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dmitry Shachnev | Approve | ||
Review via email: mp+351940@code.launchpad.net |
Commit message
Port CCSM to Python 3.
Description of the change
- 4183. By Alberts Muktupāvels
-
Port CCSM to Python 3.
Dmitry Shachnev (mitya57) wrote : | # |
The packaging is fine now. For those who want to test it, it’s available in https:/
Note that it will need a no-change rebuild for Python default version change (e.g. 3.6 → 3.7).
Dmitry Shachnev (mitya57) : | # |
- 4184. By Alberts Muktupāvels
-
Remove python3-
compizconfig. lintian- overrides.
Khurshid Alam (khurshid-alam) wrote : | # |
Is this safe for unity? I didn't find anything related. But did you speak with 3v1n0?
Alberts Muktupāvels (muktupavels) wrote : | # |
Why would it be unsafe? I don't see what problems this could cause except for regressions in ccsm because of python2 -> python3 and/or gtk 2 -> gtk 3, and/or pygtk to pygobject.
Andrea Azzarone (azzar1) wrote : | # |
LGTM. Still need to run this. Could you please take a look to the only line-comment?
Dmitry Shachnev (mitya57) : | # |
Andrea Azzarone (azzar1) wrote : | # |
Would it make sense to rename compizconfig-
- 4185. By Alberts Muktupāvels
-
Rename compizconfig-
python. pc to compizconfig- python3. pc and remove Breaks/Replaces.
Dmitry Shachnev (mitya57) wrote : | # |
I think the .pc file for Python is just not needed, nothing is using it now.
Alberts Muktupāvels (muktupavels) wrote : | # |
compizconfig-
prefix=/usr
exec_prefix=
libdir=
includedir=
pyexecdir=
Name: compizconfig-
Version: 0.9.13.1
Description: Compiz configuration system bindings
Requires:
Libs: -L/usr/
Cflags: -I/usr/
libcompizconfig.pc:
prefix=/usr
exec_prefix=
libdir=
includedir=
Name: libcompizconfig
Description: Compiz configuration system
Version: 0.9.13.1
Requires: compiz
Libs: -L/usr/
Cflags: -I/usr/
Both files would find libcompizconfig.so that is installed by libcompizconfig
- 4186. By Alberts Muktupāvels
-
Remove compizconfig-
python3. pc.
Andrea Azzarone (azzar1) wrote : | # |
Changes looks good to me now. You need to propose a change for unity-autopilot too in order to get this accepted. Also a FFE is required (https:/
Andrea Azzarone (azzar1) wrote : | # |
unity-autopilot is python2 code. You have two options here:
1) have both python-compizconfig and python3-
2) port unity-autopilot to python3 (tbh I'm not sure how much work this would be)
- 4187. By Alberts Muktupāvels
-
Fix inconsistent use of tabs and spaces in indentation.
Dmitry Shachnev (mitya57) wrote : | # |
unity-autopilot is ported in https:/
Preview Diff
1 | === modified file 'compizconfig/ccsm/CMakeLists.txt' |
2 | --- compizconfig/ccsm/CMakeLists.txt 2012-10-16 13:53:20 +0000 |
3 | +++ compizconfig/ccsm/CMakeLists.txt 2018-09-05 09:24:50 +0000 |
4 | @@ -10,14 +10,12 @@ |
5 | |
6 | # Get arch |
7 | execute_process (COMMAND uname -p OUTPUT_VARIABLE PROC_ARCH) |
8 | +string (REPLACE "\n" "" PROC_ARCH ${PROC_ARCH}) |
9 | |
10 | # Get Python Version |
11 | -execute_process (COMMAND python -c "import sys; print str (sys.version_info[0]) + '.' + str (sys.version_info[1])" |
12 | - OUTPUT_VARIABLE PY_VERSION) |
13 | - |
14 | -string (REPLACE "\n" "" PROC_ARCH ${PROC_ARCH}) |
15 | -string (REPLACE "\n" "" PY_VERSION ${PY_VERSION}) |
16 | - |
17 | +find_package (PythonInterp 3.0 REQUIRED) |
18 | + |
19 | +set (PY_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") |
20 | set (PY_BUILD_DIR lib.linux-${PROC_ARCH}-${PY_VERSION}) |
21 | set (PY_SCRIPTS_DIR scripts-${PY_VERSION}) |
22 | |
23 | @@ -36,19 +34,17 @@ |
24 | set (VERSION ${COMPIZ_RELEASE_VERSION}) |
25 | |
26 | add_custom_command (OUTPUT ${PY_CCSM_LIB} |
27 | - COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build --version=${VERSION} |
28 | + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build --version=${VERSION} |
29 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
30 | COMMENT "Generating Python Bytecode") |
31 | |
32 | add_custom_target (ccsm_module ALL DEPENDS |
33 | ${PY_CCSM_LIB}) |
34 | |
35 | -set (UNINSTALL_COMMAND "python ${CMAKE_CURRENT_SOURCE_DIR}/setup.py uninstall --prefix=${CMAKE_INSTALL_PREFIX} --version=${VERSION}") |
36 | +set (UNINSTALL_COMMAND "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py uninstall --prefix=${CMAKE_INSTALL_PREFIX} --version=${VERSION}") |
37 | |
38 | compiz_add_code_to_uninstall_target (${UNINSTALL_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}) |
39 | |
40 | install (CODE |
41 | "message (\"Installing python files\") |
42 | - execute_process (COMMAND cmake -DSETUP=${CMAKE_CURRENT_SOURCE_DIR}/setup.py -DPREFIX=${CMAKE_INSTALL_PREFIX} -DWDIR=${CMAKE_CURRENT_SOURCE_DIR} -DVERSION=${VERSION} -P ${compiz_SOURCE_DIR}/compizconfig/cmake/exec_setup_py_with_destdir.cmake)") |
43 | - |
44 | - |
45 | + execute_process (COMMAND cmake -DPY_EXECUTABLE=${PYTHON_EXECUTABLE} -DSETUP=${CMAKE_CURRENT_SOURCE_DIR}/setup.py -DPREFIX=${CMAKE_INSTALL_PREFIX} -DWDIR=${CMAKE_CURRENT_SOURCE_DIR} -DVERSION=${VERSION} -P ${compiz_SOURCE_DIR}/compizconfig/cmake/exec_setup_py_with_destdir.cmake)") |
46 | |
47 | === modified file 'compizconfig/ccsm/ccsm' |
48 | --- compizconfig/ccsm/ccsm 2018-07-11 21:59:31 +0000 |
49 | +++ compizconfig/ccsm/ccsm 2018-09-05 09:24:50 +0000 |
50 | @@ -1,4 +1,4 @@ |
51 | -#!/usr/bin/env python |
52 | +#!/usr/bin/env python3 |
53 | # -*- coding: UTF-8 -*- |
54 | |
55 | # This program is free software; you can redistribute it and/or |
56 | |
57 | === added file 'compizconfig/ccsm/setup.cfg' |
58 | --- compizconfig/ccsm/setup.cfg 1970-01-01 00:00:00 +0000 |
59 | +++ compizconfig/ccsm/setup.cfg 2018-09-05 09:24:50 +0000 |
60 | @@ -0,0 +1,2 @@ |
61 | +[build] |
62 | +executable = /usr/bin/env python3 |
63 | |
64 | === modified file 'compizconfig/ccsm/setup.py' |
65 | --- compizconfig/ccsm/setup.py 2013-04-28 04:26:33 +0000 |
66 | +++ compizconfig/ccsm/setup.py 2018-09-05 09:24:50 +0000 |
67 | @@ -1,4 +1,4 @@ |
68 | -#!/usr/bin/env python |
69 | +#!/usr/bin/env python3 |
70 | |
71 | import sys, os, glob |
72 | import subprocess |
73 | @@ -48,15 +48,15 @@ |
74 | # Update icon cache |
75 | gtk_update_icon_cache = '''gtk-update-icon-cache -f -t \ |
76 | %s''' % icon_prefix |
77 | - root_specified = len (filter (lambda s: s.startswith ("--root"), |
78 | - sys.argv)) > 0 |
79 | + root_specified = len (list (filter (lambda s: s.startswith ("--root"), |
80 | + sys.argv))) > 0 |
81 | if not root_specified: |
82 | - print "Updating Gtk icon cache." |
83 | + print ("Updating Gtk icon cache.") |
84 | os.system (gtk_update_icon_cache) |
85 | outputs.append (icon_theme_cache) |
86 | else: |
87 | - print '''*** Icon cache not updated. After install, run this: |
88 | -*** %s''' % gtk_update_icon_cache |
89 | + print ('''*** Icon cache not updated. After install, run this: |
90 | +*** %s''' % gtk_update_icon_cache) |
91 | |
92 | length = 0 |
93 | if self.root: |
94 | @@ -64,7 +64,7 @@ |
95 | if self.prefix: |
96 | length += len (self.prefix) |
97 | if length: |
98 | - for counter in xrange (len (outputs)): |
99 | + for counter in range (len (outputs)): |
100 | outputs[counter] = outputs[counter][length:] |
101 | data = "\n".join (outputs) |
102 | try: |
103 | @@ -114,10 +114,10 @@ |
104 | if self.prefix: |
105 | prepend += self.prefix |
106 | if len (prepend): |
107 | - for counter in xrange (len (files)): |
108 | + for counter in range (len (files)): |
109 | files[counter] = prepend + files[counter].rstrip () |
110 | for file in files: |
111 | - print "Uninstalling %s" % file |
112 | + print ("Uninstalling %s" % file) |
113 | try: |
114 | os.unlink (file) |
115 | except: |
116 | @@ -126,7 +126,7 @@ |
117 | ops = ("install", "build", "sdist", "uninstall", "clean") |
118 | |
119 | if len (sys.argv) < 2 or sys.argv[1] not in ops: |
120 | - print "Please specify operation : %s" % " | ".join (ops) |
121 | + print ("Please specify operation : %s" % " | ".join (ops)) |
122 | raise SystemExit |
123 | |
124 | prefix = None |
125 | |
126 | === modified file 'compizconfig/cmake/exec_setup_py_with_destdir.cmake' |
127 | --- compizconfig/cmake/exec_setup_py_with_destdir.cmake 2012-09-06 12:17:40 +0000 |
128 | +++ compizconfig/cmake/exec_setup_py_with_destdir.cmake 2018-09-05 09:24:50 +0000 |
129 | @@ -1,3 +1,4 @@ |
130 | +set (PY_EXECUTABLE "" CACHE FORCE "Python executable") |
131 | set (WDIR "" CACHE FORCE "Working Directory") |
132 | set (PREFIX "" CACHE FORCE "Prefix") |
133 | set (SETUP "" CACHE FORCE "Path to setup.py") |
134 | @@ -21,5 +22,5 @@ |
135 | set (EXTRAARGS "--install-layout=deb") |
136 | endif (BUILD_DEB) |
137 | |
138 | -execute_process (COMMAND python ${SETUP} install ${EXTRAARGS} --prefix=${PREFIX} --version=${VERSION} ${INSTALL_ROOT_ARGS} |
139 | +execute_process (COMMAND ${PY_EXECUTABLE} ${SETUP} install ${EXTRAARGS} --prefix=${PREFIX} --version=${VERSION} ${INSTALL_ROOT_ARGS} |
140 | WORKING_DIRECTORY ${WDIR}) |
141 | |
142 | === modified file 'compizconfig/compizconfig-python/CMakeLists.txt' |
143 | --- compizconfig/compizconfig-python/CMakeLists.txt 2018-06-27 10:30:36 +0000 |
144 | +++ compizconfig/compizconfig-python/CMakeLists.txt 2018-09-05 09:24:50 +0000 |
145 | @@ -3,34 +3,20 @@ |
146 | |
147 | # Get arch |
148 | execute_process (COMMAND uname -p OUTPUT_VARIABLE PROC_ARCH) |
149 | - |
150 | -# Get Python Version |
151 | -execute_process (COMMAND python -c "import sys; print str (sys.version_info[0]) + '.' + str (sys.version_info[1])" |
152 | - OUTPUT_VARIABLE PY_VERSION) |
153 | - |
154 | -include (FindPkgConfig) |
155 | -pkg_check_modules (PYTHON python-2.7) |
156 | - |
157 | -# This is a workaround for a broken FindPythonLibs always finding the |
158 | -# wrong library version because PYTHON_LIBRARY is in the cache and |
159 | -# can't be overwritten |
160 | -string (REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" PYTHON_CURRENT_VERSION ${PY_VERSION}) |
161 | -string (REPLACE "." "" PYTHON_CURRENT_VERSION_NO_DOTS ${PYTHON_CURRENT_VERSION}) |
162 | -find_library (PYTHON_LIBRARY_LOCAL |
163 | - NAMES python${PYTHON_CURRENT_VERSION_NO_DOTS} python${PYTHON_CURRENT_VERSION} |
164 | - PATH_SUFFIXES python${PYTHON_CURRENT_VERSION}/config) |
165 | +string (REPLACE "\n" "" PROC_ARCH ${PROC_ARCH}) |
166 | + |
167 | +find_package (PythonInterp 3.0 REQUIRED) |
168 | +find_package (PythonLibs 3.0 REQUIRED) |
169 | |
170 | set (COMPIZCONFIG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/compizconfig/libcompizconfig/include) |
171 | |
172 | -string (REPLACE "\n" "" PROC_ARCH ${PROC_ARCH}) |
173 | -string (REPLACE "\n" "" PY_VERSION ${PY_VERSION}) |
174 | - |
175 | +set (PY_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") |
176 | set (PY_BUILD_DIR lib.linux-${PROC_ARCH}-${PY_VERSION}) |
177 | set (PY_SCRIPTS_DIR scripts-${PY_VERSION}) |
178 | set (PY_COMPIZCONFIG_SRC ${CMAKE_CURRENT_BINARY_DIR}/compizconfig.c) |
179 | set (PY_COMPIZCONFIG_CYTHON ${CMAKE_CURRENT_SOURCE_DIR}/src/compizconfig.pyx) |
180 | |
181 | -find_program(CYTHON_BIN cython) |
182 | +find_program(CYTHON_BIN cython3) |
183 | if(NOT CYTHON_BIN) |
184 | message(FATAL_ERROR "Can not build because cython binary not found.") |
185 | endif() |
186 | @@ -44,9 +30,6 @@ |
187 | string (STRIP ${COMPIZ_RELEASE_VERSION} COMPIZ_RELEASE_VERSION) |
188 | set (VERSION ${COMPIZ_RELEASE_VERSION}) |
189 | |
190 | -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compizconfig-python.pc.in |
191 | - ${CMAKE_CURRENT_BINARY_DIR}/compizconfig-python.pc) |
192 | - |
193 | include_directories (${PYTHON_INCLUDE_DIRS} |
194 | ${COMPIZCONFIG_INCLUDE_DIRS}) |
195 | |
196 | @@ -76,16 +59,13 @@ |
197 | compizconfig) |
198 | |
199 | target_link_libraries (compizconfig_python_module |
200 | - ${PYTHON_LIBRARY_LOCAL} |
201 | + ${PYTHON_LIBRARIES} |
202 | compizconfig) |
203 | |
204 | -set (UNINSTALL_COMMAND "python ${CMAKE_CURRENT_SOURCE_DIR}/setup.py uninstall --prefix=${CMAKE_INSTALL_PREFIX} --version=${VERSION}") |
205 | +set (UNINSTALL_COMMAND "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py uninstall --prefix=${CMAKE_INSTALL_PREFIX} --version=${VERSION}") |
206 | |
207 | compiz_add_code_to_uninstall_target (${UNINSTALL_COMMAND} ${CMAKE_CURRENT_BINARY_DIR}) |
208 | |
209 | -install (FILES ${CMAKE_CURRENT_BINARY_DIR}/compizconfig-python.pc |
210 | - DESTINATION ${libdir}/pkgconfig) |
211 | - |
212 | # This is probably not very portable, but we can't install using distutils |
213 | # as we cannot build with it safely |
214 | |
215 | @@ -102,12 +82,11 @@ |
216 | |
217 | install (CODE |
218 | "message (\"Installing python files\") |
219 | - execute_process (COMMAND cmake -DSETUP=${CMAKE_CURRENT_SOURCE_DIR}/setup.py -DPREFIX=${CMAKE_INSTALL_PREFIX} -DWDIR=${CMAKE_CURRENT_BINARY_DIR} -DVERSION=${VERSION} -P ${compiz_SOURCE_DIR}/compizconfig/cmake/exec_setup_py_with_destdir.cmake)") |
220 | + execute_process (COMMAND cmake -DPY_EXECUTABLE=${PYTHON_EXECUTABLE} -DSETUP=${CMAKE_CURRENT_SOURCE_DIR}/setup.py -DPREFIX=${CMAKE_INSTALL_PREFIX} -DWDIR=${CMAKE_CURRENT_BINARY_DIR} -DVERSION=${VERSION} -P ${compiz_SOURCE_DIR}/compizconfig/cmake/exec_setup_py_with_destdir.cmake)") |
221 | |
222 | if (COMPIZ_BUILD_TESTING) |
223 | |
224 | find_program (BASH_EXECUTABLE bash) |
225 | - find_program (PYTHON_EXECUTABLE python) |
226 | mark_as_advanced (FORCE PYTHON_EXECUTABLE) |
227 | |
228 | file (GLOB PYTHON_TESTS "tests/test_*.py") |
229 | |
230 | === removed file 'compizconfig/compizconfig-python/compizconfig-python.pc.in' |
231 | --- compizconfig/compizconfig-python/compizconfig-python.pc.in 2012-09-04 01:00:10 +0000 |
232 | +++ compizconfig/compizconfig-python/compizconfig-python.pc.in 1970-01-01 00:00:00 +0000 |
233 | @@ -1,13 +0,0 @@ |
234 | -prefix=@prefix@ |
235 | -exec_prefix=@exec_prefix@ |
236 | -libdir=@libdir@ |
237 | -includedir=@includedir@ |
238 | -pyexecdir=@pyexecdir@ |
239 | - |
240 | -Name: compizconfig-python |
241 | -Version: @VERSION@ |
242 | -Description: Compiz configuration system bindings |
243 | - |
244 | -Requires: @CCS_REQUIRES@ |
245 | -Libs: @CCS_LIBS@ -L@libdir@ -lcompizconfig |
246 | -Cflags: @CCS_CFLAGS@ -I@includedir@/compizconfig |
247 | |
248 | === modified file 'compizconfig/compizconfig-python/setup.py' |
249 | --- compizconfig/compizconfig-python/setup.py 2018-07-16 23:14:30 +0000 |
250 | +++ compizconfig/compizconfig-python/setup.py 2018-09-05 09:24:50 +0000 |
251 | @@ -18,7 +18,6 @@ |
252 | print ("CompizConfig Python [ERROR]: No libcompizconfig_internal.pc found in the pkg-config search path") |
253 | print ("Ensure that libcompizonfig is installed or libcompizconfig.pc is in your $PKG_CONFIG_PATH") |
254 | exit (1); |
255 | -libs = pkgconfig_libs[2:].split (" ")[0] |
256 | |
257 | INSTALLED_FILES = "installed_files" |
258 | |
259 | @@ -59,7 +58,7 @@ |
260 | if self.prefix: |
261 | length += len (self.prefix) |
262 | if length: |
263 | - for counter in xrange (len (outputs)): |
264 | + for counter in range (len (outputs)): |
265 | outputs[counter] = outputs[counter][length:] |
266 | data = "\n".join (outputs) |
267 | try: |
268 | @@ -109,7 +108,7 @@ |
269 | if self.prefix: |
270 | prepend += self.prefix |
271 | if len (prepend): |
272 | - for counter in xrange (len (files)): |
273 | + for counter in range (len (files)): |
274 | files[counter] = prepend + files[counter].rstrip () |
275 | for file in files: |
276 | print ("Uninstalling %s" % file) |
277 | |
278 | === modified file 'compizconfig/compizconfig-python/src/compizconfig.pyx' |
279 | --- compizconfig/compizconfig-python/src/compizconfig.pyx 2018-06-27 10:30:36 +0000 |
280 | +++ compizconfig/compizconfig-python/src/compizconfig.pyx 2018-09-05 09:24:50 +0000 |
281 | @@ -1,3 +1,4 @@ |
282 | +# cython: c_string_type=str, c_string_encoding=ascii |
283 | ''' |
284 | This program is free software; you can redistribute it and/or |
285 | modify it under the terms of the GNU Lesser General Public License |
286 | @@ -770,10 +771,10 @@ |
287 | if t == TypeString and i.forString.extensible: |
288 | self.hasExtendedString = True |
289 | |
290 | - if not self.ranking.has_key (ccsSettingGetName (sett)): |
291 | + if ccsSettingGetName (sett) not in self.ranking: |
292 | self.ranking[ccsSettingGetName (sett)] = rank |
293 | rank = rank + 1 |
294 | - |
295 | + |
296 | setlist = setlist.next |
297 | |
298 | self.loaded = True |
299 | @@ -1136,7 +1137,7 @@ |
300 | cat = '' |
301 | else: |
302 | cat = ccsPluginGetCategory (pl) |
303 | - if not self.categories.has_key (cat): |
304 | + if cat not in self.categories: |
305 | self.categories[cat] = [] |
306 | self.categories[cat].append (self.plugins[ccsPluginGetName (pl)]) |
307 | pll = pll.next |
308 | |
309 | === modified file 'compizconfig/compizconfig-python/tests/test_backend.py' |
310 | --- compizconfig/compizconfig-python/tests/test_backend.py 2012-05-21 15:40:47 +0000 |
311 | +++ compizconfig/compizconfig-python/tests/test_backend.py 2018-09-05 09:24:50 +0000 |
312 | @@ -5,15 +5,15 @@ |
313 | |
314 | def runTest (self): |
315 | |
316 | - info = ["ini", "Ini Backend", "Flat File Backend", True, False] |
317 | - |
318 | - backend = self.ccs.Backend (self.context, info) |
319 | - |
320 | - self.assertEqual (backend.Name, "ini") |
321 | - self.assertEqual (backend.ShortDesc, "Ini Backend") |
322 | - self.assertEqual (backend.LongDesc, "Flat File Backend") |
323 | - self.assertEqual (backend.IntegrationSupport, False) |
324 | - self.assertEqual (backend.ProfileSupport, True) |
325 | + info = ["ini", "Ini Backend", "Flat File Backend", True, False] |
326 | + |
327 | + backend = self.ccs.Backend (self.context, info) |
328 | + |
329 | + self.assertEqual (backend.Name, "ini") |
330 | + self.assertEqual (backend.ShortDesc, "Ini Backend") |
331 | + self.assertEqual (backend.LongDesc, "Flat File Backend") |
332 | + self.assertEqual (backend.IntegrationSupport, False) |
333 | + self.assertEqual (backend.ProfileSupport, True) |
334 | |
335 | if __name__ == '__main__': |
336 | unittest.main() |
337 | |
338 | === modified file 'compizconfig/compizconfig-python/tests/test_plugin.py' |
339 | --- compizconfig/compizconfig-python/tests/test_plugin.py 2012-10-16 13:53:20 +0000 |
340 | +++ compizconfig/compizconfig-python/tests/test_plugin.py 2018-09-05 09:24:50 +0000 |
341 | @@ -4,17 +4,17 @@ |
342 | class CompizConfigTestPlugin (compiz_config_test.CompizConfigTest): |
343 | |
344 | def runTest (self): |
345 | - plugin = self.ccs.Plugin (self.context, "mock") |
346 | - plugin.Update () |
347 | + plugin = self.ccs.Plugin (self.context, "mock") |
348 | + plugin.Update () |
349 | |
350 | - self.assertEqual (plugin.Context, self.context) |
351 | - self.assertTrue ("A Mock Group" in plugin.Groups) |
352 | - self.assertTrue (plugin.Screen is not None) |
353 | - self.assertEqual (plugin.Name, "mock") |
354 | - self.assertEqual (plugin.ShortDesc, "Mock") |
355 | - self.assertEqual (plugin.LongDesc, "Mock plugin") |
356 | - self.assertEqual (plugin.Category, "Mocks") |
357 | - self.assertEqual (plugin.Features, ["mocking"]) |
358 | + self.assertEqual (plugin.Context, self.context) |
359 | + self.assertTrue ("A Mock Group" in plugin.Groups) |
360 | + self.assertTrue (plugin.Screen is not None) |
361 | + self.assertEqual (plugin.Name, "mock") |
362 | + self.assertEqual (plugin.ShortDesc, "Mock") |
363 | + self.assertEqual (plugin.LongDesc, "Mock plugin") |
364 | + self.assertEqual (plugin.Category, "Mocks") |
365 | + self.assertEqual (plugin.Features, ["mocking"]) |
366 | |
367 | if __name__ == '__main__': |
368 | unittest.main() |
369 | |
370 | === modified file 'compizconfig/compizconfig-python/tests/test_setting.py' |
371 | --- compizconfig/compizconfig-python/tests/test_setting.py 2012-10-16 13:53:20 +0000 |
372 | +++ compizconfig/compizconfig-python/tests/test_setting.py 2018-09-05 09:24:50 +0000 |
373 | @@ -5,21 +5,21 @@ |
374 | |
375 | def runTest (self): |
376 | |
377 | - plugin = self.context.Plugins["mock"] |
378 | - setting = self.ccs.Setting (plugin, "mock") |
379 | + plugin = self.context.Plugins["mock"] |
380 | + setting = self.ccs.Setting (plugin, "mock") |
381 | |
382 | - self.assertEqual (setting.Plugin, plugin) |
383 | - self.assertEqual (setting.Name, "mock") |
384 | - self.assertEqual (setting.ShortDesc, "Mock Setting") |
385 | - self.assertEqual (setting.LongDesc, "A Mock Setting") |
386 | - self.assertEqual (setting.Group, "A Mock Group") |
387 | - self.assertEqual (setting.SubGroup, "A Mock Subgroup") |
388 | - self.assertEqual (setting.Type, "String") |
389 | - self.assertEqual (setting.Hints, []) |
390 | - self.assertEqual (setting.DefaultValue, "Mock Value") |
391 | - self.assertEqual (setting.Value, "Mock Value") |
392 | - self.assertEqual (setting.Integrated, False) |
393 | - self.assertEqual (setting.ReadOnly, False) |
394 | + self.assertEqual (setting.Plugin, plugin) |
395 | + self.assertEqual (setting.Name, "mock") |
396 | + self.assertEqual (setting.ShortDesc, "Mock Setting") |
397 | + self.assertEqual (setting.LongDesc, "A Mock Setting") |
398 | + self.assertEqual (setting.Group, "A Mock Group") |
399 | + self.assertEqual (setting.SubGroup, "A Mock Subgroup") |
400 | + self.assertEqual (setting.Type, "String") |
401 | + self.assertEqual (setting.Hints, []) |
402 | + self.assertEqual (setting.DefaultValue, "Mock Value") |
403 | + self.assertEqual (setting.Value, "Mock Value") |
404 | + self.assertEqual (setting.Integrated, False) |
405 | + self.assertEqual (setting.ReadOnly, False) |
406 | |
407 | if __name__ == '__main__': |
408 | unittest.main() |
409 | |
410 | === modified file 'debian/compizconfig-settings-manager.install' |
411 | --- debian/compizconfig-settings-manager.install 2012-06-19 11:22:48 +0000 |
412 | +++ debian/compizconfig-settings-manager.install 2018-09-05 09:24:50 +0000 |
413 | @@ -2,6 +2,5 @@ |
414 | debian/tmp/usr/share/applications/ccsm.desktop |
415 | debian/tmp/usr/share/icons/hicolor/*/apps/ccsm.* |
416 | debian/tmp/usr/lib/python*/*/ccm* |
417 | -debian/tmp/usr/lib/python2.7/dist-packages/ccsm* |
418 | +debian/tmp/usr/lib/*/dist-packages/ccsm* |
419 | debian/tmp/usr/share/ccsm |
420 | - |
421 | |
422 | === modified file 'debian/control' |
423 | --- debian/control 2018-07-24 10:32:11 +0000 |
424 | +++ debian/control 2018-09-05 09:24:50 +0000 |
425 | @@ -7,6 +7,7 @@ |
426 | Build-Depends: cmake (>= 2.8.12), |
427 | debhelper (>= 9~), |
428 | dh-migrations, |
429 | + dh-python, |
430 | dh-translations, |
431 | googletest (>= 1.8.0), |
432 | intltool, |
433 | @@ -52,12 +53,11 @@ |
434 | libx11-xcb-dev, |
435 | libprotobuf-dev, |
436 | protobuf-compiler, |
437 | - python-all-dev, |
438 | - cython, |
439 | + python3-all-dev, |
440 | + cython3, |
441 | gsettings-desktop-schemas-dev, |
442 | xserver-xorg-dev (>= 0.7.0), |
443 | Standards-Version: 3.9.8 |
444 | -X-Python-Version: >= 2.7 |
445 | # If you aren't a member of ~compiz-team but need to upload packaging changes, |
446 | # just go ahead. ~compiz-team will notice and sync up the code again. |
447 | Vcs-Bzr: https://code.launchpad.net/~compiz-team/compiz/0.9.10 |
448 | @@ -148,7 +148,7 @@ |
449 | Pre-Depends: ${misc:Pre-Depends} |
450 | Depends: ${shlibs:Depends}, |
451 | ${misc:Depends}, |
452 | - ${python:Depends}, |
453 | + ${python3:Depends}, |
454 | compiz-plugins-default (= ${binary:Version}), |
455 | gsettings-desktop-schemas, |
456 | gnome-settings-daemon-schemas (>= 3.4.2-0ubuntu9), |
457 | @@ -172,10 +172,10 @@ |
458 | Pre-Depends: ${misc:Pre-Depends} |
459 | Depends: ${shlibs:Depends}, |
460 | ${misc:Depends}, |
461 | - ${python:Depends}, |
462 | + ${python3:Depends}, |
463 | compiz-gnome, |
464 | mate-settings-daemon, |
465 | - python |
466 | + python3 |
467 | Recommends: ubuntu-mate-wallpapers-common, |
468 | Description: OpenGL window and compositing manager - MATE integration |
469 | Compiz brings to life a variety of visual effects that make the Linux desktop |
470 | @@ -289,13 +289,13 @@ |
471 | This package contains the headers and development files needed to |
472 | build plugins with settings support. |
473 | |
474 | -Package: python-compizconfig |
475 | +Package: python3-compizconfig |
476 | Architecture: any |
477 | Multi-Arch: same |
478 | Section: python |
479 | Pre-Depends: ${misc:Pre-Depends} |
480 | -Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} |
481 | -Provides: ${python:Provides} |
482 | +Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends} |
483 | +Provides: ${python3:Provides} |
484 | Description: Compizconfig bindings for Python |
485 | Compiz Fusion is the result of the re-unification of the Beryl-project |
486 | and the community around the Compiz Window Manager. It seeks to provide |
487 | @@ -308,17 +308,17 @@ |
488 | Package: compizconfig-settings-manager |
489 | Architecture: all |
490 | Multi-Arch: allowed |
491 | -XB-Python-Version: ${python:Versions} |
492 | +XB-Python3-Version: ${python3:Versions} |
493 | Pre-Depends: ${misc:Pre-Depends} |
494 | Depends: ${shlibs:Depends}, |
495 | ${misc:Depends}, |
496 | - ${python:Depends}, |
497 | + ${python3:Depends}, |
498 | gir1.2-gdkpixbuf-2.0, |
499 | gir1.2-gtk-3.0, |
500 | gir1.2-pango-1.0, |
501 | - python-compizconfig (>= ${source:Version}), |
502 | - python-gi, |
503 | - python-gi-cairo, |
504 | + python3-compizconfig (>= ${source:Version}), |
505 | + python3-gi, |
506 | + python3-gi-cairo, |
507 | Recommends: compiz-plugins-default |
508 | Description: Compiz configuration settings manager |
509 | The OpenCompositing Project brings 3D desktop visual effects that improve |
510 | |
511 | === removed file 'debian/python-compizconfig.install' |
512 | --- debian/python-compizconfig.install 2014-11-25 19:25:20 +0000 |
513 | +++ debian/python-compizconfig.install 1970-01-01 00:00:00 +0000 |
514 | @@ -1,3 +0,0 @@ |
515 | -usr/lib/*/*/compizconfig.*.so |
516 | -usr/lib/*/pkgconfig/compizconfig-python.pc |
517 | -usr/lib/*/dist-packages/compizconfig_python* |
518 | |
519 | === removed file 'debian/python-compizconfig.lintian-overrides' |
520 | --- debian/python-compizconfig.lintian-overrides 2012-06-19 11:22:48 +0000 |
521 | +++ debian/python-compizconfig.lintian-overrides 1970-01-01 00:00:00 +0000 |
522 | @@ -1,1 +0,0 @@ |
523 | -python-compizconfig: binary-or-shlib-defines-rpath |
524 | |
525 | === added file 'debian/python3-compizconfig.install' |
526 | --- debian/python3-compizconfig.install 1970-01-01 00:00:00 +0000 |
527 | +++ debian/python3-compizconfig.install 2018-09-05 09:24:50 +0000 |
528 | @@ -0,0 +1,2 @@ |
529 | +usr/lib/*/*/compizconfig.so |
530 | +usr/lib/*/dist-packages/compizconfig_python* |
531 | |
532 | === modified file 'debian/rules' |
533 | --- debian/rules 2018-08-28 09:03:07 +0000 |
534 | +++ debian/rules 2018-09-05 09:24:50 +0000 |
535 | @@ -5,7 +5,6 @@ |
536 | |
537 | include /usr/share/dpkg/architecture.mk |
538 | |
539 | -python2_version := $(shell pyversions --requested --version debian/control) |
540 | gles2_architectures := armel armhf |
541 | build_testing := OFF |
542 | |
543 | @@ -59,11 +58,6 @@ |
544 | # work around having a file with a conflicted special name (#1156294) |
545 | cp debian/compizconfig debian/tmp/config |
546 | |
547 | - # accommodate Python's just-gotta-be-different approach to multi-arch |
548 | - python2_dir=debian/tmp/usr/lib/python$(python2_version)/dist-packages; \ |
549 | - mv $${python2_dir}/compizconfig.so \ |
550 | - $${python2_dir}/compizconfig.$(DEB_HOST_MULTIARCH).so |
551 | - |
552 | dh_install --fail-missing |
553 | |
554 | # remove the compizconfig dev file from compiz-dev |
555 | @@ -76,5 +70,5 @@ |
556 | dh_auto_test --no-parallel |
557 | |
558 | %: |
559 | - dh $@ --parallel --with python2,migrations,translations |
560 | + dh $@ --parallel --with python3,migrations,translations |
561 |
The code changes look good to me.
Wuth regards to debian packaging, I have not tested it yet but added some comments anyway.