/usr/share/cinnamon/cinnamon-settings/bin/capi.py is in cinnamon-common 3.6.7-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # Copyright (C) 2007-2010 www.stani.be
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/
from __future__ import print_function
import platform
import os
from gi.repository import Gio, GObject
class CManager():
def __init__(self):
self.extension_point = Gio.io_extension_point_register("cinnamon-control-center-1")
self.modules = []
architecture = platform.machine()
paths = ["/usr/lib"]
# On x86 archs, iterate through multiple paths
# For instance, on a Mint i686 box, the path is actually /usr/lib/i386-linux-gnu
x86archs = ["i386", "i486", "i586", "i686"]
if architecture in x86archs:
for arch in x86archs:
paths += ["/usr/lib/%s" % arch, "/usr/lib/%s-linux-gnu" % arch]
elif architecture == "x86_64":
paths += ["/usr/lib/x86_64", "/usr/lib/x86_64-linux-gnu", "/usr/lib64"]
else:
paths += ["/usr/lib/%s" % architecture, "/usr/lib/%s-linux-gnu" % architecture]
for path in paths:
if not os.path.islink(path):
path = os.path.join(path, "cinnamon-control-center-1/panels")
if os.path.exists(path):
try:
self.modules = self.modules + Gio.io_modules_load_all_in_directory(path)
except Exception as e:
print("capi failed to load multiarch modules from %s: " % path, e)
def get_c_widget(self, mod_id):
extension = self.extension_point.get_extension_by_name(mod_id)
if extension is None:
print("Could not load %s module; is the cinnamon-control-center package installed?" % mod_id)
return None
panel_type = extension.get_type()
return GObject.new(panel_type)
def lookup_c_module(self, mod_id):
extension = self.extension_point.get_extension_by_name(mod_id)
if extension is None:
print("Could not find %s module; is the cinnamon-control-center package installed?" % mod_id)
return False
else:
return True
|