/usr/share/pyshared/mousetrap/ocvfw/pocv.py is in gnome-mousetrap 0.4-2ubuntu1.
This file is owned by root:root, with mode 0o755.
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 | # -*- coding: utf-8 -*-
# Ocvfw
#
# Copyright 2009 Flavio Percoco Premoli
#
# This file is part of Ocvfw.
#
# Ocvfw is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published
# by the Free Software Foundation.
#
# Ocvfw 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 Ocvfw. If not, see <http://www.gnu.org/licenses/>>.
"""Python Opencv Handler."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2008 Flavio Percoco Premoli"
__license__ = "GPLv2"
import os
import re
def get_idm(idm):
"""
Returns the idm's class instance.
Arguments:
- idm: The requested idm.
"""
return __import__("mousetrap.ocvfw.idm.%s" % idm,
globals(),
locals(),
[''])
def get_idms_list():
reg = re.compile(r'([A-Za-z0-9]+)\.py$', re.DOTALL)
dirname = os.path.dirname(__file__)
return [ mod[0] for mod in [ reg.findall(f) for f in os.listdir("%s/idm/" % dirname)] if mod ]
def get_idm_inf(idm):
try:
tmp = __import__("mousetrap.ocvfw.idm.%s" % idm,
globals(),
locals(),
[''])
return { "name" : tmp.a_name, "dsc" : tmp.a_description, "stgs" : tmp.a_settings}
except:
print("Problems loading mousetrap.ocvfw.idm.%s" % idm)
|