pax_global_header 0000666 0000000 0000000 00000000064 14650545052 0014520 g ustar 00root root 0000000 0000000 52 comment=9bf5da8b2e1e6a0caf18568d688e8d1ac3c12481
blueman-2.4.3/ 0000775 0000000 0000000 00000000000 14650545052 0013151 5 ustar 00root root 0000000 0000000 blueman-2.4.3/ABOUT-NLS 0000664 0000000 0000000 00000267741 14650545052 0014421 0 ustar 00root root 0000000 0000000 1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is a
way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this 'ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU 'gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU 'gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
1.1 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU 'gettext'. Other packages have their own ways to
internationalization, predating GNU 'gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU 'gettext' functions. Installers may use special
options at configuration time for changing the default behaviour. The
command:
./configure --disable-nls
will _totally_ disable translation of messages.
When you already have GNU 'gettext' installed on your system and run
configure without an option for your new package, 'configure' will
probably detect the previously built and installed 'libintl' library and
will decide to use it. If not, you may have to to use the
'--with-libintl-prefix' option to tell 'configure' where to look for it.
Internationalized packages usually have many 'po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at 'configure' time by using the
'--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable 'LINGUAS'
may be set, prior to configuration, to limit the installed set.
'LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.2 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the 'LANG' environment variable to the appropriate
'LL_CC' combination. If you happen to have the 'LC_ALL' or some other
'LC_xxx' environment variables set, you should unset them before setting
'LANG', otherwise the setting of 'LANG' will not have the desired
effect. Here 'LL' is an ISO 639 two-letter language code, and 'CC' is
an ISO 3166 two-letter country code. For example, let's suppose that
you speak German and live in Germany. At the shell prompt, merely
execute 'setenv LANG de_DE' (in 'csh'), 'export LANG; LANG=de_DE' (in
'sh') or 'export LANG=de_DE' (in 'bash'). This can be done from your
'.login' or '.profile' file, once and for all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, 'de_AT' is used for Austria, and 'pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of 'LL_CC', with 'LL' denoting the
language and 'CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are used,
such as 'LL' or 'LL_CC.ENCODING'. You can get the list of locales
supported by your system for your language by running the command
'locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
'LANGUAGE'. GNU 'gettext' gives preference to 'LANGUAGE' over 'LANG'
for the purpose of message handling, but you still need to have 'LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather read
translations in German than English for when Swedish is not available,
set 'LANGUAGE' to 'sv:de' while leaving 'LANG' to 'sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from 'no' to 'nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under 'nb' and some older ones under 'no', it's recommended
for Norwegian users to set 'LANGUAGE' to 'nb:no' so that both newer and
older translations are used.
In the 'LANGUAGE' environment variable, but not in the 'LANG'
environment variable, 'LL_CC' combinations can be abbreviated as 'LL' to
denote the language's main dialect. For example, 'de' is equivalent to
'de_DE' (German as spoken in Germany), and 'pt' to 'pt_PT' (Portuguese
as spoken in Portugal) in this context.
1.3 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
'http://translationproject.org/', in the "Teams" area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
'-request' appended. For example, speakers of Swedish can send a
message to 'sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate _actively_
in translations, or at solving translational difficulties, rather than
merely lurking around. If your team does not exist yet and you want to
start one, or if you are unsure about what to do or how to get started,
please write to 'coordinator@translationproject.org' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skills are praised more than
programming skills, here.
1.4 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of Jun 2014.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am an ar as ast az be bg bn bn_IN bs ca crh cs
+---------------------------------------------------+
a2ps | [] [] [] |
aegis | |
anubis | |
aspell | [] [] [] |
bash | [] [] [] |
bfd | |
binutils | [] |
bison | |
bison-runtime | [] |
buzztrax | [] |
ccd2cue | |
ccide | |
cflow | |
clisp | |
coreutils | [] [] |
cpio | |
cppi | |
cpplib | [] |
cryptsetup | [] |
datamash | |
denemo | [] [] |
dfarc | [] |
dialog | [] [] [] |
dico | |
diffutils | [] |
dink | [] |
direvent | |
doodle | [] |
dos2unix | |
dos2unix-man | |
e2fsprogs | [] [] |
enscript | [] |
exif | [] |
fetchmail | [] [] |
findutils | [] |
flex | [] |
freedink | [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | [] |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] |
gjay | |
glunarclock | [] [] [] |
gnubiff | [] |
gnubik | [] |
gnucash | () () [] |
gnuchess | |
gnulib | [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] |
gprof | [] |
gramadoir | |
grep | [] [] [] |
grub | [] |
gsasl | |
gss | |
gst-plugins-bad | [] |
gst-plugins-base | [] [] [] |
gst-plugins-good | [] [] [] |
gst-plugins-ugly | [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] |
gtkam | [] [] |
gtkspell | [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] |
hello | [] |
help2man | |
help2man-texi | |
hylafax | |
idutils | |
iso_15924 | [] |
iso_3166 | [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
iso_639_5 | |
jwhois | |
kbd | [] |
klavaro | [] [] [] [] [] |
latrine | |
ld | [] |
leafpad | [] [] [] [] |
libc | [] [] [] |
libexif | () |
libextractor | |
libgnutls | [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | |
libiconv | [] [] |
libidn | [] |
liferea | [] [] [] [] |
lilypond | [] [] |
lordsawar | [] |
lprng | |
lynx | [] [] |
m4 | [] |
mailfromd | |
mailutils | |
make | [] |
man-db | [] [] |
man-db-manpages | |
midi-instruments | [] [] [] |
minicom | [] |
mkisofs | [] |
myserver | [] |
nano | [] [] [] |
opcodes | |
parted | [] |
pies | |
popt | [] |
procps-ng | |
procps-ng-man | |
psmisc | [] |
pspp | [] |
pushover | [] |
pwdutils | |
pyspread | |
radius | [] |
recode | [] [] [] |
recutils | |
rpm | |
rush | |
sarg | |
sed | [] [] [] |
sharutils | [] |
shishi | |
skribilo | |
solfege | [] |
solfege-manual | |
spotmachine | |
sudo | [] [] |
sudoers | [] [] |
sysstat | [] |
tar | [] [] [] |
texinfo | [] [] |
texinfo_document | [] |
tigervnc | [] |
tin | |
tin-man | |
tracgoogleappsa... | |
trader | |
util-linux | [] |
ve | |
vice | |
vmm | |
vorbis-tools | [] |
wastesedge | |
wcd | |
wcd-man | |
wdiff | [] [] |
wget | [] |
wyslij-po | |
xboard | |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+---------------------------------------------------+
af am an ar as ast az be bg bn bn_IN bs ca crh cs
4 0 2 5 3 11 0 8 23 3 3 1 54 4 73
da de el en en_GB en_ZA eo es et eu fa fi fr
+--------------------------------------------------+
a2ps | [] [] [] [] [] [] [] [] [] |
aegis | [] [] [] [] |
anubis | [] [] [] [] [] |
aspell | [] [] [] [] [] [] [] |
bash | [] [] [] |
bfd | [] [] [] [] |
binutils | [] [] [] |
bison | [] [] [] [] [] [] [] [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | [] [] [] [] |
ccd2cue | [] [] [] |
ccide | [] [] [] [] [] [] |
cflow | [] [] [] [] [] |
clisp | [] [] [] [] [] |
coreutils | [] [] [] [] [] |
cpio | [] [] [] [] [] |
cppi | [] [] [] [] [] |
cpplib | [] [] [] [] [] [] |
cryptsetup | [] [] [] [] [] |
datamash | [] [] [] [] |
denemo | [] |
dfarc | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] [] [] |
dico | [] [] [] [] |
diffutils | [] [] [] [] [] [] |
dink | [] [] [] [] [] [] |
direvent | [] [] [] [] |
doodle | [] [] [] [] |
dos2unix | [] [] [] [] [] |
dos2unix-man | [] [] [] |
e2fsprogs | [] [] [] [] [] |
enscript | [] [] [] [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] () [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] |
flex | [] [] [] [] [] [] |
freedink | [] [] [] [] [] [] [] [] |
fusionforge | [] [] [] |
gas | [] [] [] |
gawk | [] [] [] [] [] |
gcal | [] [] [] [] |
gcc | [] [] |
gdbm | [] [] [] [] [] |
gettext-examples | [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] |
gjay | [] [] [] [] |
glunarclock | [] [] [] [] [] |
gnubiff | () [] [] () |
gnubik | [] [] [] [] [] |
gnucash | [] () () () () () () |
gnuchess | [] [] [] [] |
gnulib | [] [] [] [] [] [] [] |
gnunet | [] |
gnunet-gtk | [] |
gold | [] [] [] |
gphoto2 | [] () [] [] |
gprof | [] [] [] [] [] [] |
gramadoir | [] [] [] [] [] |
grep | [] [] [] [] [] [] [] |
grub | [] [] [] [] [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] [] [] |
gst-plugins-bad | [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] [] [] |
gtick | [] () [] [] [] |
gtkam | [] () [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] |
guix | [] [] |
guix-packages | |
gutenprint | [] [] [] [] |
hello | [] [] [] [] [] [] [] [] |
help2man | [] [] [] [] [] [] [] |
help2man-texi | [] [] [] |
hylafax | [] [] |
idutils | [] [] [] [] [] |
iso_15924 | [] () [] [] () [] () |
iso_3166 | [] () [] [] [] [] () [] () |
iso_3166_2 | [] () () () |
iso_4217 | [] () [] [] [] () [] () |
iso_639 | [] () [] [] () [] () |
iso_639_3 | () () () |
iso_639_5 | () () () |
jwhois | [] [] [] [] [] |
kbd | [] [] [] [] [] [] |
klavaro | [] [] [] [] [] [] [] |
latrine | [] () [] [] |
ld | [] [] [] [] |
leafpad | [] [] [] [] [] [] [] [] |
libc | [] [] [] [] [] |
libexif | [] [] () [] [] |
libextractor | [] |
libgnutls | [] [] [] [] |
libgphoto2 | [] () [] |
libgphoto2_port | [] () [] [] [] [] |
libgsasl | [] [] [] [] [] |
libiconv | [] [] [] [] [] [] [] |
libidn | [] [] [] [] [] |
liferea | [] () [] [] [] [] [] |
lilypond | [] [] [] [] [] [] |
lordsawar | [] [] |
lprng | |
lynx | [] [] [] [] [] [] |
m4 | [] [] [] [] [] [] |
mailfromd | [] |
mailutils | [] [] [] [] |
make | [] [] [] [] [] |
man-db | [] [] [] [] |
man-db-manpages | [] [] |
midi-instruments | [] [] [] [] [] [] [] [] [] |
minicom | [] [] [] [] [] |
mkisofs | [] [] [] |
myserver | [] [] [] [] |
nano | [] [] [] [] [] [] [] |
opcodes | [] [] [] [] [] |
parted | [] [] [] |
pies | [] |
popt | [] [] [] [] [] [] |
procps-ng | [] [] |
procps-ng-man | [] [] |
psmisc | [] [] [] [] [] [] [] |
pspp | [] [] [] |
pushover | () [] [] [] |
pwdutils | [] [] [] |
pyspread | [] [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] |
recutils | [] [] [] [] |
rpm | [] [] [] [] [] |
rush | [] [] [] |
sarg | [] [] |
sed | [] [] [] [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | [] [] [] |
skribilo | [] [] |
solfege | [] [] [] [] [] [] [] [] |
solfege-manual | [] [] [] [] [] |
spotmachine | [] [] [] [] |
sudo | [] [] [] [] [] [] |
sudoers | [] [] [] [] [] [] |
sysstat | [] [] [] [] [] [] |
tar | [] [] [] [] [] [] [] |
texinfo | [] [] [] [] [] |
texinfo_document | [] [] [] [] |
tigervnc | [] [] [] [] [] [] |
tin | [] [] [] [] |
tin-man | [] |
tracgoogleappsa... | [] [] [] [] [] |
trader | [] [] [] [] [] [] |
util-linux | [] [] [] [] |
ve | [] [] [] [] [] |
vice | () () () |
vmm | [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | [] () |
wcd | [] [] [] [] |
wcd-man | [] |
wdiff | [] [] [] [] [] [] [] |
wget | [] [] [] [] [] [] |
wyslij-po | [] [] [] [] |
xboard | [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] [] [] |
+--------------------------------------------------+
da de el en en_GB en_ZA eo es et eu fa fi fr
120 130 32 1 6 0 94 95 22 13 4 103 136
ga gd gl gu he hi hr hu hy ia id is it ja ka kk
+-------------------------------------------------+
a2ps | [] [] [] [] |
aegis | [] |
anubis | [] [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] [] |
bfd | [] [] |
binutils | [] [] [] |
bison | [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | |
ccd2cue | [] |
ccide | [] [] |
cflow | [] [] [] |
clisp | |
coreutils | [] [] [] |
cpio | [] [] [] [] [] [] |
cppi | [] [] [] [] [] |
cpplib | [] [] |
cryptsetup | [] |
datamash | |
denemo | [] |
dfarc | [] [] [] |
dialog | [] [] [] [] [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] |
dink | [] |
direvent | [] |
doodle | [] [] |
dos2unix | [] [] |
dos2unix-man | |
e2fsprogs | [] |
enscript | [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] [] [] |
findutils | [] [] [] [] [] [] [] |
flex | [] |
freedink | [] [] [] [] |
fusionforge | |
gas | [] |
gawk | [] () [] |
gcal | |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] |
gjay | [] |
glunarclock | [] [] [] [] [] [] |
gnubiff | [] [] () |
gnubik | [] [] [] |
gnucash | () () () () () [] |
gnuchess | |
gnulib | [] [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] [] |
grep | [] [] [] [] [] [] [] |
grub | [] [] [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] [] [] |
gst-plugins-bad | [] |
gst-plugins-base | [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] [] [] |
gtkam | [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] [] [] |
hello | [] [] [] [] [] |
help2man | [] [] [] |
help2man-texi | |
hylafax | [] |
idutils | [] [] |
iso_15924 | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | [] [] |
iso_4217 | [] [] [] [] [] [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
iso_639_5 | |
jwhois | [] [] [] [] |
kbd | [] [] [] |
klavaro | [] [] [] [] [] |
latrine | [] |
ld | [] [] [] [] |
leafpad | [] [] [] [] [] [] [] () |
libc | [] [] [] [] [] |
libexif | [] |
libextractor | |
libgnutls | [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] [] [] |
libidn | [] [] [] [] |
liferea | [] [] [] [] [] |
lilypond | [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | |
mailutils | |
make | [] [] [] [] |
man-db | [] [] |
man-db-manpages | [] [] |
midi-instruments | [] [] [] [] [] [] [] [] [] |
minicom | [] [] [] |
mkisofs | [] [] |
myserver | [] |
nano | [] [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] |
pies | |
popt | [] [] [] [] [] [] [] [] [] [] |
procps-ng | |
procps-ng-man | |
psmisc | [] [] [] [] |
pspp | [] [] |
pushover | [] |
pwdutils | [] |
pyspread | |
radius | [] |
recode | [] [] [] [] [] [] [] |
recutils | |
rpm | [] |
rush | [] |
sarg | |
sed | [] [] [] [] [] [] [] |
sharutils | |
shishi | |
skribilo | [] |
solfege | [] [] |
solfege-manual | |
spotmachine | |
sudo | [] [] [] [] |
sudoers | [] [] [] |
sysstat | [] [] [] |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] [] |
tigervnc | |
tin | |
tin-man | |
tracgoogleappsa... | [] [] [] [] |
trader | [] [] |
util-linux | [] |
ve | [] |
vice | () () |
vmm | |
vorbis-tools | [] [] |
wastesedge | () |
wcd | |
wcd-man | |
wdiff | [] [] [] |
wget | [] [] [] |
wyslij-po | [] [] [] |
xboard | |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] |
+-------------------------------------------------+
ga gd gl gu he hi hr hu hy ia id is it ja ka kk
35 2 47 4 8 2 53 69 2 6 80 11 86 58 0 3
kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl
+--------------------------------------------------+
a2ps | [] [] |
aegis | [] |
anubis | [] [] [] |
aspell | [] [] |
bash | [] [] |
bfd | |
binutils | |
bison | [] |
bison-runtime | [] [] [] [] [] [] |
buzztrax | |
ccd2cue | |
ccide | [] [] |
cflow | [] |
clisp | [] |
coreutils | [] [] |
cpio | [] |
cppi | |
cpplib | [] |
cryptsetup | [] |
datamash | [] [] |
denemo | |
dfarc | [] [] |
dialog | [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] |
dink | [] |
direvent | [] |
doodle | [] |
dos2unix | [] [] |
dos2unix-man | [] |
e2fsprogs | [] |
enscript | [] |
exif | [] [] |
fetchmail | [] |
findutils | [] [] |
flex | [] |
freedink | [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] |
gettext-tools | [] |
gjay | |
glunarclock | [] [] |
gnubiff | [] |
gnubik | [] [] |
gnucash | () () () () () () () [] |
gnuchess | [] [] |
gnulib | [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] |
gprof | [] [] |
gramadoir | [] |
grep | [] [] |
grub | [] [] [] |
gsasl | [] |
gss | |
gst-plugins-bad | [] [] |
gst-plugins-base | [] [] [] |
gst-plugins-good | [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | [] [] |
gtick | [] |
gtkam | [] [] |
gtkspell | [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] |
hello | [] [] [] |
help2man | [] |
help2man-texi | |
hylafax | [] |
idutils | [] |
iso_15924 | () [] [] |
iso_3166 | [] [] [] () [] [] [] [] [] [] |
iso_3166_2 | () [] |
iso_4217 | () [] [] [] |
iso_639 | [] [] () [] [] [] [] |
iso_639_3 | [] () [] |
iso_639_5 | () |
jwhois | [] [] |
kbd | [] |
klavaro | [] [] |
latrine | |
ld | |
leafpad | [] [] [] [] [] |
libc | [] [] |
libexif | [] |
libextractor | [] |
libgnutls | [] [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | [] |
libiconv | [] [] |
libidn | [] |
liferea | [] [] [] |
lilypond | [] |
lordsawar | |
lprng | |
lynx | [] |
m4 | [] |
mailfromd | |
mailutils | |
make | [] [] |
man-db | [] |
man-db-manpages | [] |
midi-instruments | [] [] [] [] [] [] [] |
minicom | [] |
mkisofs | [] |
myserver | |
nano | [] [] [] |
opcodes | [] |
parted | [] |
pies | |
popt | [] [] [] [] [] |
procps-ng | |
procps-ng-man | |
psmisc | [] |
pspp | [] [] |
pushover | |
pwdutils | [] |
pyspread | |
radius | [] |
recode | [] [] |
recutils | [] |
rpm | [] |
rush | [] |
sarg | |
sed | [] [] |
sharutils | [] |
shishi | |
skribilo | |
solfege | [] [] |
solfege-manual | [] |
spotmachine | [] |
sudo | [] [] |
sudoers | [] [] |
sysstat | [] [] |
tar | [] [] [] |
texinfo | [] |
texinfo_document | [] |
tigervnc | [] |
tin | |
tin-man | |
tracgoogleappsa... | [] [] [] |
trader | [] |
util-linux | [] |
ve | [] |
vice | [] |
vmm | [] |
vorbis-tools | [] |
wastesedge | [] |
wcd | [] |
wcd-man | [] |
wdiff | [] |
wget | [] [] |
wyslij-po | [] |
xboard | [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+--------------------------------------------------+
kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl
5 11 4 6 0 13 22 3 3 3 4 11 2 40 1 124
nn or os pa pl ps pt pt_BR ro ru rw sk sl sq sr
+--------------------------------------------------+
a2ps | [] [] [] [] [] [] [] |
aegis | [] [] |
anubis | [] [] [] |
aspell | [] [] [] [] [] [] [] |
bash | [] [] [] [] [] |
bfd | [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | |
ccd2cue | [] |
ccide | [] [] [] |
cflow | [] [] |
clisp | [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
cppi | [] [] [] |
cpplib | [] [] [] |
cryptsetup | [] [] |
datamash | [] [] |
denemo | |
dfarc | [] [] [] |
dialog | [] [] [] [] [] [] [] |
dico | [] |
diffutils | [] [] |
dink | |
direvent | [] [] |
doodle | [] [] |
dos2unix | [] [] [] [] |
dos2unix-man | [] [] |
e2fsprogs | [] |
enscript | [] [] [] [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] [] |
freedink | [] [] [] [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | |
gcc | |
gdbm | [] [] [] |
gettext-examples | [] [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gjay | [] |
glunarclock | [] [] [] [] [] [] |
gnubiff | [] |
gnubik | [] [] [] [] |
gnucash | () () () () [] |
gnuchess | [] [] |
gnulib | [] [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
grub | [] [] [] [] [] |
gsasl | [] [] [] |
gss | [] [] [] [] |
gst-plugins-bad | [] [] [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] [] [] |
gtick | [] [] [] [] [] |
gtkam | [] [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] [] |
hello | [] [] [] [] [] [] |
help2man | [] [] [] [] |
help2man-texi | [] |
hylafax | |
idutils | [] [] [] |
iso_15924 | [] () [] [] [] [] |
iso_3166 | [] [] [] [] () [] [] [] [] [] [] [] [] |
iso_3166_2 | [] () [] |
iso_4217 | [] [] () [] [] [] [] [] |
iso_639 | [] [] [] () [] [] [] [] [] [] |
iso_639_3 | [] () |
iso_639_5 | () [] |
jwhois | [] [] [] [] |
kbd | [] [] |
klavaro | [] [] [] [] [] |
latrine | [] |
ld | |
leafpad | [] [] [] [] [] [] [] [] [] |
libc | [] [] [] |
libexif | [] () [] |
libextractor | [] |
libgnutls | [] |
libgphoto2 | [] |
libgphoto2_port | [] [] [] [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | [] [] [] |
liferea | [] [] [] [] () [] [] |
lilypond | |
lordsawar | |
lprng | [] |
lynx | [] [] |
m4 | [] [] [] [] [] |
mailfromd | [] |
mailutils | [] |
make | [] [] [] |
man-db | [] [] [] |
man-db-manpages | [] [] [] |
midi-instruments | [] [] [] [] [] [] [] [] |
minicom | [] [] [] [] |
mkisofs | [] [] [] |
myserver | [] [] |
nano | [] [] [] [] [] [] |
opcodes | |
parted | [] [] [] [] [] [] |
pies | [] |
popt | [] [] [] [] [] [] |
procps-ng | [] |
procps-ng-man | [] |
psmisc | [] [] [] [] |
pspp | [] [] |
pushover | |
pwdutils | [] |
pyspread | [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] [] |
recutils | [] |
rpm | [] |
rush | [] [] [] |
sarg | [] [] |
sed | [] [] [] [] [] [] [] [] |
sharutils | [] [] [] |
shishi | [] [] |
skribilo | |
solfege | [] [] [] |
solfege-manual | [] [] |
spotmachine | [] [] |
sudo | [] [] [] [] [] [] |
sudoers | [] [] [] [] |
sysstat | [] [] [] [] [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] [] |
tigervnc | [] |
tin | [] |
tin-man | |
tracgoogleappsa... | [] [] [] [] |
trader | [] |
util-linux | [] [] |
ve | [] [] [] |
vice | |
vmm | |
vorbis-tools | [] [] [] |
wastesedge | |
wcd | |
wcd-man | |
wdiff | [] [] [] [] [] |
wget | [] [] [] [] |
wyslij-po | [] [] [] [] |
xboard | [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] |
+--------------------------------------------------+
nn or os pa pl ps pt pt_BR ro ru rw sk sl sq sr
7 3 1 6 114 1 12 83 32 80 3 38 45 7 94
sv sw ta te tg th tr uk ur vi wa wo zh_CN zh_HK
+---------------------------------------------------+
a2ps | [] [] [] [] [] |
aegis | [] |
anubis | [] [] [] [] |
aspell | [] [] [] [] |
bash | [] [] [] [] |
bfd | [] [] |
binutils | [] [] [] |
bison | [] [] [] [] |
bison-runtime | [] [] [] [] [] [] |
buzztrax | [] [] [] |
ccd2cue | [] [] [] |
ccide | [] [] [] [] |
cflow | [] [] [] [] |
clisp | |
coreutils | [] [] [] [] |
cpio | [] [] [] [] [] |
cppi | [] [] [] [] |
cpplib | [] [] [] [] [] |
cryptsetup | [] [] [] |
datamash | [] [] [] |
denemo | |
dfarc | [] |
dialog | [] [] [] [] [] [] |
dico | [] |
diffutils | [] [] [] [] [] |
dink | |
direvent | [] [] |
doodle | [] [] |
dos2unix | [] [] [] [] |
dos2unix-man | [] [] [] |
e2fsprogs | [] [] [] [] |
enscript | [] [] [] [] |
exif | [] [] [] [] [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] |
freedink | [] [] |
fusionforge | |
gas | [] |
gawk | [] [] |
gcal | [] [] |
gcc | [] [] |
gdbm | [] [] |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] |
gjay | [] [] |
glunarclock | [] [] [] [] |
gnubiff | [] [] |
gnubik | [] [] [] [] |
gnucash | () () () () [] |
gnuchess | [] [] |
gnulib | [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] [] |
grep | [] [] [] [] [] |
grub | [] [] [] [] |
gsasl | [] [] [] [] |
gss | [] [] [] |
gst-plugins-bad | [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] |
gtkam | [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] |
guix | [] |
guix-packages | |
gutenprint | [] [] [] [] |
hello | [] [] [] [] [] [] |
help2man | [] [] [] |
help2man-texi | [] |
hylafax | [] |
idutils | [] [] [] |
iso_15924 | [] () [] [] () [] |
iso_3166 | [] [] () [] [] () [] [] [] |
iso_3166_2 | () [] [] () [] |
iso_4217 | [] () [] [] () [] [] |
iso_639 | [] [] [] () [] [] () [] [] [] |
iso_639_3 | [] () [] [] () |
iso_639_5 | () [] () |
jwhois | [] [] [] [] |
kbd | [] [] [] |
klavaro | [] [] [] [] [] [] |
latrine | [] [] |
ld | [] [] [] [] [] |
leafpad | [] [] [] [] [] [] |
libc | [] [] [] [] [] |
libexif | [] () |
libextractor | [] [] |
libgnutls | [] [] [] [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | () [] [] [] |
liferea | [] [] [] [] [] |
lilypond | [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] |
m4 | [] [] [] |
mailfromd | [] [] |
mailutils | [] |
make | [] [] [] [] |
man-db | [] [] |
man-db-manpages | [] |
midi-instruments | [] [] [] [] [] [] |
minicom | [] [] |
mkisofs | [] [] [] |
myserver | [] |
nano | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] [] |
pies | [] [] |
popt | [] [] [] [] [] [] [] |
procps-ng | [] [] |
procps-ng-man | [] |
psmisc | [] [] [] [] |
pspp | [] [] [] |
pushover | [] |
pwdutils | [] [] |
pyspread | [] |
radius | [] [] |
recode | [] [] [] [] |
recutils | [] [] [] |
rpm | [] [] [] [] |
rush | [] [] |
sarg | |
sed | [] [] [] [] [] |
sharutils | [] [] [] |
shishi | [] [] |
skribilo | [] |
solfege | [] [] [] |
solfege-manual | [] |
spotmachine | [] [] [] |
sudo | [] [] [] [] |
sudoers | [] [] [] |
sysstat | [] [] [] [] [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] |
tigervnc | [] [] |
tin | [] |
tin-man | |
tracgoogleappsa... | [] [] [] [] [] |
trader | [] |
util-linux | [] [] [] |
ve | [] [] [] [] |
vice | () () |
vmm | |
vorbis-tools | [] [] |
wastesedge | |
wcd | [] [] [] |
wcd-man | [] |
wdiff | [] [] [] [] |
wget | [] [] [] |
wyslij-po | [] [] |
xboard | [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] |
+---------------------------------------------------+
sv sw ta te tg th tr uk ur vi wa wo zh_CN zh_HK
91 1 4 3 0 13 50 113 1 126 7 1 95 7
zh_TW
+-------+
a2ps | | 30
aegis | | 9
anubis | | 19
aspell | | 28
bash | [] | 21
bfd | | 9
binutils | | 12
bison | [] | 18
bison-runtime | [] | 38
buzztrax | | 8
ccd2cue | | 8
ccide | | 17
cflow | | 15
clisp | | 10
coreutils | | 20
cpio | | 20
cppi | | 17
cpplib | [] | 19
cryptsetup | | 13
datamash | | 11
denemo | | 4
dfarc | | 16
dialog | [] | 42
dico | | 6
diffutils | | 21
dink | | 9
direvent | | 10
doodle | | 12
dos2unix | [] | 18
dos2unix-man | | 9
e2fsprogs | | 14
enscript | | 21
exif | | 26
fetchmail | | 19
findutils | | 28
flex | [] | 19
freedink | | 23
fusionforge | | 3
gas | | 5
gawk | | 12
gcal | | 7
gcc | | 4
gdbm | | 10
gettext-examples | [] | 40
gettext-runtime | [] | 34
gettext-tools | [] | 24
gjay | | 8
glunarclock | [] | 27
gnubiff | | 9
gnubik | | 19
gnucash | () | 7
gnuchess | | 10
gnulib | | 23
gnunet | | 1
gnunet-gtk | | 1
gold | | 7
gphoto2 | [] | 19
gprof | | 21
gramadoir | | 14
grep | [] | 31
grub | | 21
gsasl | [] | 19
gss | | 17
gst-plugins-bad | | 14
gst-plugins-base | | 27
gst-plugins-good | | 32
gst-plugins-ugly | | 34
gstreamer | [] | 31
gtick | | 19
gtkam | | 24
gtkspell | [] | 48
guix | | 3
guix-packages | | 0
gutenprint | | 15
hello | [] | 30
help2man | | 18
help2man-texi | | 5
hylafax | | 5
idutils | | 14
iso_15924 | [] | 23
iso_3166 | [] | 58
iso_3166_2 | | 9
iso_4217 | [] | 28
iso_639 | [] | 46
iso_639_3 | | 10
iso_639_5 | | 2
jwhois | [] | 20
kbd | | 16
klavaro | | 30
latrine | | 7
ld | [] | 15
leafpad | [] | 40
libc | [] | 24
libexif | | 9
libextractor | | 5
libgnutls | | 13
libgphoto2 | | 9
libgphoto2_port | [] | 19
libgsasl | | 18
libiconv | [] | 29
libidn | | 17
liferea | | 29
lilypond | | 11
lordsawar | | 3
lprng | | 3
lynx | | 19
m4 | [] | 22
mailfromd | | 4
mailutils | | 6
make | | 19
man-db | | 14
man-db-manpages | | 9
midi-instruments | [] | 43
minicom | [] | 17
mkisofs | | 13
myserver | | 9
nano | [] | 29
opcodes | | 12
parted | [] | 21
pies | | 4
popt | [] | 36
procps-ng | | 5
procps-ng-man | | 4
psmisc | [] | 22
pspp | | 13
pushover | | 6
pwdutils | | 8
pyspread | | 6
radius | | 9
recode | | 31
recutils | | 9
rpm | [] | 13
rush | | 10
sarg | | 4
sed | [] | 34
sharutils | | 12
shishi | | 7
skribilo | | 4
solfege | | 19
solfege-manual | | 9
spotmachine | | 10
sudo | | 24
sudoers | | 20
sysstat | | 22
tar | [] | 30
texinfo | | 17
texinfo_document | | 11
tigervnc | | 11
tin | [] | 7
tin-man | | 1
tracgoogleappsa... | [] | 22
trader | | 11
util-linux | | 12
ve | | 14
vice | | 1
vmm | | 3
vorbis-tools | | 13
wastesedge | | 2
wcd | | 8
wcd-man | | 3
wdiff | [] | 23
wget | | 19
wyslij-po | | 14
xboard | | 9
xdg-user-dirs | [] | 68
xkeyboard-config | [] | 27
+-------+
90 teams zh_TW
166 domains 42 2748
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and distributed
as such by its maintainer. There might be an observable lag between the
mere existence a PO file and its wide availability in a distribution.
If Jun 2014 seems to be old, you may fetch a more recent copy of this
'ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix
with full percentage details can be found at
'http://translationproject.org/extra/matrix.html'.
1.5 Using 'gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU 'gettext' in your
package. Of course you have to respect the GNU Lesser General Public
License which covers the use of the GNU 'gettext' library. This means
in particular that even non-free programs can use 'libintl' as a shared
library, whereas only free software can use 'libintl' as a static
library or use modified versions of 'libintl'.
Once the sources are changed appropriately and the setup can handle
the use of 'gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
'coordinator@translationproject.org' to make the '.pot' files available
to the translation teams.
blueman-2.4.3/CHANGELOG.md 0000664 0000000 0000000 00000051121 14650545052 0014762 0 ustar 00root root 0000000 0000000 # Changelog
## 2.4.3
### Bugs fixed
* Issues with specific device names
* Deadlock between applet and manager when double-clicking the tray icon
### Changes
* Translation updates
## 2.4.2
### New features
* An option to toggle the manager window with the tray icon (the 2.3 behavior useful when there are no window decorations for closing it)
### Changes
* Only a single battery notification
* Renamed recent connections header in applet menu
* Translation updates
### Bugs fixed
* Broken audio profile applet menu items
* Missing manager window title
* Teardown of DBus mock server in tests
## 2.4.1
### Changes
* Translation updates
* Handle incompabilities with kded6 running on desktops without StatusNotifierItem support
### Bugs fixed
* Fallback for missing icons
* Correct Bluetooth state tracking in manager window
* Sporadic error on battery data (Note that there was a regression in Linux 6.8.2, 6.7.11, 6.6.23 and 6.1.83 that causes it and lots of other trouble)
* Active state on tray icon
* Broken markup in tray menu
## 2.4
### New features
* Audio profile switcher in applet menu (@abhijeetviswa)
* Set router address as DNS server instead of loopback addresses
* Enable dnsmasq DNS service if possible and add DNS servers otherwise
* Reconfigure DHCP service on local nameserver changes
* Support for systemd-resolved for getting nameservers for NAP clients
* List connected devices in status icon tooltip
* Support for nautilus 43 and later
* Copy bleutooth address to clipboard in devicelist
* Add battery levels to status icon tooltip
### Changes
* Raise minimum Python version to 3.8
* Raise minumum Gtk+ version to 3.24
* Hide recent connections associated with unavailable adapters
* Store network configuration in GSettings instead of /var/lib/blueman/network.state.
* Replace custom MessageArea widget with regular Gtk.InfoBar
* Drop auto-power feature. BlueZ now has the AutoEnable setting for even better auto-powering.
* Do not use pointless link quality value
* Recent connections in toplevel applet menu
* Never hide keyboard and combos, see #1954 for more info
* Do not close blueman-manager from applet
* Add Switch to blueman-manager to set bluetooth on/off
* Remove broken check for bluetooth status
* PluginDialog: Replace custom list with Gtk.ListBox
* Ignore double-click for connect when unpowered
* Drop homgeneous from statusbar
* PulseAudioUtils: Use python enums in several places
* Use operator convenience functions
* Cleanup PluginDialog UI
* Show HCI device in blueman-adapers tabs
* Show different icon for the active audio profile @localevil
* Make blueman-services a notebook
* Use the TypedDict as constructor
### Bugs fixed
* Fix device-selected handlers
* Fix deprecations in tests
* Fix showing -1 seconds when discovering @kuraga
* Tray: Let dbus call end and reply to caller
* Get the image-missing icon if lookup failed to avoid crash
## 2.3.5
### Bugs fixed
* Right click menu was pointing to the wrong list row
* Double click to connect
## 2.3.4
### Bugs fixed
* Errors when connected to a device with the DisconnectItems plugin enabled
## 2.3.3
### Changes
* Do not re-use dbusmenu item identifiers; avoids issues at least with gnome-shell-extension-appindicator.
### Bugs fixed
* Issues with NM PANU connections of equally named devices
* Submenus in KDE Plasma tray
* Avoid using StatusNotifierItem and GtkStatusIcon icons in parallel
## 2.3.2
### Bugs fixed
* StatusNotifierItem submenus did not work in lxqt-panel (@niknah)
* StatusNotifierItem vanished on panel restarts
* StatusNotifierItem compatibility issues with libdbusmenu used at least by xfce4-panel and Waybar
* StatusNotifierItem showed the menu on left click in xfce4-panel
## 2.3.1
### Bugs fixed
* StatusNotifierItem sent an incomplete NewStatus signal.
* Avoid statusbar resize when showing progressbar
## 2.3
### Bugs fixed
* Blocked emblem was not visible for scales other than 1
## 2.3.beta1
### New features
* Symbolic tray icon option (GSettings switch symbolic-status-icons in org.blueman.general)
### Changes
* Replace AppIndicator with DBus StatusNotifierItem
* Use a GtkTreeModelFilter to show/hide unnamed devices
* Replace sigint hack with GLib to catch it
* Port meson from deprecated python3 module
* Rework battery handling
* Merge Battery applet plugin into ConnectionNotifier
* Symbolic icons and small UI improvements
## 2.2.5
### Bugs fixed
* Fix network interface iteration on 32 bit systems
* Manager: Fix cancel button in send-note dialog
* Fix battery and signals bars
## 2.2.4
### Changes
* Dropped the PIN database
### Bugs fixed
* blueman-mechanism accepted arbitrary file paths and returned the errors from trying to open them, see https://github.com/blueman-project/blueman/security/advisories/GHSA-3r9p-m5c8-8mw8
## 2.2.3
### Bugs fixed
* Recent connections disabled after suspend and resume
* Service authorization notifications did not respond
* Passkeys did not get displayed
## 2.2.2
### Bugs fixed
* Issues with power level bars
* Error message in blueman-mechanism
## 2.2.1
### Bugs fixed
* Hard dependency of DBusService on NetworkManager
## 2.2
### New features
* Disconnect items in applet menu (plugin)
* Desktop notifications on connect / disconnect (plugin)
* Notifications with battery level for connecting devices (applet plugin)
* Stop discovery and retry connection for broken adapter drivers
* Auto-connect settings for supported services
### Changes
* Drop blueman-report
* Drop blueman-assistant
* Raise minimum Python version to 3.6
* Raise GTK+ 3 version to 3.22
* Raise minimum BlueZ version to 5.48
* Allow opening device menus via keyboard (Shift+F10 or menu key)
* Add Ctrl+Q and Ctrl+W accelerators for closing blueman-manager
* Allow cancelling device connection attempts
* Improved passkey handling (fixed padding, highlighting, single notifitication)
* Hide devices with no name
### Bugs fixed
* Fix disconnecting NMDevice
* Exceptions from asynchronous DBus calls (getting picked up by tools like Apport or ABRT)
* DiscvManager plugin showed its icon unreliably
## 2.1.4
### Changes
* Force cython to use python language version 3
* Do not use exitcode 1 when we expect to fail
* Mark more strings translatable (@cwendling)
### Bugs fixed
* Untranslated strings (@cwendling / Colomban Wendling)
* Searching (with Ctrl+F in manager device list) did not work
* Default PIN lookup
* Fix device removal handling (@Yannik)
* Only use LaunchContext when we have proper event time
## 2.1.3
### Changes
* Use apply button for transfer options
### Bugs fixed
* Fix tooltip not updating when bluetooth is disabled
* Fix dbus timeout in DhcClient
* Call the right method when pulseaudio crashes
* Handle os.remove failing
## 2.1.2
### Bugs fixed
* Signal bar updates with multiple adapters
* Pairing with pincode
## 2.1.1
### Bugs fixed
* Using recent connections did not work
* Switching adapters did not work
* Errors when removing a device
* Error tracebacks from info dialog
## 2.1
### Changes
* New PIN database
### Bugs fixed
* Crash in blueman-manager and blueman-adapters if no adapter is present
* Many issues in blueman-sendto
## 2.1.beta1
### Changes
* Use GDBus and drop dependency on dbus-python
* Small improvements for LE devices
* Removed NetworkManager 0.8 support from NetUsage plugin
* Handle invalid directory for incoming file transfers
* Quit blueman-sendto when no file was selected
* Use build-time python executable for shebangs
* Ask user for initial auto-power-on setting
### Bugs fixed
* Streamlined icon usage so that blueman now supports gnome-icon-theme, mate-icon-theme, adwaita-icon-theme, elementary-xfce, and Papirus
* Handle corrupt network configuration file
* The menu bar did not get updated correctly
## 2.1.alpha3
### Changes
* Added default polkit rules file that allows users in group wheel to perform administrative actions
* Use context managers for opening files
* Replace deprecated os.popen with subprocess
* Reimplement NetworkManager integration for DUN and PANU connection with libnm
* Disable DNS on dnsmasq
* Avoid authorization check
* Use GtkWindow for instead of a GtkDialog when there is no parent
* Stop using and remove TimeHint
### Bugs fixed
* RFCOMM channel detection for DUN service failed
* Fix DUN support though blueman and NetworkManager. We love to get feedback if this works for people
* Use correct name network-transmit-receive for icon (ManagerDeviceMenu)
* For a few GLib warning related to signals in ManagerDeviceMenu
* Fix Generic connect not showing in certain situations
* Many fixes in PPPSupport and PPPConnection
* Wait for Modemmanager longer to finnish probing a bluetooth modem
* Fix iconname typo in ErrorDialog
* Use returncode to check if DhcpdHandler started correctly
## 2.1.alpha2
### New features
* blueman-adapters is now (Xfce-)pluggable
* Allow users to copy data from the Info manager plugin
* Add connman support to KillSwitch plugin
* Implement a new standalone tray app
* Add support for HiDPI in the UI
* Add command line option to blueman-mechanism to stop timer
* Add support for, and prefer, the ip command to configure network devices
* Implement new plugin virtual on_delete function using weakref.finalize
### Changes
* Show "Proprietary" instead of "Unknown" for services with non-reserverd UUIDs
* Generic connect and disconnect
* blueman-services: rework dhcpd handler radio buttons
* Implement a ServiceUUID class
* invoke _NotificationDialog.callback with 1 argument (@dakkar)
* Drop support for Python 2.7
* RecentConns: Store items in a gsettings array of dict
* Migrate from EventBox to InfoBar
* Reintroduce GtkImageMenuItem
* Sendto: Replace progressbar with spinner and always discover
* Add a generic ErrorDialog combining various dialogs classes
* ManagerDeviceMenu: set certain setvice insensitive when not paired
* ManagerDeviceList: Only update signal levels if they changed
* Drop unused obex.Errors
* Use GObjectMeta to handle singleton in out BlueZ classes
* Various UI cleanups
* Remove various python2/3 compatibility workarounds
### Bugs fixed
* Icon disappeared when switching off bluetooth
* Revert "bluez manager: Subclass from GDBusObjectManagerClient"
* Icon briefly vanished when turning on bluetooth
* Fix DBus signal emission
* blueman-services: Fix radio button group
* Fix InfoBar animation
* Fix Drag&Drop in blueman-manager
* Use Appearance device property for bluetooth LE devices
* AppIndicator: Properly set title on indicator
* Implement function to retrieve rfcomm channel (serial devices)
* TransferService: Do not unregister when dbus name disappears
* Fix Obexd autostart in our BlueZ classes
* Properly update ui when unblocking adapter with rfkill
## 2.1.alpha1
### New features
* Information dialog on device's services
* Compose vNotes
* --delete option for blueman-sendto
### Changes
* Drop support for BlueZ 4
* Drop browse feature
* Add title to status icon
* Add systemd service units (@smcv / Simon McVittie)
* Set widget names so they can be used to style blueman.
* Replace deprecated use of Gtk.VBox and Gtk.HBox.
* Replace deprecated GtkTable with GtkGrid and also use it replace GtkBoxes used to layout.
* [dhcp] udhcpd (busybox) support
* [sendto] Do not try to send a file during a discovery
* Migrate the BlueZ classes from dbus-python to GDBus
* Limit who can run blueman's mechanism with polkit
* Use GtkListStore builtin sorting functionality
* Turn the BlueZ classes into singletons
* Update Sdp class id's
* Rework Adapter menu in ManagerMenu
* Rework and cleanup DeviceList class
* Drop headset service and plugin
* Merge the two property changed functions in PropertiesBase
* Remove main.Device
* Fix building with musl libc
* Add generic device-added/removed functions for plugins
* Drop legacy NetworkManager and ModemManager support
* Port AppletService proxy to GDBus
* Port Polkit client code to GDBus
* [ManagerDeviceMenu] Make disconnecting and opening plugin dialog asynchronous operations
* Implement default pin (RequestPinCode) database for BluezAgent
* Bluez, Subclass from Gio.DBusProxy and properly handle properties
* Bluez managers, Subclass from GDBusObjectManagerClient
* Notification: Use dbus for notifications and drop the libnotify dep
* Port NMPanSupport applet plugin to GDBus
* Open rfcomm device as unprivileged user if he has read and write access
### Bugs fixed
* Codepoint issues when connecting to serial service
* Infinite loop if RecentConns has only invalid items
* Unblock rfkill in Python 3
* Valid adapter may not be found
* Do not load RfKill plugins when device is not available.
* Always set codeset for gettext to utf8 (@mgorny / Michał Górny)
* Support legacy devices without a Name property
* (Covered) Crash in agent's passkey / pin code methods
* Fix fading in GtkAnimation TreeRow(Color)Fade and CellFade classes.
* Do not explicitly destroy DeviceSelectorDialog blueman-sendto.
* gui: Call the sub-classed widgets init function instead of GObject's
* Do not block manager with plugin dialog
* Exception in Tee class at exit
* Stop dhcpd handler removing all content of the config file
* Only return devices belonging to adapter
* Fix SerialManager plugin
* Close Notification when pair is successful
* Properly unregister NAP when unloading Networking plugin
* PPPSupport: Wait for ModemManager to complete probing and release the device
## 2.0.8
### Bugs fixed
* Fix name resolution of unknown device classes
## 2.0.7
### Changes
This release fixes DUN support in blueman through NetworkManager and bluemans own implementation with pppd. It has been broken due to lack of hardware as DUN is usually not available on newer devices. We now have an old phone and an Android app to get thing working but we would love to get some feedback if bluemans DUN support works for you or not.
We also added default polkit rules file that allows users in group wheel to perform administrative actions. Note that the administrative group might have a different name (e.g. sudo in the Debian family) and there might be additional groups that are appropriate for the actions (e.g. netdev in the Debian family), so it still makes sense for distributions to adapt the configuration.
Support iproute2 and make it the default
### Bugs fixed
* Fix icon name in the device menu
* Several commits backported from master for various RFCOMM and Serial related bugs.
* Fix icon and caption in manager for LE devices
## 2.0.6
**This release adds authorisation checks for the commands blueman runs as root**
We added the following policykit authorisation checks
* org.blueman.network.setup
* org.blueman.pppd.pppconnect
* org.blueman.rfkill.setstate
See https://github.com/blueman-project/blueman/wiki/PolicyKit
## 2.0.5
### Bugs fixed
* PPPSupport: Correrct binary name for ModemManager
* PPPSupport: Exclude grep process from process list
* GameControllerWakeLock: Check for Class property before using it
* SerialManager: Properly check for None
* NetConf: Treat UnicodeDecodeError as if there was no file
* Notification: Also check if notification daemon supports body
* Correct bold tag in portuguese translation (thanks @andreyluiz)
* Properly check for None in SerialManager
* GameControllerWakeLock: Check for Class property first
* Fix bugs in NetworkService ui
* NetConf: fix writing PID file for dhcpd(3)
* Notification: Make sure x and y hint are in screen geometry
## 2.0.4
### Changes
* Do not try to send a file during a discovery
### Bugs fixed
* Listing rfcomm devices was broken
* Serial devices where not properly disconnected
* Close confirmation dialog on cancelation
* Handle transfer errors correctly
* Show devices of the current adapter only
* Local network service did not work
* PyGI warnings
* Call custom scripts for serial services
* Disconnect serial services on device disconnect
## 2.0.3
Fix privilege escalation
## 2.0.2
### Bugs fixed
* Exception on device property change
* Backport fix for #345 - rename random pass pairing button
* Exception at exit (#391)
* Clarify wording of tray applet's option to turn off bluetooth
* Do not block manager with plugin dialog (#383)
* blueman-adapters: Set hidden in the ui when timeout is reached
* Functions: Catch specific error in get_icon function
* Stop Game Controller plugin from blocking
* Use absolute filename provided to blueman-sendto on the cmd line
## 2.0.1
### Bugs fixed
* Codepoint issues when connecting to serial service
* Infinite loop if RecentConns has only invalid items
* Unblock rfkill in Python 3
* Valid adapter may not be found
* Handle when rfkill subsystem is not available gracefully
* RfKill: open /dev/rfkill r+b to avoid creating
* Resolve codepoint issues in several places
* Stop dhcpd handler removing all content of the config file
## 2.0
No relevant changes
## 2.0.rc1
### New features
* Support for Python 3
* [dhcp] udhcpc (busybox) support
### Changes
* [ui] Button to reset device alias
* [bluez] Agent capability KeyboardDisplay (@kemnade-uni / Andreas Kemnade)
* New configuration option to disable the use of a notification daemon
* [sendto] Removed nautilus-sendto plugin (deprecated and broken)
* [nm] Use API instead of GConf to create new connections
* [nm] Enable IPv6 on created connections
* Use GAppInfo to launch applications
* [bluez] Auto power on adapters; can be disabled in PowerManager settings
* Remove Gtk+, GLib and Gio as build time dependencies
* [obex] Migrate receiving files from obex-data-server to obexd
* [ui] Plugins and local services items in manager's View menu
### Bugs fixed
* [assistant] Crash (@duganchen)
* [pulseaudio] Support for audio profiles
* Generic disconnect method did not work
* [bluez] Handsfree service crashed with BlueZ 4
## 1.99.alpha2
### New features
* [docs] Add FAQ file and install doc files (@rworkman / Robby Workman)
* [sendto] Add sendto integration for Thunar (@GreenLunar)
* [sendto] Make thunar sendto integration optional (@rworkman / Robby Workman)
* Add optional settings manager integration with Xfce and MATE
(@rworkman / Robby Workman)
* [nm] Add support for NetworkManager 0.9 / 1.0 to NMPANSupport
* [bluez] Implement keyboard pairing support
* [nm] Add support for ModemManager 1.x to NMPANSupport
* [plugins] Add GameControllerWakelock plugin (@bwRavencl / Matteo Hausner)
* Add blueman-report to create commented logs for bug reports
* [bluez] BlueZ 5 support for audio, serial, recent connections, and setup
assistant
* Use Gsettings for configuration storage and remove the config plugin system.
### Changes
* [obex] Switch to obexd for sending files
* [browse] Use system's default browser for obex URI if no browse command is set
* [pulseaudio] Make blueman-applet run if pulseaudio is not available
* [ui] Re-implment menu icons
* [ui] Replace / remove deprecated icon names (@Teknocrat / Harvey Mittens)
* [ui] Drop status icon customization (@Teknocrat / Harvey Mittens)
* Drop HAL Support (@rworkman / Robby Workman)
* [configure] Rename --enable-sendto to --enable-nautilus-sendto
(@rworkman / Robby Workman)
* Fix compatility with Fedora's dbus-python package
* Remove settings for local audio services
* Add function to rename known devices
### Bugs fixed
* [ui] Make some UI elements expand again (@infirit / Sander Sweers)
* Fix crash in PluginManager (MartÃn Ferrari)
* Avoid crash in transfer service setup dialog
* Make blueman-applet respond to SIGTERM (@Teknocrat / Harvey Mittens)
* Allow setting friendly adapter name in BlueZ 5
* Look for both dhcpd and dhcpd3 and add sbin paths (@infirit / Sander Sweers)
* [libblueman] Fix memory leak (@monsta)
* [libblueman] Add missing includes (@posophe)
* [ui] Move some icons to pixmaps directory (@rworkman / Robby Workman)
* [ui] Fix fallback for notification daemons not capable to handle actions
* [ui] Fix "Shared Folder" widget in Transfer plugin.
* [ui] Fix service disconnect icons
* Do not translate polkit vendor (@pwithnall / Philip Withnall)
## 1.99.alpha1
### New features
* dhcpcd client support (@Teknocrat / Harvey Mittens)
* Partial support for BlueZ 5 (see #13 for the current state)
### Changes
* Switch to GTK+ 3 (using introspection)
* Update autoconf to support aarch64 (Dennis Gilmore)
* Migrate from Pyrex to Cython (@Teknocrat / Harvey Mittens)
### Bugs fixed
* Fix nautilus integration
* Fix pulseaudio version check
* Add missing icons
* Fix initial applet state if bluetooth is disabled
* Fix blueman startup when .cache dir doesn't exist (@asdil12 / Dominik Heidler)
* Fix thunar fallback (Jan HutaÅ™)
* Do not power new adapters despite rfkill (@lkr / Leesa)
* Fix handling of network devices (especially fixes DhcpClient plugin)
* Update translations (too many to list them)
* Fix nonexistent dbus exception (MartÃn Ferrari)
* Fix a rare problem when the manager device menu cannot get the current selection (@kolen / Konstantin Mochalov)
* Fix pulseaudio device discovery (see #64 and the linked Ubuntu bugs for details and contributors)
blueman-2.4.3/COPYING 0000664 0000000 0000000 00000104513 14650545052 0014210 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
blueman-2.4.3/FAQ 0000664 0000000 0000000 00000006466 14650545052 0013517 0 ustar 00root root 0000000 0000000 Frequently Asked Questions About Blueman
1. I have a problem - how do I begin the debugging process?
To retrieve useful information, the best starting point is to run
"blueman-applet" from a terminal window. Since only one instance may
be running at a time, you will first need to stop any instances
already running (use "ps x | grep [b]lueman" to find the pid and then
run "kill ####" or use "killall blueman-applet").
There will be plenty of output in the terminal window, which will also
include messages from blueman-manager.
See our Troubleshooting page for more information on this process:
https://github.com/blueman-project/blueman/wiki/Troubleshooting
2. The blueman applet does not show any detected bluetooth adapters - what
is wrong?
First, make sure that your kernel supports your bluetooth device. You
can use "bluez-test-adapter" (for BlueZ-4.x) or "bluetoothctl list"
(for BlueZ-5.x) to see if your device is recognized. If it is not,
then either your kernel doesn't support the device or some hardware
killswitch is preventing it from working.
To check for killswitch problems, first ensure that you have rfkill
support enabled in your kernel and it is loaded (i.e. the "rfkill"
module is loaded or it is built into your kernel statically).
Check the output of "rfkill list" and ensure that the bluetooth device
is not listed as either "Soft blocked" or "Hard blocked" - if it is,
then use the appropriate rfkill command to remove a soft block, and/or
check for a hardware switch on your machine to remove a hard block.
To check for kernel support, use "lsusb" and/or "lspci" to find the
hardware ID and do a web search to determine whether it should be
supported. If you are not sure how to do this and/or are not sure
how to interpret the results, scroll to the bottom of this document
for information on how to open an issue with the Blueman project.
3. How do I install blueman on my operating system?
Consult your operating system's documentation and/or help areas;
blueman is probably either already installed or available already
in a package repository.
4. I have another question or am experiencing some other issue/bug:
Now what?
For bugs in blueman, we recommend that you first attempt to resolve
any issues through your OS vendor's designated support areas to
ensure that problems aren't caused by e.g. packaging issues or
OS-specific configurations. If you've already tried that and still
are unable to solve your problem, visit our Troubleshooting page:
https://github.com/blueman-project/blueman/wiki/Troubleshooting
and if needed, open a new issue:
https://github.com/blueman-project/blueman/issues
Be sure to provide the blueman version you are using, the version of
bluez you are running, your kernel version, your operating system
name and version, and the desktop environment you are running.
5. How can I help with blueman development?
Visit our github project page:
https://github.com/blueman-project/blueman
You can clone the git repository, view the code, and/or submit
pull requests.
You will probably also want to join our mailing list:
http://ml.mate-desktop.org/listinfo/blueman
6. What other resources are available for help with blueman?
https://wiki.archlinux.org/index.php/Blueman
http://wiki.ubuntuusers.de/Bluetooth/Blueman
blueman-2.4.3/Makefile.am 0000664 0000000 0000000 00000001702 14650545052 0015205 0 ustar 00root root 0000000 0000000 SUBDIRS = \
apps \
blueman \
data \
module \
po \
sendto \
test
DIST_DOCS = \
CHANGELOG.md \
COPYING \
FAQ \
README.md
EXTRA_DIST = \
${DIST_DOCS} \
meson.build \
meson_options.txt \
po/meson.build
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
configure \
config.h.in \
config.rpath \
depcomp \
missing \
install-sh \
ABOUT-NLS \
config.rpath \
po/Makefile.in.in \
po/Makefile.in \
po/Makefile \
po/Makevars.template \
po/quot.sed \
po/remove-potcdate.sin \
po/Rules-quot \
po/blueman.pot \
po/boldquot.sed \
po/*.header \
po/stamp-po \
po/insert-header.sin \
$NULL
doc_DATA = ${DIST_DOCS}
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# distcheck fails trying to install to the live filesystem
AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir='$$(prefix)/lib/systemd/system' \
--with-systemduserunitdir='$$(prefix)/lib/systemd/user'
blueman-2.4.3/Makefile.in 0000664 0000000 0000000 00000074403 14650545052 0015226 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(docdir)"
DATA = $(doc_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
ABOUT-NLS COPYING README.md compile config.guess config.rpath \
config.sub install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
GZIP_ENV = --best
DIST_TARGETS = dist-xz dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = \
apps \
blueman \
data \
module \
po \
sendto \
test
DIST_DOCS = \
CHANGELOG.md \
COPYING \
FAQ \
README.md
EXTRA_DIST = \
${DIST_DOCS} \
meson.build \
meson_options.txt \
po/meson.build
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
configure \
config.h.in \
config.rpath \
depcomp \
missing \
install-sh \
ABOUT-NLS \
config.rpath \
po/Makefile.in.in \
po/Makefile.in \
po/Makefile \
po/Makevars.template \
po/quot.sed \
po/remove-potcdate.sin \
po/Rules-quot \
po/blueman.pot \
po/boldquot.sed \
po/*.header \
po/stamp-po \
po/insert-header.sin \
$NULL
doc_DATA = ${DIST_DOCS}
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# distcheck fails trying to install to the live filesystem
AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir='$$(prefix)/lib/systemd/system' \
--with-systemduserunitdir='$$(prefix)/lib/systemd/user'
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-docDATA: $(doc_DATA)
@$(NORMAL_INSTALL)
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
done
uninstall-docDATA:
@$(NORMAL_UNINSTALL)
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-zstd: distdir
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-docDATA
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-docDATA
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-docDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am uninstall-docDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/README.md 0000664 0000000 0000000 00000003463 14650545052 0014436 0 ustar 00root root 0000000 0000000 ## Description
Blueman is a GTK+ Bluetooth Manager
Blueman is designed to provide a simple yet effective means for
controlling the BlueZ API and simplifying Bluetooth tasks, such as:
* Connecting to dial-up networks
* Connecting to / Creating Bluetooth networks
* Connecting to input devices
* Connecting to audio devices
* Sending / Receiving files via OBEX
* Pairing
It is lightweight, easy to use, Python based, and GPL licensed.
## Installing
See [Dependencies.md](Dependencies.md) for a list of build and runtime dependencies.
To install a packaged release of blueman, run `./configure && make && make install`.
To generate and run a configure script from source, run `./autogen.sh`.
If you are packaging it for your distribution, please make sure to pass `--disable-schemas-compile` and run `glib-compile-schemas /datadir/glib-2.0/schemas` as part of your (un)install phase.
[](https://repology.org/project/blueman/versions)
## Support / Troubleshooting
If you're reporting a bug, please read the [Troubleshooting page](https://github.com/blueman-project/blueman/wiki/Troubleshooting) to provide all relevant info.
Feel free to [open a GitHub issue](https://github.com/blueman-project/blueman/issues/new) to file bugs, or ask about anything you need help with.
## Contributing
Fork, make your changes, and issue a pull request. If you just want to edit a single file, GitHub will guide you through that process.
### Translate
Translations are managed on Hosted Weblate.
[](https://hosted.weblate.org/engage/blueman/)
## License
All parts of the software are licensed under GPLv3 (or GPLv2) and allow redistribution under any later version.
blueman-2.4.3/acinclude.m4 0000664 0000000 0000000 00000005535 14650545052 0015352 0 ustar 00root root 0000000 0000000 dnl as-ac-expand.m4 0.1.0
dnl autostars m4 macro for expanding directories using configure's prefix
dnl thomas@apestaart.org
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var"="x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
## this one is commonly used with AM_PATH_PYTHONDIR ...
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
dnl Check if a module containing a given symbol is visible to python.
AC_DEFUN([AM_CHECK_PYMOD],
[AC_REQUIRE([AM_PATH_PYTHON])
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
ifelse([$2],[], [prog="
import sys
try:
import $1
except ImportError:
sys.exit(1)
except:
sys.exit(0)
sys.exit(0)"], [prog="
import $1
$1.$2"])
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
eval "py_cv_mod_$py_mod_var=yes"
else
eval "py_cv_mod_$py_mod_var=no"
fi
])
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
if test "x$py_val" != xno; then
AC_MSG_RESULT(yes)
ifelse([$3], [],, [$3
])dnl
else
AC_MSG_RESULT(no)
ifelse([$4], [],, [$4
])dnl
fi
])
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
PYTHON_INCLUDES=`python-config --includes`
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include ],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])
blueman-2.4.3/aclocal.m4 0000664 0000000 0000000 00000222305 14650545052 0015015 0 ustar 00root root 0000000 0000000 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Increment this whenever this file is changed.
#serial 2
dnl GLIB_GSETTINGS
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
dnl the schema should be compiled
dnl
AC_DEFUN([GLIB_GSETTINGS],
[
dnl We can't use PKG_PREREQ because that needs 0.29.
m4_ifndef([PKG_PROG_PKG_CONFIG],
[pkg.m4 version 0.28 or later is required])
m4_pattern_allow([AM_V_GEN])
AC_ARG_ENABLE(schemas-compile,
AS_HELP_STRING([--disable-schemas-compile],
[Disable regeneration of gschemas.compiled on install]),
[case ${enableval} in
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
esac])
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
PKG_PROG_PKG_CONFIG([0.16])
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
AS_IF([test x$cross_compiling != xyes],
[PKG_CHECK_VAR([GLIB_COMPILE_SCHEMAS], [gio-2.0], [glib_compile_schemas])],
[AC_PATH_PROG([GLIB_COMPILE_SCHEMAS], [glib-compile-schemas])])
AC_SUBST(GLIB_COMPILE_SCHEMAS)
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
else
ifelse([$1],,[:],[$1])
fi
GSETTINGS_RULES='
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
mostlyclean-am: clean-gsettings-schemas
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@
all-am: $(gsettings_SCHEMAS:.xml=.valid)
uninstall-am: uninstall-gsettings-schemas
install-data-am: install-gsettings-schemas
.SECONDARY: $(gsettings_SCHEMAS)
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
@$(NORMAL_INSTALL)
if test -n "$^"; then \
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
fi
uninstall-gsettings-schemas:
@$(NORMAL_UNINSTALL)
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
test -n "$$files" || exit 0; \
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
clean-gsettings-schemas:
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
ifdef gsettings_ENUM_NAMESPACE
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
$(AM_V_GEN) glib-mkenums --comments '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " @type@>" --ftail "" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
endif
'
_GSETTINGS_SUBST(GSETTINGS_RULES)
])
dnl _GSETTINGS_SUBST(VARIABLE)
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
AC_DEFUN([_GSETTINGS_SUBST],
[
AC_SUBST([$1])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
]
)
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 11 (pkg-config-0.29.1)
dnl Copyright © 2004 Scott James Remnant .
dnl Copyright © 2012-2015 Dan Nicholson
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see .])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
m4_ifdef([_$0_ALREADY_INIT],
[m4_fatal([$0 expanded multiple times
]m4_defn([_$0_ALREADY_INIT]))],
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
AC_SUBST([CTAGS])
if test -z "$ETAGS"; then
ETAGS=etags
fi
AC_SUBST([ETAGS])
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAKE_INCLUDE()
# -----------------
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
am__include="#"
am__quote=
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_CC_C_O
# ---------------
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
# to automatically call this.
AC_DEFUN([_AM_PROG_CC_C_O],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
AC_LANG_PUSH([C])dnl
AC_CACHE_CHECK(
[whether $CC understands -c and -o together],
[am_cv_prog_cc_c_o],
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
# Adds support for distributing Python modules and packages. To
# install modules, copy them to $(pythondir), using the python_PYTHON
# automake variable. To install a package with the same name as the
# automake package, install to $(pkgpythondir), or use the
# pkgpython_PYTHON automake variable.
#
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
# locations to install python extension modules (shared libraries).
# Another macro is required to find the appropriate flags to compile
# extension modules.
#
# If your package is configured with a different prefix to python,
# users will have to add the install directory to the PYTHONPATH
# environment variable, or create a .pth file (see the python
# documentation for details).
#
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
# cause an error if the version of python installed on the system
# doesn't meet the requirement. MINIMUM-VERSION should consist of
# numbers and dots only.
AC_DEFUN([AM_PATH_PYTHON],
[
dnl Find a Python interpreter. Python versions prior to 2.0 are not
dnl supported. (2.0 was released on October 16, 2000).
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
[python python2 python3 dnl
python3.11 python3.10 dnl
python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
python3.2 python3.1 python3.0 dnl
python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
python2.0])
AC_ARG_VAR([PYTHON], [the Python interpreter])
m4_if([$1],[],[
dnl No version check is needed.
# Find any Python interpreter.
if test -z "$PYTHON"; then
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
fi
am_display_PYTHON=python
], [
dnl A version check is needed.
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
AC_MSG_CHECKING([whether $PYTHON version is >= $1])
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Python interpreter is too old])])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
[am_cv_pathless_PYTHON],[
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
test "$am_cv_pathless_PYTHON" = none && break
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
done])
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
if test "$am_cv_pathless_PYTHON" = none; then
PYTHON=:
else
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
fi
am_display_PYTHON=$am_cv_pathless_PYTHON
fi
])
if test "$PYTHON" = :; then
dnl Run any user-specified action, or abort.
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
dnl Query Python for its version number. Although site.py simply uses
dnl sys.version[:3], printing that failed with Python 3.10, since the
dnl trailing zero was eliminated. So now we output just the major
dnl and minor version numbers, as numbers. Apparently the tertiary
dnl version is not of interest.
dnl
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
[am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[[:2]])"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl At times, e.g., when building shared libraries, you may want
dnl to know which OS platform Python thinks this is.
dnl
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
dnl emacs-page
dnl If --with-python-sys-prefix is given, use the values of sys.prefix
dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX
dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and
dnl ${exec_prefix} variables.
dnl
dnl The two are made distinct variables so they can be overridden if
dnl need be, although general consensus is that you shouldn't need
dnl this separation.
dnl
dnl Also allow directly setting the prefixes via configure options,
dnl overriding any default.
dnl
if test "x$prefix" = xNONE; then
am__usable_prefix=$ac_default_prefix
else
am__usable_prefix=$prefix
fi
# Allow user to request using sys.* values from Python,
# instead of the GNU $prefix values.
AC_ARG_WITH([python-sys-prefix],
[AS_HELP_STRING([--with-python-sys-prefix],
[use Python's sys.prefix and sys.exec_prefix values])],
[am_use_python_sys=:],
[am_use_python_sys=false])
# Allow user to override whatever the default Python prefix is.
AC_ARG_WITH([python_prefix],
[AS_HELP_STRING([--with-python_prefix],
[override the default PYTHON_PREFIX])],
[am_python_prefix_subst=$withval
am_cv_python_prefix=$withval
AC_MSG_CHECKING([for explicit $am_display_PYTHON prefix])
AC_MSG_RESULT([$am_cv_python_prefix])],
[
if $am_use_python_sys; then
# using python sys.prefix value, not GNU
AC_CACHE_CHECK([for python default $am_display_PYTHON prefix],
[am_cv_python_prefix],
[am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`])
dnl If sys.prefix is a subdir of $prefix, replace the literal value of
dnl $prefix with a variable reference so it can be overridden.
case $am_cv_python_prefix in
$am__usable_prefix*)
am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'`
am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"`
;;
*)
am_python_prefix_subst=$am_cv_python_prefix
;;
esac
else # using GNU prefix value, not python sys.prefix
am_python_prefix_subst='${prefix}'
am_python_prefix=$am_python_prefix_subst
AC_MSG_CHECKING([for GNU default $am_display_PYTHON prefix])
AC_MSG_RESULT([$am_python_prefix])
fi])
# Substituting python_prefix_subst value.
AC_SUBST([PYTHON_PREFIX], [$am_python_prefix_subst])
# emacs-page Now do it all over again for Python exec_prefix, but with yet
# another conditional: fall back to regular prefix if that was specified.
AC_ARG_WITH([python_exec_prefix],
[AS_HELP_STRING([--with-python_exec_prefix],
[override the default PYTHON_EXEC_PREFIX])],
[am_python_exec_prefix_subst=$withval
am_cv_python_exec_prefix=$withval
AC_MSG_CHECKING([for explicit $am_display_PYTHON exec_prefix])
AC_MSG_RESULT([$am_cv_python_exec_prefix])],
[
# no explicit --with-python_exec_prefix, but if
# --with-python_prefix was given, use its value for python_exec_prefix too.
AS_IF([test -n "$with_python_prefix"],
[am_python_exec_prefix_subst=$with_python_prefix
am_cv_python_exec_prefix=$with_python_prefix
AC_MSG_CHECKING([for python_prefix-given $am_display_PYTHON exec_prefix])
AC_MSG_RESULT([$am_cv_python_exec_prefix])],
[
# Set am__usable_exec_prefix whether using GNU or Python values,
# since we use that variable for pyexecdir.
if test "x$exec_prefix" = xNONE; then
am__usable_exec_prefix=$am__usable_prefix
else
am__usable_exec_prefix=$exec_prefix
fi
#
if $am_use_python_sys; then # using python sys.exec_prefix, not GNU
AC_CACHE_CHECK([for python default $am_display_PYTHON exec_prefix],
[am_cv_python_exec_prefix],
[am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`])
dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the
dnl literal value of $exec_prefix with a variable reference so it can
dnl be overridden.
case $am_cv_python_exec_prefix in
$am__usable_exec_prefix*)
am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'`
am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"`
;;
*)
am_python_exec_prefix_subst=$am_cv_python_exec_prefix
;;
esac
else # using GNU $exec_prefix, not python sys.exec_prefix
am_python_exec_prefix_subst='${exec_prefix}'
am_python_exec_prefix=$am_python_exec_prefix_subst
AC_MSG_CHECKING([for GNU default $am_display_PYTHON exec_prefix])
AC_MSG_RESULT([$am_python_exec_prefix])
fi])])
# Substituting python_exec_prefix_subst.
AC_SUBST([PYTHON_EXEC_PREFIX], [$am_python_exec_prefix_subst])
# Factor out some code duplication into this shell variable.
am_python_setup_sysconfig="\
import sys
# Prefer sysconfig over distutils.sysconfig, for better compatibility
# with python 3.x. See automake bug#10227.
try:
import sysconfig
except ImportError:
can_use_sysconfig = 0
else:
can_use_sysconfig = 1
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
#
try:
from platform import python_implementation
if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
can_use_sysconfig = 0
except ImportError:
pass"
dnl emacs-page Set up 4 directories:
dnl 1. pythondir: where to install python scripts. This is the
dnl site-packages directory, not the python standard library
dnl directory like in previous automake betas. This behavior
dnl is more consistent with lispdir.m4 for example.
dnl Query distutils for this directory.
dnl
AC_CACHE_CHECK([for $am_display_PYTHON script directory (pythondir)],
[am_cv_python_pythondir],
[if test "x$am_cv_python_prefix" = x; then
am_py_prefix=$am__usable_prefix
else
am_py_prefix=$am_cv_python_prefix
fi
am_cv_python_pythondir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
if hasattr(sysconfig, 'get_default_scheme'):
scheme = sysconfig.get_default_scheme()
else:
scheme = sysconfig._get_default_scheme()
if scheme == 'posix_local':
# Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
scheme = 'posix_prefix'
sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
#
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"`
;;
*)
case $am_py_prefix in
/usr|/System*) ;;
*) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
;;
esac
;;
esac
])
AC_SUBST([pythondir], [$am_cv_python_pythondir])
dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
dnl more consistent with the rest of automake.
dnl
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
dnl 3. pyexecdir: directory for installing python extension modules
dnl (shared libraries).
dnl Query distutils for this directory.
dnl
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)],
[am_cv_python_pyexecdir],
[if test "x$am_cv_python_exec_prefix" = x; then
am_py_exec_prefix=$am__usable_exec_prefix
else
am_py_exec_prefix=$am_cv_python_exec_prefix
fi
am_cv_python_pyexecdir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
if hasattr(sysconfig, 'get_default_scheme'):
scheme = sysconfig.get_default_scheme()
else:
scheme = sysconfig._get_default_scheme()
if scheme == 'posix_local':
# Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
scheme = 'posix_prefix'
sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix')
sys.stdout.write(sitedir)"`
#
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"`
;;
*)
case $am_py_exec_prefix in
/usr|/System*) ;;
*) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
;;
esac
;;
esac
])
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE)
dnl
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
dnl Run any user-specified action.
$2
fi
])
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ---------------------------------------------------------------------------
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
# Run ACTION-IF-FALSE otherwise.
# This test uses sys.hexversion instead of the string equivalent (first
# word of sys.version), in order to cope with versions such as 2.2c1.
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
[prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
minverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
sys.exit(sys.hexversion < minverhex)"
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
AC_DEFUN([AM_RUN_LOG],
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/gettext.m4])
m4_include([m4/iconv.m4])
m4_include([m4/intlmacosx.m4])
m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
m4_include([m4/nls.m4])
m4_include([m4/po.m4])
m4_include([m4/progtest.m4])
m4_include([acinclude.m4])
blueman-2.4.3/apps/ 0000775 0000000 0000000 00000000000 14650545052 0014114 5 ustar 00root root 0000000 0000000 blueman-2.4.3/apps/Makefile.am 0000664 0000000 0000000 00000000672 14650545052 0016155 0 ustar 00root root 0000000 0000000 APPS = \
blueman-adapters \
blueman-applet \
blueman-manager \
blueman-services \
blueman-sendto \
blueman-tray
appsdir = $(bindir)
apps_SCRIPTS = $(APPS)
polkitdir = $(libexecdir)
polkit_SCRIPTS = \
blueman-mechanism
helpersdir = $(libexecdir)
helpers_SCRIPTS = blueman-rfcomm-watcher
ALL_APPS = $(APPS) $(polkit_SCRIPTS) $(helpers_SCRIPTS)
EXTRA_DIST = $(ALL_APPS) $(addsuffix .in, $(ALL_APPS))
CLEANFILES = $(ALL_APPS)
blueman-2.4.3/apps/Makefile.in 0000664 0000000 0000000 00000053321 14650545052 0016165 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = apps
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = blueman-adapters blueman-applet blueman-manager \
blueman-mechanism blueman-rfcomm-watcher blueman-sendto \
blueman-services blueman-tray
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(appsdir)" "$(DESTDIR)$(helpersdir)" \
"$(DESTDIR)$(polkitdir)"
SCRIPTS = $(apps_SCRIPTS) $(helpers_SCRIPTS) $(polkit_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/blueman-adapters.in \
$(srcdir)/blueman-applet.in $(srcdir)/blueman-manager.in \
$(srcdir)/blueman-mechanism.in \
$(srcdir)/blueman-rfcomm-watcher.in \
$(srcdir)/blueman-sendto.in $(srcdir)/blueman-services.in \
$(srcdir)/blueman-tray.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
APPS = \
blueman-adapters \
blueman-applet \
blueman-manager \
blueman-services \
blueman-sendto \
blueman-tray
appsdir = $(bindir)
apps_SCRIPTS = $(APPS)
polkitdir = $(libexecdir)
polkit_SCRIPTS = \
blueman-mechanism
helpersdir = $(libexecdir)
helpers_SCRIPTS = blueman-rfcomm-watcher
ALL_APPS = $(APPS) $(polkit_SCRIPTS) $(helpers_SCRIPTS)
EXTRA_DIST = $(ALL_APPS) $(addsuffix .in, $(ALL_APPS))
CLEANFILES = $(ALL_APPS)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign apps/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign apps/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
blueman-adapters: $(top_builddir)/config.status $(srcdir)/blueman-adapters.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-applet: $(top_builddir)/config.status $(srcdir)/blueman-applet.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-manager: $(top_builddir)/config.status $(srcdir)/blueman-manager.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-mechanism: $(top_builddir)/config.status $(srcdir)/blueman-mechanism.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-rfcomm-watcher: $(top_builddir)/config.status $(srcdir)/blueman-rfcomm-watcher.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-sendto: $(top_builddir)/config.status $(srcdir)/blueman-sendto.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-services: $(top_builddir)/config.status $(srcdir)/blueman-services.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
blueman-tray: $(top_builddir)/config.status $(srcdir)/blueman-tray.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-appsSCRIPTS: $(apps_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(apps_SCRIPTS)'; test -n "$(appsdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appsdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appsdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(appsdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(appsdir)$$dir" || exit $$?; \
} \
; done
uninstall-appsSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(apps_SCRIPTS)'; test -n "$(appsdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(appsdir)'; $(am__uninstall_files_from_dir)
install-helpersSCRIPTS: $(helpers_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(helpers_SCRIPTS)'; test -n "$(helpersdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(helpersdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(helpersdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(helpersdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(helpersdir)$$dir" || exit $$?; \
} \
; done
uninstall-helpersSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(helpers_SCRIPTS)'; test -n "$(helpersdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(helpersdir)'; $(am__uninstall_files_from_dir)
install-polkitSCRIPTS: $(polkit_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(polkit_SCRIPTS)'; test -n "$(polkitdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(polkitdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(polkitdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(polkitdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(polkitdir)$$dir" || exit $$?; \
} \
; done
uninstall-polkitSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(polkit_SCRIPTS)'; test -n "$(polkitdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(polkitdir)'; $(am__uninstall_files_from_dir)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(appsdir)" "$(DESTDIR)$(helpersdir)" "$(DESTDIR)$(polkitdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-appsSCRIPTS install-helpersSCRIPTS \
install-polkitSCRIPTS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-appsSCRIPTS uninstall-helpersSCRIPTS \
uninstall-polkitSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-appsSCRIPTS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-helpersSCRIPTS install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-polkitSCRIPTS install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags-am uninstall uninstall-am uninstall-appsSCRIPTS \
uninstall-helpersSCRIPTS uninstall-polkitSCRIPTS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/apps/blueman-adapters 0000664 0000000 0000000 00000002554 14650545052 0017271 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import os
import sys
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("blueman")
from blueman.Functions import create_parser, create_logger, set_proc_title
from blueman.main.Adapter import BluemanAdapters
if __name__ == '__main__':
parser = parser = create_parser()
parser.add_argument("--socket-id", dest="socket_id", action="store", type=int, metavar="ID")
parser.add_argument("adapter", nargs="?", metavar="ADAPTER NAME")
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-adapters", syslog=args.syslog)
set_proc_title()
app = blueman_adapters = BluemanAdapters(args.adapter, args.socket_id)
app.run()
blueman-2.4.3/apps/blueman-adapters.in 0000775 0000000 0000000 00000002557 14650545052 0017704 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import os
import sys
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.Functions import create_parser, create_logger, set_proc_title
from blueman.main.Adapter import BluemanAdapters
if __name__ == '__main__':
parser = parser = create_parser()
parser.add_argument("--socket-id", dest="socket_id", action="store", type=int, metavar="ID")
parser.add_argument("adapter", nargs="?", metavar="ADAPTER NAME")
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-adapters", syslog=args.syslog)
set_proc_title()
app = blueman_adapters = BluemanAdapters(args.adapter, args.socket_id)
app.run()
blueman-2.4.3/apps/blueman-applet 0000664 0000000 0000000 00000002204 14650545052 0016743 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import sys
import os
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("blueman")
from blueman.Functions import create_logger, create_parser, set_proc_title
from blueman.main.Applet import BluemanApplet
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-applet", syslog=args.syslog)
set_proc_title()
app = BluemanApplet()
app.run()
blueman-2.4.3/apps/blueman-applet.in 0000775 0000000 0000000 00000002207 14650545052 0017356 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import sys
import os
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.Functions import create_logger, create_parser, set_proc_title
from blueman.main.Applet import BluemanApplet
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-applet", syslog=args.syslog)
set_proc_title()
app = BluemanApplet()
app.run()
blueman-2.4.3/apps/blueman-manager 0000664 0000000 0000000 00000002172 14650545052 0017074 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import sys
import os
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("blueman")
from blueman.main.Manager import Blueman
from blueman.Functions import set_proc_title, create_parser, create_logger
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-manager", syslog=args.syslog)
app = Blueman()
set_proc_title()
app.run()
blueman-2.4.3/apps/blueman-manager.in 0000775 0000000 0000000 00000002175 14650545052 0017507 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import sys
import os
import logging
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.main.Manager import Blueman
from blueman.Functions import set_proc_title, create_parser, create_logger
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-manager", syslog=args.syslog)
app = Blueman()
set_proc_title()
app.run()
blueman-2.4.3/apps/blueman-mechanism 0000664 0000000 0000000 00000003613 14650545052 0017427 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import sys
import os
import logging
from blueman.main.MechanismApplication import MechanismApplication
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
from blueman.Functions import set_proc_title, create_logger, create_parser
class StreamToLogger:
"""
Fake file-like stream object that redirects writes to a logger instance.
"""
def __init__(self, logger, log_level=logging.INFO):
self.logger = logger
self.log_level = log_level
self.linebuf = ''
def write(self, buf):
for line in buf.rstrip().splitlines():
self.logger.log(self.log_level, line.rstrip())
def flush(self):
pass
parser = create_parser(syslog=False)
parser.add_argument("-d", "--debug", dest="debug", action="store_true")
parser.add_argument("-s", "--stop-timer", dest="stoptimer", action="store_true")
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
logger = create_logger(log_level, "blueman-mechanism", syslog=True)
if args.debug:
logging.info("Enabled verbose output")
sl = StreamToLogger(logger, logging.INFO)
sys.stdout = sl
sl = StreamToLogger(logger, logging.ERROR)
sys.stderr = sl
logging.info("Starting blueman-mechanism")
os.environ["PATH"] = "/usr/bin:/bin:/usr/sbin:/sbin"
set_proc_title()
app = MechanismApplication(args.stoptimer)
app.run()
blueman-2.4.3/apps/blueman-mechanism.in 0000775 0000000 0000000 00000003604 14650545052 0020037 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import sys
import os
import logging
from blueman.main.MechanismApplication import MechanismApplication
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
from blueman.Functions import set_proc_title, create_logger, create_parser
class StreamToLogger:
"""
Fake file-like stream object that redirects writes to a logger instance.
"""
def __init__(self, logger, log_level=logging.INFO):
self.logger = logger
self.log_level = log_level
self.linebuf = ''
def write(self, buf):
for line in buf.rstrip().splitlines():
self.logger.log(self.log_level, line.rstrip())
def flush(self):
pass
parser = create_parser(syslog=False)
parser.add_argument("-d", "--debug", dest="debug", action="store_true")
parser.add_argument("-s", "--stop-timer", dest="stoptimer", action="store_true")
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
logger = create_logger(log_level, "blueman-mechanism", syslog=True)
if args.debug:
logging.info("Enabled verbose output")
sl = StreamToLogger(logger, logging.INFO)
sys.stdout = sl
sl = StreamToLogger(logger, logging.ERROR)
sys.stderr = sl
logging.info("Starting blueman-mechanism")
os.environ["PATH"] = "/usr/bin:/bin:/usr/sbin:/sbin"
set_proc_title()
app = MechanismApplication(args.stoptimer)
app.run()
blueman-2.4.3/apps/blueman-rfcomm-watcher 0000664 0000000 0000000 00000001153 14650545052 0020376 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
from gi.repository import Gio
from gi.repository import GLib
import os
import argparse
from blueman.Functions import set_proc_title, open_rfcomm
def on_file_changed(monitor, file, other_file, event_type):
if event_type == Gio.FileMonitorEvent.DELETED:
loop.quit()
parser = argparse.ArgumentParser()
parser.add_argument("path", action="store")
args = parser.parse_args()
mon = Gio.File.new_for_path(args.path).monitor_file(Gio.FileMonitorFlags.NONE)
mon.connect('changed', on_file_changed)
fd = open_rfcomm(args.path, os.O_RDONLY)
set_proc_title()
loop = GLib.MainLoop()
loop.run()
blueman-2.4.3/apps/blueman-rfcomm-watcher.in 0000775 0000000 0000000 00000001144 14650545052 0021006 0 ustar 00root root 0000000 0000000 #!@PYTHON@
from gi.repository import Gio
from gi.repository import GLib
import os
import argparse
from blueman.Functions import set_proc_title, open_rfcomm
def on_file_changed(monitor, file, other_file, event_type):
if event_type == Gio.FileMonitorEvent.DELETED:
loop.quit()
parser = argparse.ArgumentParser()
parser.add_argument("path", action="store")
args = parser.parse_args()
mon = Gio.File.new_for_path(args.path).monitor_file(Gio.FileMonitorFlags.NONE)
mon.connect('changed', on_file_changed)
fd = open_rfcomm(args.path, os.O_RDONLY)
set_proc_title()
loop = GLib.MainLoop()
loop.run()
blueman-2.4.3/apps/blueman-sendto 0000664 0000000 0000000 00000012055 14650545052 0016757 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import os
import sys
import signal
import atexit
import logging
import gettext
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gio
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
_ = gettext.gettext
gettext.textdomain("blueman")
from blueman.Functions import (
setup_icon_path,
check_bluetooth_status,
set_proc_title,
create_parser,
create_logger,
bmexit
)
from blueman.main.Sendto import Sender
from blueman.bluez.Manager import Manager
from blueman.bluez.errors import DBusNoSuchAdapterError
from blueman.gui.DeviceSelectorDialog import DeviceSelectorDialog
# Workaround introspection bug, gnome bug 622084
signal.signal(signal.SIGINT, signal.SIG_DFL)
class SendTo:
def __init__(self, parsed_args):
setup_icon_path()
check_bluetooth_status(_("Bluetooth needs to be turned on for file sending to work"), bmexit)
if not parsed_args.files:
self.files = self.select_files()
else:
self.files = [os.path.abspath(f) for f in parsed_args.files]
self.device = None
manager = Manager()
adapter = None
adapters = manager.get_adapters()
last_adapter_name = Gio.Settings(schema_id="org.blueman.general")["last-adapter"]
if len(adapters) == 0:
logging.error("Error: No Adapters present")
bmexit()
if parsed_args.source is not None:
try:
adapter = manager.get_adapter(parsed_args.source)
except DBusNoSuchAdapterError:
logging.error("Unknown adapter, trying first available")
pass
if adapter is None:
try:
adapter = manager.get_adapter(last_adapter_name)
except DBusNoSuchAdapterError:
adapter = manager.get_adapter()
self.adapter_path = adapter.get_object_path()
if parsed_args.delete:
def delete_files():
for file in self.files:
os.unlink(file)
atexit.register(delete_files)
if parsed_args.device is None:
if not self.select_device():
bmexit()
self.do_send()
else:
d = manager.find_device(parsed_args.device, self.adapter_path)
if d is None:
bmexit("Unknown bluetooth device")
self.device = d
self.do_send()
def do_send(self):
if not self.files:
logging.warning("No files to send")
bmexit()
sender = Sender(self.device, self.adapter_path, self.files)
def on_result(sender, res):
Gtk.main_quit()
sender.connect("result", on_result)
@staticmethod
def select_files():
d = Gtk.FileChooserDialog(title=_("Select files to send"), icon_name='blueman-send-symbolic', select_multiple=True)
d.add_buttons(_("_Cancel"), Gtk.ResponseType.REJECT, _("_OK"), Gtk.ResponseType.ACCEPT)
resp = d.run()
if resp == Gtk.ResponseType.ACCEPT:
files = d.get_filenames()
d.destroy()
return files
else:
d.destroy()
quit()
def select_device(self):
adapter_name = os.path.split(self.adapter_path)[-1]
d = DeviceSelectorDialog(discover=True, adapter_name=adapter_name)
resp = d.run()
d.close()
if resp == Gtk.ResponseType.ACCEPT:
if d.selection:
self.adapter_path, self.device = d.selection
return True
else:
return False
else:
return False
if __name__ == '__main__':
parser = create_parser(syslog=True)
parser.add_argument("-d", "--device", "--dest", dest="device", action="store",
help=_("Send files to this device"), metavar="ADDRESS")
parser.add_argument("-s", "--source", dest="source", action="store",
help=_("Source adapter. Takes address or adapter's name eg. hci0"), metavar="PATTERN")
parser.add_argument("-u", "--delete", dest="delete", action="store_true", help=_("Delete files on exit"))
parser.add_argument("files", nargs="*", metavar="FILE",
help=_("Files to be send to the bluetooth device"))
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-sendto", syslog=args.syslog)
set_proc_title()
SendTo(args)
Gtk.main()
blueman-2.4.3/apps/blueman-sendto.in 0000775 0000000 0000000 00000012060 14650545052 0017363 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import os
import sys
import signal
import atexit
import logging
import gettext
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gio
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
_ = gettext.gettext
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.Functions import (
setup_icon_path,
check_bluetooth_status,
set_proc_title,
create_parser,
create_logger,
bmexit
)
from blueman.main.Sendto import Sender
from blueman.bluez.Manager import Manager
from blueman.bluez.errors import DBusNoSuchAdapterError
from blueman.gui.DeviceSelectorDialog import DeviceSelectorDialog
# Workaround introspection bug, gnome bug 622084
signal.signal(signal.SIGINT, signal.SIG_DFL)
class SendTo:
def __init__(self, parsed_args):
setup_icon_path()
check_bluetooth_status(_("Bluetooth needs to be turned on for file sending to work"), bmexit)
if not parsed_args.files:
self.files = self.select_files()
else:
self.files = [os.path.abspath(f) for f in parsed_args.files]
self.device = None
manager = Manager()
adapter = None
adapters = manager.get_adapters()
last_adapter_name = Gio.Settings(schema_id="org.blueman.general")["last-adapter"]
if len(adapters) == 0:
logging.error("Error: No Adapters present")
bmexit()
if parsed_args.source is not None:
try:
adapter = manager.get_adapter(parsed_args.source)
except DBusNoSuchAdapterError:
logging.error("Unknown adapter, trying first available")
pass
if adapter is None:
try:
adapter = manager.get_adapter(last_adapter_name)
except DBusNoSuchAdapterError:
adapter = manager.get_adapter()
self.adapter_path = adapter.get_object_path()
if parsed_args.delete:
def delete_files():
for file in self.files:
os.unlink(file)
atexit.register(delete_files)
if parsed_args.device is None:
if not self.select_device():
bmexit()
self.do_send()
else:
d = manager.find_device(parsed_args.device, self.adapter_path)
if d is None:
bmexit("Unknown bluetooth device")
self.device = d
self.do_send()
def do_send(self):
if not self.files:
logging.warning("No files to send")
bmexit()
sender = Sender(self.device, self.adapter_path, self.files)
def on_result(sender, res):
Gtk.main_quit()
sender.connect("result", on_result)
@staticmethod
def select_files():
d = Gtk.FileChooserDialog(title=_("Select files to send"), icon_name='blueman-send-symbolic', select_multiple=True)
d.add_buttons(_("_Cancel"), Gtk.ResponseType.REJECT, _("_OK"), Gtk.ResponseType.ACCEPT)
resp = d.run()
if resp == Gtk.ResponseType.ACCEPT:
files = d.get_filenames()
d.destroy()
return files
else:
d.destroy()
quit()
def select_device(self):
adapter_name = os.path.split(self.adapter_path)[-1]
d = DeviceSelectorDialog(discover=True, adapter_name=adapter_name)
resp = d.run()
d.close()
if resp == Gtk.ResponseType.ACCEPT:
if d.selection:
self.adapter_path, self.device = d.selection
return True
else:
return False
else:
return False
if __name__ == '__main__':
parser = create_parser(syslog=True)
parser.add_argument("-d", "--device", "--dest", dest="device", action="store",
help=_("Send files to this device"), metavar="ADDRESS")
parser.add_argument("-s", "--source", dest="source", action="store",
help=_("Source adapter. Takes address or adapter's name eg. hci0"), metavar="PATTERN")
parser.add_argument("-u", "--delete", dest="delete", action="store_true", help=_("Delete files on exit"))
parser.add_argument("files", nargs="*", metavar="FILE",
help=_("Files to be send to the bluetooth device"))
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-sendto", syslog=args.syslog)
set_proc_title()
SendTo(args)
Gtk.main()
blueman-2.4.3/apps/blueman-services 0000664 0000000 0000000 00000002326 14650545052 0017306 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import os
import sys
import logging
import signal
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
_ = gettext.gettext
gettext.textdomain("blueman")
from blueman.Functions import set_proc_title, setup_icon_path, create_logger, create_parser
from blueman.main.Services import BluemanServices
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-services", syslog=args.syslog)
setup_icon_path()
set_proc_title()
app = BluemanServices()
app.run()
blueman-2.4.3/apps/blueman-services.in 0000775 0000000 0000000 00000002331 14650545052 0017712 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import os
import sys
import logging
import signal
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path
os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")
_ = gettext.gettext
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.Functions import set_proc_title, setup_icon_path, create_logger, create_parser
from blueman.main.Services import BluemanServices
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-services", syslog=args.syslog)
setup_icon_path()
set_proc_title()
app = BluemanServices()
app.run()
blueman-2.4.3/apps/blueman-tray 0000664 0000000 0000000 00000002005 14650545052 0016434 0 ustar 00root root 0000000 0000000 #!/usr/bin/python
import logging
import os
import sys
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path.insert(0, _dirname)
gettext.textdomain("blueman")
from blueman.Functions import set_proc_title, create_parser, create_logger
from blueman.main.Tray import BluemanTray
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-tray", syslog=args.syslog)
set_proc_title()
app = BluemanTray()
app.run()
blueman-2.4.3/apps/blueman-tray.in 0000775 0000000 0000000 00000002010 14650545052 0017040 0 ustar 00root root 0000000 0000000 #!@PYTHON@
import logging
import os
import sys
import gettext
# support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if 'BLUEMAN_SOURCE' in os.environ:
sys.path.insert(0, _dirname)
gettext.textdomain("@GETTEXT_PACKAGE@")
from blueman.Functions import set_proc_title, create_parser, create_logger
from blueman.main.Tray import BluemanTray
if __name__ == '__main__':
parser = create_parser()
args = parser.parse_args()
if args.LEVEL.upper() == "DEBUG":
log_level = logging.DEBUG
elif args.LEVEL.upper() == "INFO":
log_level = logging.INFO
elif args.LEVEL.upper() == "WARNING":
log_level = logging.WARNING
elif args.LEVEL.upper() == "ERROR":
log_level = logging.ERROR
elif args.LEVEL.upper() == "CRITICAL":
log_level = logging.CRITICAL
else:
log_level = logging.WARNING
create_logger(log_level, "blueman-tray", syslog=args.syslog)
set_proc_title()
app = BluemanTray()
app.run()
blueman-2.4.3/blueman/ 0000775 0000000 0000000 00000000000 14650545052 0014574 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/Constants.py 0000664 0000000 0000000 00000001603 14650545052 0017122 0 ustar 00root root 0000000 0000000 __all__ = ["VERSION", "PACKAGE", "WEBSITE", "ICON_PATH", "PIXMAP_PATH", "UI_PATH", "BIN_DIR"]
VERSION = "2.4.3"
PACKAGE = "blueman"
WEBSITE = "https://github.com/blueman-project/blueman"
PREFIX = "/usr/local"
BIN_DIR = "/usr/local/bin"
LOCALEDIR = "/usr/local/share/locale"
ICON_PATH = "/usr/local/share/icons"
PIXMAP_PATH = "/usr/local/share/blueman/pixmaps"
UI_PATH = "/usr/local/share/blueman/ui"
DHCP_CONFIG_FILE = "/etc/dhcp3/dhcpd.conf"
POLKIT = False
GETTEXT_PACKAGE = "blueman"
RFCOMM_WATCHER_PATH = "/usr/local/libexec/blueman-rfcomm-watcher"
import os
if 'BLUEMAN_SOURCE' in os.environ:
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
BIN_DIR = os.path.join(_dirname, 'apps')
ICON_PATH = os.path.join(_dirname, 'data', 'icons')
PIXMAP_PATH = os.path.join(_dirname, 'data', 'icons', 'pixmaps')
UI_PATH = os.path.join(_dirname, 'data', 'ui')
blueman-2.4.3/blueman/Constants.py.in 0000664 0000000 0000000 00000001514 14650545052 0017530 0 ustar 00root root 0000000 0000000 __all__ = ["VERSION", "PACKAGE", "WEBSITE", "ICON_PATH", "PIXMAP_PATH", "UI_PATH", "BIN_DIR"]
VERSION = "@VERSION@"
PACKAGE = "@PACKAGE@"
WEBSITE = "https://github.com/blueman-project/blueman"
PREFIX = "@prefix@"
BIN_DIR = "@BINDIR@"
LOCALEDIR = "@LOCALEDIR@"
ICON_PATH = "@icondir@"
PIXMAP_PATH = "@pkgdatadir@/pixmaps"
UI_PATH = "@pkgdatadir@/ui"
DHCP_CONFIG_FILE = "@dhconfig@"
POLKIT = @POLKIT@
GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"
RFCOMM_WATCHER_PATH = "@LIBEXECDIR@/blueman-rfcomm-watcher"
import os
if 'BLUEMAN_SOURCE' in os.environ:
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
BIN_DIR = os.path.join(_dirname, 'apps')
ICON_PATH = os.path.join(_dirname, 'data', 'icons')
PIXMAP_PATH = os.path.join(_dirname, 'data', 'icons', 'pixmaps')
UI_PATH = os.path.join(_dirname, 'data', 'ui')
blueman-2.4.3/blueman/DeviceClass.py 0000664 0000000 0000000 00000055166 14650545052 0017350 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
major_cls = (
# translators: device class
_("Miscellaneous"),
# translators: device class
_("Computer"),
# translators: device class
_("Phone"),
# translators: device class
_("Access point"),
# translators: device class
_("Audio/video"),
# translators: device class
_("Peripheral"),
# translators: device class
_("Imaging"),
# translators: device class
_("Wearable"),
# translators: device class
_("Toy"),
# translators: device class
_("Uncategorized")
)
computer_minor_cls = (
# translators: device class
_("Uncategorized"),
# translators: device class
_("Desktop"),
# translators: device class
_("Server"),
# translators: device class
_("Laptop"),
# translators: device class
_("Handheld"),
# translators: device class
_("Palm"),
# translators: device class
_("Wearable")
)
phone_minor_cls = (
# translators: device class
_("Uncategorized"),
# translators: device class
_("Cellular"),
# translators: device class
_("Cordless"),
# translators: device class
_("Smartphone"),
# translators: device class
_("Modem"),
# translators: device class
_("ISDN")
)
access_point_minor_cls = (
# translators: device class
_("Fully"),
# translators: device class
_("1–17 percent"),
# translators: device class
_("17–33 percent"),
# translators: device class
_("33–50 percent"),
# translators: device class
_("50–67 percent"),
# translators: device class
_("67–83 percent"),
# translators: device class
_("83–99 percent"),
# translators: device class
_("Not available")
)
audio_video_minor_cls = (
# translators: device class
_("Uncategorized"),
# translators: device class
_("Headset"),
# translators: device class
_("Handsfree"),
# translators: device class
_("Unknown"),
# translators: device class
_("Microphone"),
# translators: device class
_("Loudspeaker"),
# translators: device class
_("Headphones"),
# translators: device class
_("Portable audio"),
# translators: device class
_("Car audio"),
# translators: device class
_("Set-top box"),
# translators: device class
_("Hi-Fi audio"),
# translators: device class
_("VCR"),
# translators: device class
_("Video camera"),
# translators: device class
_("Camcorder"),
# translators: device class
_("Video monitor"),
# translators: device class
_("Video display and loudspeaker"),
# translators: device class
_("Video conferencing"),
# translators: device class
_("Unknown"),
# translators: device class
_("Gaming/Toy")
)
peripheral_minor_cls = (
# translators: device class
_("Uncategorized"),
# translators: device class
_("Keyboard"),
# translators: device class
_("Pointing"),
# translators: device class
_("Combo")
)
imaging_minor_cls = (
# translators: device class
_("Display"),
# translators: device class
_("Camera"),
# translators: device class
_("Scanner"),
# translators: device class
_("Printer")
)
wearable_minor_cls = (
# translators: device class
_("Wrist watch"),
# translators: device class
_("Pager"),
# translators: device class
_("Jacket"),
# translators: device class
_("Helmet"),
# translators: device class
_("Glasses")
)
toy_minor_cls = (
# translators: device class
_("Robot"),
# translators: device class
_("Vehicle"),
# translators: device class
_("Doll"),
# translators: device class
_("Controller"),
# translators: device class
_("Game")
)
gatt_appearance_categories = {
0x00: ("Unknown", {0x00: _("Generic Unknown")}),
0x01: ("Phone", {0x00: _("Generic Phone")}),
0x02: ("Computer", {0x00: _("Generic Computer"),
0x01: _("Desktop Workstation"),
0x02: _("Server-class Computer"),
0x03: _("Laptop"),
0x04: _("Handheld PC/PDA (clamshell)"),
0x05: _("Palm-size PC/PDA"),
0x06: _("Wearable computer (watch size)"),
0x07: _("Tablet"),
0x08: _("Docking Station"),
0x09: _("All in One"),
0x0A: _("Blade Server"),
0x0B: _("Convertible"),
0x0C: _("Detachable"),
0x0D: _("IoT Gateway"),
0x0E: _("Mini PC"),
0x0F: _("Stick PC")}),
0x03: ("Watch", {0x00: _("Generic Watch"),
0x01: _("Sports Watch"),
0x02: _("Smartwatch")}),
0x04: ("Clock", {0x00: _("Generic Clock")}),
0x05: ("Display", {0x00: _("Generic Display")}),
0x06: ("Remote Control", {0x00: _("Generic Remote Control")}),
0x07: ("Eye-glasses", {0x00: _("Generic Eye-glasses")}),
0x08: ("Tag", {0x00: _("Generic Tag")}),
0x09: ("Keyring", {0x00: _("Generic Keyring")}),
0x0A: ("Media Player", {0x00: _("Generic Media Player")}),
0x0B: ("Barcode Scanner", {0x00: _("Generic Barcode Scanner")}),
0x0C: ("Thermometer", {0x00: _("Generic Thermometer"),
1: _("Ear Thermometer")}),
0x0D: ("Heart Rate Sensor", {0x00: _("Generic Heart Rate Sensor"),
1: _("Heart Rate Belt")}),
0x0E: ("Blood Pressure", {0x00: _("Generic Blood Pressure"),
1: _("Arm Blood Pressure"),
2: _("Wrist Blood Pressure")}),
0x0F: ("Human Interface Device", {0x00: _("Generic Human Interface Device"),
0x01: _("Keyboard"),
0x02: _("Mouse"),
0x03: _("Joystick"),
0x04: _("Gamepad"),
0x05: _("Digitizer Tablet"),
0x06: _("Card Reader"),
0x07: _("Digital Pen"),
0x08: _("Barcode Scanner"),
0x09: _("Touchpad"),
0x0a: _("Presentation Remote")}),
0x10: ("Glucose Meter", {0x00: _("Generic Glucose Meter")}),
0x11: ("Running Walking Sensor", {0x00: _("Generic Running Walking Sensor"),
0x01: _("In-Shoe Running Walking Sensor"),
0x02: _("On-Shoe Running Walking Sensor"),
0x03: _("On-Hip Running Walking Sensor")}),
0x12: ("Cycling", {0x00: _("Generic Cycling"),
0x01: _("Cycling Computer"),
0x02: _("Speed Sensor"),
0x03: _("Cadence Sensor"),
0x04: _("Power Sensor"),
0x05: _("Speed and Cadence Sensor")}),
0x13: ("Control Device", {0x00: _("Generic Control Device"),
0x01: _("Switch"),
0x02: _("Multi-switch"),
0x03: _("Button"),
0x04: _("Slider"),
0x05: _("Rotary Switch"),
0x06: _("Touch Panel"),
0x07: _("Single Switch"),
0x08: _("Double Switch"),
0x09: _("Triple Switch"),
0x0A: _("Battery Switch"),
0x0B: _("Energy Harvesting Switch"),
0x0C: _("Push Button"),
0x0D: _("Dial")}),
0x14: ("Network Device", {0x00: _("Generic Network Device"),
0x01: _("Access Point"),
0x02: _("Mesh Device"),
0x03: _("Mesh Network Proxy")}),
0x15: ("Sensor", {0x00: _("Generic Sensor"),
0x01: _("Motion Sensor"),
0x02: _("Air quality Sensor"),
0x03: _("Temperature Sensor"),
0x04: _("Humidity Sensor"),
0x05: _("Leak Sensor"),
0x06: _("Smoke Sensor"),
0x07: _("Occupancy Sensor"),
0x08: _("Contact Sensor"),
0x09: _("Carbon Monoxide Sensor"),
0x0A: _("Carbon Dioxide Sensor"),
0x0B: _("Ambient Light Sensor"),
0x0C: _("Energy Sensor"),
0x0D: _("Color Light Sensor"),
0x0E: _("Rain Sensor"),
0x0F: _("Fire Sensor"),
0x10: _("Wind Sensor"),
0x11: _("Proximity Sensor"),
0x12: _("Multi-Sensor"),
0x13: _("Flush Mounted Sensor"),
0x14: _("Ceiling Mounted Sensor"),
0x15: _("Wall Mounted Sensor"),
0x16: _("Multisensor"),
0x17: _("Energy Meter"),
0x18: _("Flame Detector"),
0x19: _("Vehicle Tire Pressure Sensor")}),
0x16: ("Light Fixtures", {0x00: _("Generic Light Fixtures"),
0x01: _("Wall Light"),
0x02: _("Ceiling Light"),
0x03: _("Floor Light"),
0x04: _("Cabinet Light"),
0x05: _("Desk Light"),
0x06: _("Troffer Light"),
0x07: _("Pendant Light"),
0x08: _("In-ground Light"),
0x09: _("Flood Light"),
0x0A: _("Underwater Light"),
0x0B: _("Bollard with Light"),
0x0C: _("Pathway Light"),
0x0D: _("Garden Light"),
0x0E: _("Pole-top Light"),
0x0F: _("Spotlight"),
0x10: _("Linear Light"),
0x11: _("Street Light"),
0x12: _("Shelves Light"),
0x13: _("Bay Light"),
0x14: _("Emergency Exit Light"),
0x15: _("Light Controller"),
0x16: _("Light Driver"),
0x17: _("Bulb"),
0x18: _("Low-bay Light"),
0x19: _("High-bay Light")}),
0x17: ("Fan", {0x00: _("Generic Fan"),
0x01: _("Ceiling Fan"),
0x02: _("Axial Fan"),
0x03: _("Exhaust Fan"),
0x04: _("Pedestal Fan"),
0x05: _("Desk Fan"),
0x06: _("Wall Fan")}),
0x18: ("HVAC", {0x00: _("Generic HVAC"),
0x01: _("Thermostat"),
0x02: _("Humidifier"),
0x03: _("De-humidifier"),
0x04: _("Heater"),
0x05: _("Radiator"),
0x06: _("Boiler"),
0x07: _("Heat Pump"),
0x08: _("Infrared Heater"),
0x09: _("Radiant Panel Heater"),
0x0A: _("Fan Heater"),
0x0B: _("Air Curtain")}),
0x19: ("Air Conditioning", {0x00: _("Generic Air Conditioning")}),
0x1A: ("Humidifier", {0x00: _("Generic Humidifier")}),
0x1B: ("Heating", {0x00: _("Generic Heating"),
0x01: _("Radiator"),
0x02: _("Boiler"),
0x03: _("Heat Pump"),
0x04: _("Infrared Heater"),
0x05: _("Radiant Panel Heater"),
0x06: _("Fan Heater"),
0x07: _("Air Curtain")}),
0x1C: ("Access Control", {0x00: _("Generic Access Control"),
0x01: _("Access Door"),
0x02: _("Garage Door"),
0x03: _("Emergency Exit Door"),
0x04: _("Access Lock"),
0x05: _("Elevator"),
0x06: _("Window"),
0x07: _("Entrance Gate"),
0x08: _("Door Lock"),
0x09: _("Locker")}),
0x1D: ("Motorized Device", {0x00: _("Generic Motorized Device"),
0x01: _("Motorized Gate"),
0x02: _("Awning"),
0x03: _("Blinds or Shades"),
0x04: _("Curtains"),
0x05: _("Screen")}),
0x1E: ("Power Device", {0x00: _("Generic Power Device"),
0x01: _("Power Outlet"),
0x02: _("Power Strip"),
0x03: _("Plug"),
0x04: _("Power Supply"),
0x05: _("LED Driver"),
0x06: _("Fluorescent Lamp Gear"),
0x07: _("HID Lamp Gear"),
0x08: _("Charge Case"),
0x09: _("Power Bank")}),
0x1F: ("Light Source", {0x00: _("Generic Light Source"),
0x01: _("Incandescent Light Bulb"),
0x02: _("LED Lamp"),
0x03: _("HID Lamp"),
0x04: _("Fluorescent Lamp"),
0x05: _("LED Array"),
0x06: _("Multi-Color LED Array"),
0x07: _("Low voltage halogen"),
0x08: _("Organic light emitting diode (OLED)")}),
0x20: ("Window Covering", {0x00: _("Generic Window Covering"),
0x01: _("Window Shades"),
0x02: _("Window Blinds"),
0x03: _("Window Awning"),
0x04: _("Window Curtain"),
0x05: _("Exterior Shutter"),
0x06: _("Exterior Screen")}),
0x21: ("Audio Sink", {0x00: _("Generic Audio Sink"),
0x01: _("Standalone Speaker"),
0x02: _("Soundbar"),
0x03: _("Bookshelf Speaker"),
0x04: _("Standmounted Speaker"),
0x05: _("Speakerphone")}),
0x22: ("Audio Source", {0x00: _("Generic Audio Source"),
0x01: _("Microphone"),
0x02: _("Alarm"),
0x03: _("Bell"),
0x04: _("Horn"),
0x05: _("Broadcasting Device"),
0x06: _("Service Desk"),
0x07: _("Kiosk"),
0x08: _("Broadcasting Room"),
0x09: _("Auditorium")}),
0x23: ("Motorized Vehicle", {0x00: _("Generic Motorized Vehicle"),
0x01: _("Car"),
0x02: _("Large Goods Vehicle"),
0x03: _("2-Wheeled Vehicle"),
0x04: _("Motorbike"),
0x05: _("Scooter"),
0x06: _("Moped"),
0x07: _("3-Wheeled Vehicle"),
0x08: _("Light Vehicle"),
0x09: _("Quad Bike"),
0x0A: _("Minibus"),
0x0B: _("Bus"),
0x0C: _("Trolley"),
0x0D: _("Agricultural Vehicle"),
0x0E: _("Camper / Caravan"),
0x0F: _("Recreational Vehicle / Motor Home")}),
0x24: ("Domestic Appliance", {0x00: _("Generic Domestic Appliance"),
0x01: _("Refrigerator"),
0x02: _("Freezer"),
0x03: _("Oven"),
0x04: _("Microwave"),
0x05: _("Toaster"),
0x06: _("Washing Machine"),
0x07: _("Dryer"),
0x08: _("Coffee maker"),
0x09: _("Clothes iron"),
0x0A: _("Curling iron"),
0x0B: _("Hair dryer"),
0x0C: _("Vacuum cleaner"),
0x0D: _("Robotic vacuum cleaner"),
0x0E: _("Rice cooker"),
0x0F: _("Clothes steamer")}),
0x25: ("Wearable Audio Device", {0x00: _("Generic Wearable Audio Device"),
0x01: _("Earbud"),
0x02: _("Headset"),
0x03: _("Headphones"),
0x04: _("Neck Band")}),
0x26: ("Aircraft", {0x00: _("Generic Aircraft"),
0x01: _("Light Aircraft"),
0x02: _("Microlight"),
0x03: _("Paraglider"),
0x04: _("Large Passenger Aircraft")}),
0x27: ("AV Equipment", {0x00: _("Generic AV Equipment"),
0x01: _("Amplifier"),
0x02: _("Receiver"),
0x03: _("Radio"),
0x04: _("Tuner"),
0x05: _("Turntable"),
0x06: _("CD Player"),
0x07: _("DVD Player"),
0x08: _("Bluray Player"),
0x09: _("Optical Disc Player"),
0x0A: _("Set-Top Box")}),
0x28: ("Display Equipment", {0x00: _("Generic Display Equipment"),
0x01: _("Television"),
0x02: _("Monitor"),
0x03: _("Projector")}),
0x29: ("Hearing aid", {0x00: _("Generic Hearing aid"),
0x01: _("In-ear hearing aid"),
0x02: _("Behind-ear hearing aid"),
0x03: _("Cochlear Implant")}),
0x2A: ("Gaming", {0x00: _("Generic Gaming"),
0x01: _("Home Video Game Console"),
0x02: _("Portable handheld console")}),
0x2B: ("Signage", {0x00: _("Generic Signage"),
0x01: _("Digital Signage"),
0x02: _("Electronic Label")}),
0x31: ("Pulse Oximeter", {0x00: _("Generic Pulse Oximeter"),
0x01: _("Fingertip Pulse Oximeter"),
0x02: _("Wrist Worn Pulse Oximeter")}),
0x32: ("Weight Scale", {0x00: _("Generic Weight Scale")}),
0x33: ("Personal Mobility Device", {0x00: _("Generic Personal Mobility Device"),
0x01: _("Powered Wheelchair"),
0x02: _("Mobility Scooter")}),
0x34: ("Continuous Glucose Monitor", {0x00: _("Generic Continuous Glucose Monitor")}),
0x35: ("Insulin Pump", {0x00: _("Generic Insulin Pump"),
0x01: _("Insulin Pump, durable pump"),
0x04: _("Insulin Pump, patch pump"),
0x08: _("Insulin Pen")}),
0x36: ("Medication Delivery", {0x00: _("Generic Medication Delivery")}),
0x37: ("Spirometer", {0x00: _("Generic Spirometer"),
0x01: _("Handheld Spirometer")}),
0x51: ("Outdoor Sports Activity", {0x00: _("Generic Outdoor Sports Activity"),
0x01: _("Location Display"),
0x02: _("Location and Navigation Display"),
0x03: _("Location Pod"),
0x04: _("Location and Navigation Pod")})
}
def get_major_class(klass: int) -> str:
index = (klass >> 8) & 0x1F
if index > 8:
return major_cls[9]
return major_cls[index]
def get_minor_class(klass: int) -> str:
if not klass:
return _("Unknown")
i = (klass >> 8) & 0x1F
if i == 1:
minor_index = (klass >> 2) & 0x3F
if minor_index < len(computer_minor_cls):
return computer_minor_cls[minor_index]
else:
return ""
elif i == 2:
minor_index = (klass >> 2) & 0x3F
if minor_index < len(phone_minor_cls):
return phone_minor_cls[minor_index]
return ""
elif i == 3:
minor_index = (klass >> 5) & 0x07
if minor_index < len(access_point_minor_cls):
return access_point_minor_cls[minor_index]
else:
return ""
elif i == 4:
minor_index = (klass >> 2) & 0x3F
if minor_index < len(audio_video_minor_cls):
return audio_video_minor_cls[minor_index]
else:
return ""
elif i == 5:
minor_index = (klass >> 6) & 0x03
if minor_index < len(peripheral_minor_cls):
return peripheral_minor_cls[minor_index]
else:
return ""
elif i == 6:
return _("Imaging")
elif i == 7:
minor_index = (klass >> 2) & 0x3F
if minor_index < len(wearable_minor_cls):
return wearable_minor_cls[minor_index]
else:
return ""
elif i == 8:
minor_index = (klass >> 2) & 0x3F
if minor_index < len(toy_minor_cls):
return toy_minor_cls[minor_index]
else:
return ""
return _("Unknown")
# First 10 bits is the category, the following 6 bits sub category
def gatt_appearance_to_name(appearance: int) -> str:
cat = appearance >> 0x6
subcat = appearance & 0x3f
if (19 <= cat <= 48) or (55 <= cat <= 80):
# These ranges are reserved
logging.debug(f"Reserved category found: {appearance}")
return gatt_appearance_categories[0][0]
elif cat > 81:
logging.warning(f"Invalid category found: {appearance}")
return gatt_appearance_categories[0][0]
cat_name, subcats = gatt_appearance_categories[cat]
if subcat not in subcats:
return cat_name
else:
return subcats[subcat]
blueman-2.4.3/blueman/Functions.py 0000664 0000000 0000000 00000023600 14650545052 0017117 0 ustar 00root root 0000000 0000000 # Copyright (C) 2008 Valmantas Paliksa
# Copyright (C) 2008 Tadas Dailyda
#
# Licensed under the GNU General Public License Version 3
#
# 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 .
#
from time import sleep
from typing import Optional, Dict, Tuple, List, Callable, Iterable, Union, Any
import re
import os
import sys
import errno
from gettext import gettext as _
import logging
import logging.handlers
import argparse
from ctypes import cdll, byref, create_string_buffer, sizeof, c_long
import traceback
import fcntl
import struct
import socket
import array
import time
import cairo
from blueman.main.DBusProxies import AppletService, DBusProxyFailed
from blueman.Constants import BIN_DIR, ICON_PATH
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import Gio
__all__ = ["check_bluetooth_status", "launch", "setup_icon_path", "adapter_path_to_name", "e_", "bmexit",
"format_bytes", "create_menuitem", "have", "set_proc_title", "create_logger", "create_parser", "open_rfcomm",
"get_local_interfaces"]
def check_bluetooth_status(message: str, exitfunc: Callable[[], Any]) -> None:
try:
applet = AppletService()
except DBusProxyFailed as e:
logging.exception(e)
print("Blueman applet needs to be running")
exitfunc()
return
if "PowerManager" not in applet.QueryPlugins():
return
if not applet.GetBluetoothStatus():
d = Gtk.MessageDialog(
type=Gtk.MessageType.ERROR, icon_name="blueman",
text=_("Bluetooth Turned Off"), secondary_text=message)
d.add_button(_("Exit"), Gtk.ResponseType.NO)
d.add_button(_("Enable Bluetooth"), Gtk.ResponseType.YES)
resp = d.run()
d.destroy()
if resp != Gtk.ResponseType.YES:
exitfunc()
return
applet.SetBluetoothStatus('(b)', True)
if not applet.GetBluetoothStatus():
print('Failed to enable bluetooth')
exitfunc()
def launch(
cmd: str,
paths: Optional[Iterable[str]] = None,
system: bool = False,
icon_name: Optional[str] = None,
name: str = "blueman",
sn: bool = True,
) -> bool:
"""Launch a gui app with startup notification"""
context = None
gtktimestamp = Gtk.get_current_event_time()
if gtktimestamp == 0:
logging.info("Gtk eventtime is 0, not using LaunchContext")
timestamp = int(time.clock_gettime(time.CLOCK_MONOTONIC_RAW))
else:
timestamp = gtktimestamp
display = Gdk.Display.get_default()
assert display
context = display.get_app_launch_context()
context.set_timestamp(timestamp)
if sn:
flags = Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION
else:
flags = Gio.AppInfoCreateFlags.NONE
env = os.environ
env["BLUEMAN_EVENT_TIME"] = str(timestamp)
if not system:
cmd = os.path.join(BIN_DIR, cmd)
else:
cmd = os.path.expanduser(cmd)
if paths:
files: Optional[List[Gio.File]] = [Gio.File.new_for_commandline_arg(p) for p in paths]
else:
files = None
if icon_name and context is not None:
context.set_icon_name(icon_name)
appinfo = Gio.AppInfo.create_from_commandline(cmd, name, flags)
launched: bool = appinfo.launch(files, context)
if not launched:
logging.error(f"Command: {cmd} failed")
return launched
def setup_icon_path() -> None:
ic = Gtk.IconTheme.get_default()
ic.prepend_search_path(ICON_PATH)
def adapter_path_to_name(path: Optional[str]) -> Optional[str]:
if path is None or path == '':
return None
match = re.search(r".*(hci[0-9]*)", path)
if match:
return match.group(1)
return None
# format error
def e_(msg: Union[str, Exception]) -> Tuple[str, Optional[str]]:
if isinstance(msg, Exception):
return str(msg), traceback.format_exc()
else:
s = msg.strip().split(": ")[-1]
return s, None
def format_bytes(size: float) -> Tuple[float, str]:
size = float(size)
if size < 1024:
ret = size
suffix = _("B")
elif 1024 < size < (1024 * 1024):
ret = size / 1024
suffix = _("KB")
elif (1024 * 1024) < size < (1024 * 1024 * 1024):
ret = size / (1024 * 1024)
suffix = _("MB")
else:
ret = size / (1024 * 1024 * 1024)
suffix = _("GB")
return ret, suffix
def create_menuitem(
text: str,
icon_name: Optional[str] = None,
pixbuf: Optional[GdkPixbuf.Pixbuf] = None,
surface: Optional[cairo.Surface] = None,
) -> Gtk.ImageMenuItem:
image = Gtk.Image(pixel_size=16)
if icon_name:
image.set_from_icon_name(icon_name, Gtk.IconSize.MENU)
elif surface:
image.set_from_surface(surface)
elif pixbuf:
image.set_from_pixbuf(pixbuf)
else:
raise ValueError("At least provide one of, icon name, surface or pixbuf")
item = Gtk.ImageMenuItem(label=text, image=image, use_underline=True)
child = item.get_child()
assert isinstance(child, Gtk.AccelLabel)
child.set_use_markup(True)
item.show_all()
return item
def have(t: str) -> Optional[str]:
paths = os.environ['PATH'] + ':/sbin:/usr/sbin'
for path in paths.split(os.pathsep):
exec_path = os.path.join(path, t)
exists = os.path.exists(exec_path)
executable = os.access(exec_path, os.EX_OK)
if exists and executable:
return exec_path
return None
def set_proc_title(name: Optional[str] = None) -> int:
"""Set the process title"""
if not name:
name = os.path.basename(sys.argv[0])
libc = cdll.LoadLibrary('libc.so.6')
buff = create_string_buffer(len(name) + 1)
buff.value = name.encode("UTF-8")
ret: int = libc.prctl(15, byref(buff), 0, 0, 0)
if ret != 0:
logging.error("Failed to set process title")
return ret
logger_format = '%(name)s %(asctime)s %(levelname)-8s %(module)s:%(lineno)s %(funcName)-10s: %(message)s'
syslog_logger_format = '%(name)s %(levelname)s %(module)s:%(lineno)s %(funcName)s: %(message)s'
logger_date_fmt = '%H.%M.%S'
def create_logger(
log_level: int,
name: str,
log_format: Optional[str] = None,
date_fmt: Optional[str] = None,
syslog: bool = False,
) -> logging.Logger:
if log_format is None:
log_format = logger_format
if date_fmt is None:
date_fmt = logger_date_fmt
logging.basicConfig(level=log_level, format=log_format, datefmt=date_fmt)
logger = logging.getLogger(None) # Root logger
logger.name = name
if syslog:
syslog_handler = logging.handlers.SysLogHandler(address="/dev/log")
syslog_formatter = logging.Formatter(syslog_logger_format)
syslog_handler.setFormatter(syslog_formatter)
logger.addHandler(syslog_handler)
return logger
def create_parser(
parser: Optional[argparse.ArgumentParser] = None,
syslog: bool = True,
loglevel: bool = True,
) -> argparse.ArgumentParser:
if parser is None:
parser = argparse.ArgumentParser()
if loglevel:
parser.add_argument("--loglevel", dest="LEVEL", default="warning")
if syslog:
parser.add_argument("--syslog", dest="syslog", action="store_true")
return parser
def open_rfcomm(file: str, mode: int) -> int:
try:
return os.open(file, mode | os.O_EXCL | os.O_NONBLOCK | os.O_NOCTTY)
except OSError as err:
if err.errno == errno.EBUSY:
logging.warning(f"{file} is busy, delaying 2 seconds")
sleep(2)
return open_rfcomm(file, mode)
else:
raise
def _netmask_for_ifacename(name: str, sock: socket.socket) -> Optional[str]:
siocgifnetmask = 0x891b
bytebuf = struct.pack('256s', name.encode('utf-8'))
try:
ret = fcntl.ioctl(sock.fileno(), siocgifnetmask, bytebuf)
except OSError:
logging.error('siocgifnetmask failed')
return None
return socket.inet_ntoa(ret[20:24])
def get_local_interfaces() -> Dict[str, Tuple[str, Optional[str]]]:
""" Returns a dictionary of name:ip, mask key value pairs. """
siocgifconf = 0x8912
names = array.array('B', 4096 * b'\0')
names_address, names_length = names.buffer_info()
mutable_byte_buffer = struct.pack('iL', 4096, names_address)
try:
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
try:
mutated_byte_buffer = fcntl.ioctl(sock.fileno(), siocgifconf, mutable_byte_buffer)
except OSError:
logging.error('siocgifconf failed')
return {}
max_bytes_out, names_address_out = struct.unpack('iL', mutated_byte_buffer)
namestr = names.tobytes()
ip_dict = {}
for i in range(0, max_bytes_out, 24 + 2 * sizeof(c_long)):
name = namestr[i: i + 16].split(b'\0', 1)[0].decode('utf-8')
ipaddr = socket.inet_ntoa(namestr[i + 20: i + 24])
mask = _netmask_for_ifacename(name, sock)
ip_dict[name] = (ipaddr, mask)
except OSError:
logging.error('Socket creation failed', exc_info=True)
return {}
return ip_dict
def bmexit(msg: Optional[Union[str, int]] = None) -> None:
raise SystemExit(msg)
blueman-2.4.3/blueman/Makefile.am 0000664 0000000 0000000 00000000737 14650545052 0016637 0 ustar 00root root 0000000 0000000 SUBDIRS = \
bluez \
config \
gui \
main \
plugins \
services
bluemandir = $(pythondir)/blueman
blueman_PYTHON = \
Constants.py \
DeviceClass.py \
Functions.py \
Sdp.py \
Service.py \
gobject.py \
bluemantyping.py \
__init__.py
CLEANFILES = \
Constants.py \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
EXTRA_DIST = \
Constants.py.in
clean-local:
find . \( -name \*.pyc -o -name \*.pyo -o -name __pycache__ \) -prune -exec rm -rf {} +
blueman-2.4.3/blueman/Makefile.in 0000664 0000000 0000000 00000057624 14650545052 0016657 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = Constants.py
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Constants.py.in $(srcdir)/Makefile.in \
$(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = \
bluez \
config \
gui \
main \
plugins \
services
bluemandir = $(pythondir)/blueman
blueman_PYTHON = \
Constants.py \
DeviceClass.py \
Functions.py \
Sdp.py \
Service.py \
gobject.py \
bluemantyping.py \
__init__.py
CLEANFILES = \
Constants.py \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
EXTRA_DIST = \
Constants.py.in
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
Constants.py: $(top_builddir)/config.status $(srcdir)/Constants.py.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
find . \( -name \*.pyc -o -name \*.pyo -o -name __pycache__ \) -prune -exec rm -rf {} +
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/Sdp.py 0000664 0000000 0000000 00000030232 14650545052 0015674 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Optional
from uuid import UUID
# https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
# http://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/sdp.h
SDP_SERVER_SVCLASS_ID = 0x1000
BROWSE_GRP_DESC_SVCLASS_ID = 0x1001
PUBLIC_BROWSE_GROUP = 0x1002
SERIAL_PORT_SVCLASS_ID = 0x1101
LAN_ACCESS_SVCLASS_ID = 0x1102
DIALUP_NET_SVCLASS_ID = 0x1103
IRMC_SYNC_SVCLASS_ID = 0x1104
OBEX_OBJPUSH_SVCLASS_ID = 0x1105
OBEX_FILETRANS_SVCLASS_ID = 0x1106
IRMC_SYNC_CMD_SVCLASS_ID = 0x1107
HEADSET_SVCLASS_ID = 0x1108
CORDLESS_TELEPHONY_SVCLASS_ID = 0x1109
AUDIO_SOURCE_SVCLASS_ID = 0x110a
AUDIO_SINK_SVCLASS_ID = 0x110b
AV_REMOTE_TARGET_SVCLASS_ID = 0x110c
ADVANCED_AUDIO_SVCLASS_ID = 0x110d
AV_REMOTE_SVCLASS_ID = 0x110e
AV_REMOTE_CONTROLLER_SVCLASS_ID = 0x110f
INTERCOM_SVCLASS_ID = 0x1110
FAX_SVCLASS_ID = 0x1111
HEADSET_AGW_SVCLASS_ID = 0x1112
WAP_SVCLASS_ID = 0x1113
WAP_CLIENT_SVCLASS_ID = 0x1114
PANU_SVCLASS_ID = 0x1115
NAP_SVCLASS_ID = 0x1116
GN_SVCLASS_ID = 0x1117
DIRECT_PRINTING_SVCLASS_ID = 0x1118
REFERENCE_PRINTING_SVCLASS_ID = 0x1119
IMAGING_SVCLASS_ID = 0x111a
IMAGING_RESPONDER_SVCLASS_ID = 0x111b
IMAGING_ARCHIVE_SVCLASS_ID = 0x111c
IMAGING_REFOBJS_SVCLASS_ID = 0x111d
HANDSFREE_SVCLASS_ID = 0x111e
HANDSFREE_AGW_SVCLASS_ID = 0x111f
DIRECT_PRT_REFOBJS_SVCLASS_ID = 0x1120
REFLECTED_UI_SVCLASS_ID = 0x1121
BASIC_PRINTING_SVCLASS_ID = 0x1122
PRINTING_STATUS_SVCLASS_ID = 0x1123
HID_SVCLASS_ID = 0x1124
HCR_SVCLASS_ID = 0x1125
HCR_PRINT_SVCLASS_ID = 0x1126
HCR_SCAN_SVCLASS_ID = 0x1127
CIP_SVCLASS_ID = 0x1128
VIDEO_CONF_GW_SVCLASS_ID = 0x1129
UDI_MT_SVCLASS_ID = 0x112a
UDI_TA_SVCLASS_ID = 0x112b
AV_SVCLASS_ID = 0x112c
SAP_SVCLASS_ID = 0x112d
PBAP_PCE_SVCLASS_ID = 0x112e
PBAP_PSE_SVCLASS_ID = 0x112f
PBAP_SVCLASS_ID = 0x1130
MAP_MSE_SVCLASS_ID = 0x1132
MAP_MCE_SVCLASS_ID = 0x1133
MAP_SVCLASS_ID = 0x1134
GNSS_SVCLASS_ID = 0x1135
GNSS_SERVER_SVCLASS_ID = 0x1136
MPS_SC_SVCLASS_ID = 0x113A
MPS_SVCLASS_ID = 0x113B
PNP_INFO_SVCLASS_ID = 0x1200
GENERIC_NETWORKING_SVCLASS_ID = 0x1201
GENERIC_FILETRANS_SVCLASS_ID = 0x1202
GENERIC_AUDIO_SVCLASS_ID = 0x1203
GENERIC_TELEPHONY_SVCLASS_ID = 0x1204
UPNP_SVCLASS_ID = 0x1205
UPNP_IP_SVCLASS_ID = 0x1206
UPNP_PAN_SVCLASS_ID = 0x1300
UPNP_LAP_SVCLASS_ID = 0x1301
UPNP_L2CAP_SVCLASS_ID = 0x1302
VIDEO_SOURCE_SVCLASS_ID = 0x1303
VIDEO_SINK_SVCLASS_ID = 0x1304
VIDEO_DISTRIBUTION_SVCLASS_ID = 0x1305
HDP_SVCLASS_ID = 0x1400
HDP_SOURCE_SVCLASS_ID = 0x1401
HDP_SINK_SVCLASS_ID = 0x1402
GENERIC_ACCESS_SVCLASS_ID = 0x1800
GENERIC_ATTRIB_SVCLASS_ID = 0x1801
BATTERY_SERVICE_SVCLASS_ID = 0x180F
APPLE_AGENT_SVCLASS_ID = 0x2112
uuid_names = {
0x0001: _("SDP"),
0x0002: _("UDP"),
0x0003: _("RFCOMM"),
0x0004: _("TCP"),
0x0005: _("TCS-BIN"),
0x0006: _("TCS-AT"),
0x0007: _("ATT"),
0x0008: _("OBEX"),
0x0009: _("IP"),
0x000a: _("FTP"),
0x000c: _("HTTP"),
0x000e: _("WSP"),
0x000f: _("BNEP"),
0x0010: _("UPnP/ESDP"),
0x0011: _("HIDP"),
0x0012: _("Hardcopy Control Channel"),
0x0014: _("Hardcopy Data Channel"),
0x0016: _("Hardcopy Notification"),
0x0017: _("AVCTP"),
0x0019: _("AVDTP"),
0x001b: _("CMTP"),
0x001d: _("UDI_C-Plane"),
0x001e: _("Multi-Channel Adaptation Protocol (MCAP)"),
0x001f: _("Multi-Channel Adaptation Protocol (MCAP)"),
0x0100: _("L2CAP"),
0x1000: _("ServiceDiscoveryServerServiceClassID"),
0x1001: _("BrowseGroupDescriptorServiceClassID"),
0x1002: _("Public Browse Group"),
0x1101: _("Serial Port"),
0x1102: _("LAN Access Using PPP"),
0x1103: _("Dialup Networking (DUN)"),
0x1104: _("IrMC Sync"),
0x1105: _("OBEX Object Push"),
0x1106: _("OBEX File Transfer"),
0x1107: _("IrMC Sync Command"),
0x1108: _("Headset"),
0x1109: _("Cordless Telephony"),
0x110a: _("Audio Source"),
0x110b: _("Audio Sink"),
0x110c: _("Remote Control Target"),
0x110d: _("Advanced Audio"),
0x110e: _("Remote Control"),
0x110f: _("Video Conferencing"),
0x1110: _("Intercom"),
0x1111: _("Fax"),
0x1112: _("Headset Audio Gateway"),
0x1113: _("WAP"),
0x1114: _("WAP Client"),
0x1115: _("PANU"),
0x1116: _("Network Access Point"),
0x1117: _("Group Network"),
0x1118: _("DirectPrinting (BPP)"),
0x1119: _("ReferencePrinting (BPP)"),
0x111a: _("Imaging (BIP)"),
0x111b: _("ImagingResponder (BIP)"),
0x111c: _("ImagingAutomaticArchive (BIP)"),
0x111d: _("ImagingReferencedObjects (BIP)"),
0x111e: _("Handsfree"),
0x111f: _("Handsfree Audio Gateway"),
0x1120: _("DirectPrintingReferenceObjectsService (BPP)"),
0x1121: _("ReflectedUI (BPP)"),
0x1122: _("Basic Printing (BPP)"),
0x1123: _("Printing Status (BPP)"),
0x1124: _("Human Interface Device Service (HID)"),
0x1125: _("HardcopyCableReplacement (HCR)"),
0x1126: _("HCR_Print (HCR)"),
0x1127: _("HCR_Scan (HCR)"),
0x1128: _("Common ISDN Access (CIP)"),
0x1129: _("VideoConferencingGW (VCP)"),
0x112a: _("UDI-MT"),
0x112b: _("UDI-TA"),
0x112c: _("Audio/Video"),
0x112d: _("SIM Access (SAP)"),
0x112e: _("Phonebook Access (PBAP) - PCE"),
0x112f: _("Phonebook Access (PBAP) - PSE"),
0x1130: _("Phonebook Access (PBAP)"),
0x1131: _("Headset"),
0x1132: _("Message Access Server"),
0x1133: _("Message Notification Server"),
0x1134: _("Message Access Profile (MAP)"),
0x1135: _("GNSS"),
0x1136: _("GNSS Server"),
0x1137: _("3D Display"),
0x1138: _("3D Glasses"),
0x1139: _("3D Synchronization (3DSP)"),
0x113a: _("Multi-Profile Specification (MPS) Profile"),
0x113b: _("Multi-Profile Specification (MPS) Service"),
0x113c: _("Calendar, Task, and Notes (CTN) Access Service"),
0x113d: _("Calendar, Task, and Notes (CTN) Notification Service"),
0x113e: _("Calendar, Task, and Notes (CTN) Profile"),
0x1200: _("PnP Information"),
0x1201: _("Generic Networking"),
0x1202: _("Generic FileTransfer"),
0x1203: _("Generic Audio"),
0x1204: _("Generic Telephony"),
0x1303: _("Video Source"),
0x1304: _("Video Sink"),
0x1305: _("Video Distribution"),
0x1400: _("HDP"),
0x1401: _("HDP Source"),
0x1402: _("HDP Sink"),
0x1800: _("Generic Access"),
0x1801: _("Generic Attribute"),
0x1802: _("Immediate Alert"),
0x1803: _("Link Loss"),
0x1804: _("Tx Power"),
0x1805: _("Current Time Service"),
0x1806: _("Reference Time Update Service"),
0x1807: _("Next DST Change Service"),
0x1808: _("Glucose"),
0x1809: _("Health Thermometer"),
0x180A: _("Device Information"),
0x180D: _("Heart Rate"),
0x180E: _("Phone Alert Status Service"),
0x180F: _("Battery Service"),
0x1810: _("Blood Pressure"),
0x1811: _("Alert Notification Service"),
0x1812: _("Human Interface Device"),
0x1813: _("Scan Parameters"),
0x1814: _("Running Speed and Cadence"),
0x1815: _("Automation IO"),
0x1816: _("Cycling Speed and Cadence"),
0x1818: _("Cycling Power"),
0x1819: _("Location and Navigation"),
0x181A: _("Environmental Sensing"),
0x181B: _("Body Composition"),
0x181C: _("User Data"),
0x181D: _("Weight Scale"),
0x181E: _("Bond Management"),
0x181F: _("Continuous Glucose Monitoring"),
0x1820: _("Internet Protocol Support"),
0x1821: _("Indoor Positioning"),
0x1822: _("Pulse Oximeter"),
0x1823: _("HTTP Proxy"),
0x1824: _("Transport Discovery"),
0x1825: _("Object Transfer"),
0x2112: _("AppleAgent"),
0x2800: _("Primary Service"),
0x2801: _("Secondary Service"),
0x2802: _("Include"),
0x2803: _("Characteristic Declaration"),
0x2A00: _("Device Name"),
0x2A01: _("Appearance"),
0x2A02: _("Peripheral Privacy Flag"),
0x2A03: _("Reconnection Address"),
0x2A04: _("Peripheral Preferred Connection Parameters"),
0x2A05: _("Service Changed"),
0x2A23: _("System ID"),
0x2A24: _("Model Number String"),
0x2A25: _("Serial Number String"),
0x2A26: _("Firmware Revision String"),
0x2A27: _("Hardware Revision String"),
0x2A28: _("Software Revision String"),
0x2A29: _("Manufacturer Name String"),
0x2A50: _("PnP ID"),
0x2900: _("Characteristic Extended Properties"),
0x2901: _("Characteristic User Description"),
0x2902: _("Client Characteristic Configuration"),
0x2903: _("Server Characteristic Configuration"),
0x2904: _("Characteristic Presentation Format"),
0x2905: _("Characteristic Aggregate Format"),
0x2906: _("Valid Range"),
0x2907: _("External Report Reference"),
0x2908: _("Report Reference"),
}
SDP_ATTR_RECORD_HANDLE = 0x0000
SDP_ATTR_SVCLASS_ID_LIST = 0x0001
SDP_ATTR_RECORD_STATE = 0x0002
SDP_ATTR_SERVICE_ID = 0x0003
SDP_ATTR_PROTO_DESC_LIST = 0x0004
SDP_ATTR_BROWSE_GRP_LIST = 0x0005
SDP_ATTR_LANG_BASE_ATTR_ID_LIST = 0x0006
SDP_ATTR_SVCINFO_TTL = 0x0007
SDP_ATTR_SERVICE_AVAILABILITY = 0x0008
SDP_ATTR_PFILE_DESC_LIST = 0x0009
SDP_ATTR_DOC_URL = 0x000a
SDP_ATTR_CLNT_EXEC_URL = 0x000b
SDP_ATTR_ICON_URL = 0x000c
SDP_ATTR_ADD_PROTO_DESC_LIST = 0x000d
SDP_ATTR_SUPPORTED_REPOSITORIES = 0x0314
SDP_ATTR_MAS_INSTANCE_ID = 0x0315
SDP_ATTR_SUPPORTED_MESSAGE_TYPES = 0x0316
SDP_ATTR_PBAP_SUPPORTED_FEATURES = 0x0317
SDP_ATTR_MAP_SUPPORTED_FEATURES = 0x0317
SDP_ATTR_SPECIFICATION_ID = 0x0200
SDP_ATTR_VENDOR_ID = 0x0201
SDP_ATTR_PRODUCT_ID = 0x0202
SDP_ATTR_VERSION = 0x0203
SDP_ATTR_PRIMARY_RECORD = 0x0204
SDP_ATTR_VENDOR_ID_SOURCE = 0x0205
SDP_ATTR_HID_DEVICE_RELEASE_NUMBER = 0x0200
SDP_ATTR_HID_PARSER_VERSION = 0x0201
SDP_ATTR_HID_DEVICE_SUBCLASS = 0x0202
SDP_ATTR_HID_COUNTRY_CODE = 0x0203
SDP_ATTR_HID_VIRTUAL_CABLE = 0x0204
SDP_ATTR_HID_RECONNECT_INITIATE = 0x0205
SDP_ATTR_HID_DESCRIPTOR_LIST = 0x0206
SDP_ATTR_HID_LANG_ID_BASE_LIST = 0x0207
SDP_ATTR_HID_SDP_DISABLE = 0x0208
SDP_ATTR_HID_BATTERY_POWER = 0x0209
SDP_ATTR_HID_REMOTE_WAKEUP = 0x020a
SDP_ATTR_HID_PROFILE_VERSION = 0x020b
SDP_ATTR_HID_SUPERVISION_TIMEOUT = 0x020c
SDP_ATTR_HID_NORMALLY_CONNECTABLE = 0x020d
SDP_ATTR_HID_BOOT_DEVICE = 0x020e
SDP_PRIMARY_LANG_BASE = 0x0100
SDP_UUID = 0x0001
UDP_UUID = 0x0002
RFCOMM_UUID = 0x0003
TCP_UUID = 0x0004
TCS_BIN_UUID = 0x0005
TCS_AT_UUID = 0x0006
OBEX_UUID = 0x0008
IP_UUID = 0x0009
FTP_UUID = 0x000a
HTTP_UUID = 0x000c
WSP_UUID = 0x000e
BNEP_UUID = 0x000f
UPNP_UUID = 0x0010
HIDP_UUID = 0x0011
HCRP_CTRL_UUID = 0x0012
HCRP_DATA_UUID = 0x0014
HCRP_NOTE_UUID = 0x0016
AVCTP_UUID = 0x0017
AVDTP_UUID = 0x0019
CMTP_UUID = 0x001b
UDI_UUID = 0x001d
MCAP_CTRL_UUID = 0x001e
MCAP_DATA_UUID = 0x001f
L2CAP_UUID = 0x0100
# GATT UUIDs section
GATT_PRIM_SVC_UUID = 0x2800
GATT_SND_SVC_UUID = 0x2801
GATT_INCLUDE_UUID = 0x2802
GATT_CHARAC_UUID = 0x2803
# GATT Characteristic Types
GATT_CHARAC_DEVICE_NAME = 0x2A00
GATT_CHARAC_APPEARANCE = 0x2A01
GATT_CHARAC_PERIPHERAL_PRIV_FLAG = 0x2A02
GATT_CHARAC_RECONNECTION_ADDRESS = 0x2A03
GATT_CHARAC_PERIPHERAL_PREF_CONN = 0x2A04
GATT_CHARAC_SERVICE_CHANGED = 0x2A05
GATT_CHARAC_SYSTEM_ID = 0x2A23
GATT_CHARAC_MODEL_NUMBER_STRING = 0x2A24
GATT_CHARAC_SERIAL_NUMBER_STRING = 0x2A25
GATT_CHARAC_FIRMWARE_REVISION_STRING = 0x2A26
GATT_CHARAC_HARDWARE_REVISION_STRING = 0x2A27
GATT_CHARAC_SOFTWARE_REVISION_STRING = 0x2A28
GATT_CHARAC_MANUFACTURER_NAME_STRING = 0x2A29
GATT_CHARAC_PNP_ID = 0x2A50
# GATT Characteristic Descriptors
GATT_CHARAC_EXT_PROPER_UUID = 0x2900
GATT_CHARAC_USER_DESC_UUID = 0x2901
GATT_CLIENT_CHARAC_CFG_UUID = 0x2902
GATT_SERVER_CHARAC_CFG_UUID = 0x2903
GATT_CHARAC_FMT_UUID = 0x2904
GATT_CHARAC_AGREG_FMT_UUID = 0x2905
GATT_CHARAC_VALID_RANGE_UUID = 0x2906
GATT_EXTERNAL_REPORT_REFERENCE = 0x2907
GATT_REPORT_REFERENCE = 0x2908
class ServiceUUID(UUID):
def __init__(self, uuid: str):
super().__init__(uuid)
@property
def short_uuid(self) -> Optional[int]:
if self.reserved:
return self.int >> 96 & 0xFFFF
else:
return None
@property
def name(self) -> str:
if self.short_uuid:
try:
return uuid_names[self.short_uuid]
except KeyError:
return _("Unknown")
elif self.int == 0:
return _('Audio and input profiles')
else:
return _('Proprietary')
@property
def reserved(self) -> bool:
return self.int & UUID('FFFF0000-0000-FFFF-FFFF-FFFFFFFFFFFF').int == \
UUID('00000000-0000-1000-8000-00805F9B34FB').int
blueman-2.4.3/blueman/Service.py 0000664 0000000 0000000 00000003524 14650545052 0016552 0 ustar 00root root 0000000 0000000 from abc import ABC, abstractmethod
from typing import Optional, Callable, List, Set, Collection
from blueman.Sdp import ServiceUUID
from blueman.bluez.Device import Device
class Instance:
def __init__(self, name: str, port: int = 0) -> None:
self.name = name
self.port = port
class Action:
def __init__(self, title: str, icon: str, plugins: Collection[str], callback: Callable[[], None]) -> None:
self.title = title
self.icon = icon
self.plugins = plugins
self.callback = callback
def __eq__(self, other: object) -> bool:
return isinstance(other, Action) and self.title == other.title
def __hash__(self) -> int:
return hash(self.title)
class Service(ABC):
__svclass_id__: int
__description__ = None
__icon__: str
__priority__: int
def __init__(self, device: Device, uuid: str):
self.__device = device
self.__uuid = uuid
@property
def name(self) -> str:
return ServiceUUID(self.__uuid).name
@property
def device(self) -> Device:
return self.__device
@property
def uuid(self) -> str:
return self.__uuid
@property
def short_uuid(self) -> Optional[int]:
return ServiceUUID(self.__uuid).short_uuid
@property
def description(self) -> Optional[str]:
return self.__description__
@property
def icon(self) -> str:
return self.__icon__
@property
def priority(self) -> int:
return self.__priority__
@property
@abstractmethod
def available(self) -> bool:
...
@property
@abstractmethod
def connectable(self) -> bool:
...
@property
@abstractmethod
def connected_instances(self) -> List[Instance]:
...
@property
def common_actions(self) -> Set[Action]:
return set()
blueman-2.4.3/blueman/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0016673 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/bluemantyping.py 0000664 0000000 0000000 00000001107 14650545052 0020023 0 ustar 00root root 0000000 0000000 from typing import Dict, Tuple, Union, TYPE_CHECKING
from gi.repository import GObject
if TYPE_CHECKING:
from typing_extensions import Protocol
class _HasGType(Protocol):
__gtype__: GObject.GType
# Actually supported types are int, bool, str, float, and object but no subclasses, see
# https://github.com/GNOME/pygobject/blob/ac576400ecd554879c906791e6638d64bb8bcc2a/gi/pygi-type.c#L498
# (We shield the possibility to provide a str to avoid errors)
GSignals = Dict[str, Tuple[GObject.SignalFlags, None, Tuple[Union[None, type, GObject.GType, "_HasGType"], ...]]]
blueman-2.4.3/blueman/bluez/ 0000775 0000000 0000000 00000000000 14650545052 0015715 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/bluez/Adapter.py 0000664 0000000 0000000 00000002061 14650545052 0017646 0 ustar 00root root 0000000 0000000 from typing import Optional, Callable
from gi.repository import GLib
from blueman.bluez.AnyBase import AnyBase
from blueman.bluez.Base import Base
from blueman.bluez.Device import Device
from blueman.bluez.errors import BluezDBusException
class Adapter(Base):
_interface_name = 'org.bluez.Adapter1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
def start_discovery(self, error_handler: Optional[Callable[[BluezDBusException], None]] = None) -> None:
self._call('StartDiscovery', error_handler=error_handler)
def stop_discovery(self) -> None:
self._call('StopDiscovery')
def remove_device(self, device: Device) -> None:
param = GLib.Variant('(o)', (device.get_object_path(),))
self._call('RemoveDevice', param)
def get_name(self) -> str:
name: str = self['Alias']
return name
def set_name(self, name: str) -> None:
self.set('Alias', name)
class AnyAdapter(AnyBase):
def __init__(self) -> None:
super().__init__('org.bluez.Adapter1')
blueman-2.4.3/blueman/bluez/AgentManager.py 0000664 0000000 0000000 00000001370 14650545052 0020621 0 ustar 00root root 0000000 0000000 from blueman.bluez.Base import Base
from gi.repository import GLib
class AgentManager(Base):
_interface_name = 'org.bluez.AgentManager1'
_obj_path = '/org/bluez'
def __init__(self) -> None:
super().__init__(obj_path=self._obj_path)
def register_agent(self, agent_path: str, capability: str = "", default: bool = False) -> None:
param = GLib.Variant('(os)', (agent_path, capability))
self._call('RegisterAgent', param)
if default:
default_param = GLib.Variant('(o)', (agent_path,))
self._call('RequestDefaultAgent', default_param)
def unregister_agent(self, agent_path: str) -> None:
param = GLib.Variant('(o)', (agent_path,))
self._call('UnregisterAgent', param)
blueman-2.4.3/blueman/bluez/AnyBase.py 0000664 0000000 0000000 00000002633 14650545052 0017615 0 ustar 00root root 0000000 0000000 import weakref
from gi.repository import GObject, GLib
from gi.repository import Gio
from blueman.bluemantyping import GSignals
class AnyBase(GObject.GObject):
__gsignals__: GSignals = {
'property-changed': (GObject.SignalFlags.NO_HOOKS, None, (str, object, str))
}
connect_signal = GObject.GObject.connect
disconnect_signal = GObject.GObject.disconnect
def __init__(self, interface_name: str):
super().__init__()
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM)
this = weakref.proxy(self)
def on_signal(
_connection: Gio.DBusConnection,
_sender_name: str,
object_path: str,
_interface_name: str,
_signal_name: str,
param: GLib.Variant,
) -> None:
iface_name, changed, invalidated = param.unpack()
if iface_name == interface_name and this is not None:
for key in list(changed) + invalidated:
this.emit('property-changed', key, changed.get(key, None), object_path)
weakref.finalize(
self,
bus.signal_unsubscribe,
bus.signal_subscribe(
"org.bluez",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
None,
None,
Gio.DBusSignalFlags.NONE,
on_signal
)
)
blueman-2.4.3/blueman/bluez/Base.py 0000664 0000000 0000000 00000012371 14650545052 0017145 0 ustar 00root root 0000000 0000000 from typing import List, Callable, Optional, Any, Union, Dict
from gi.repository import Gio, GLib, GObject
from gi.types import GObjectMeta
from blueman.bluez.errors import parse_dbus_error, BluezDBusException
import logging
from blueman.bluemantyping import GSignals
class BaseMeta(GObjectMeta):
def __call__(cls, *args: object, **kwargs: str) -> "Base":
if not hasattr(cls, "__instances__"):
cls.__instances__: Dict[str, "Base"] = {}
path = kwargs.get('obj_path')
if path is None:
path = getattr(cls, "_obj_path")
if path in cls.__instances__:
return cls.__instances__[path]
instance: "Base" = super().__call__(*args, **kwargs)
cls.__instances__[path] = instance
return instance
class Base(GObject.Object, metaclass=BaseMeta):
__name = 'org.bluez'
__bus_type = Gio.BusType.SYSTEM
__proxy: Gio.DBusProxy
__gsignals__: GSignals = {
'property-changed': (GObject.SignalFlags.NO_HOOKS, None, (str, object, str))
}
__instances__: Dict[str, "Base"]
_interface_name: str
connect_signal = GObject.GObject.connect
disconnect_signal = GObject.GObject.disconnect
def __init__(self, *, obj_path: str):
super().__init__()
self.__proxy = Gio.DBusProxy.new_for_bus_sync(
self.__bus_type,
Gio.DBusProxyFlags.NONE,
None,
self.__name,
obj_path,
self._interface_name,
None
)
self.__proxy.connect("g-properties-changed", self._properties_changed)
self.__fallback = {'Icon': 'blueman', 'Class': 0, 'Appearance': 0}
self.__variant_map = {str: 's', int: 'u', bool: 'b'}
def _properties_changed(self, _proxy: Gio.DBusProxy, changed_properties: GLib.Variant,
invalidated_properties: List[str]) -> None:
changed = changed_properties.unpack()
object_path = self.get_object_path()
logging.debug(f"{object_path} {changed} {invalidated_properties} {self}")
for key in list(changed) + invalidated_properties:
self.emit("property-changed", key, changed.get(key, None), object_path)
def _call(
self,
method: str,
param: Optional[GLib.Variant] = None,
reply_handler: Optional[Callable[..., None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
def callback(
proxy: Gio.DBusProxy,
result: Gio.AsyncResult,
reply: Optional[Callable[..., None]],
error: Optional[Callable[[BluezDBusException], None]],
) -> None:
try:
value = proxy.call_finish(result).unpack()
if reply:
reply(*value)
except GLib.Error as e:
if error:
error(parse_dbus_error(e))
else:
logging.error(f"Unhandled error for {self.__proxy.get_interface_name()}.{method}", exc_info=True)
self.__proxy.call(method, param, Gio.DBusCallFlags.NONE, GLib.MAXINT, None,
callback, reply_handler, error_handler)
def get(self, name: str) -> Any:
try:
prop = self.__proxy.call_sync(
'org.freedesktop.DBus.Properties.Get',
GLib.Variant('(ss)', (self._interface_name, name)),
Gio.DBusCallFlags.NONE,
GLib.MAXINT,
None)
return prop.unpack()[0]
except GLib.Error as e:
property = self.__proxy.get_cached_property(name)
if property is not None:
return property.unpack()
elif name in self.__fallback:
return self.__fallback[name]
else:
raise parse_dbus_error(e)
def set(self, name: str, value: Union[str, int, bool]) -> None:
v = GLib.Variant(self.__variant_map[type(value)], value)
param = GLib.Variant('(ssv)', (self._interface_name, name, v))
self.__proxy.call('org.freedesktop.DBus.Properties.Set',
param,
Gio.DBusCallFlags.NONE,
GLib.MAXINT,
None)
def get_object_path(self) -> str:
return self.__proxy.get_object_path()
def get_properties(self) -> Dict[str, Any]:
param = GLib.Variant('(s)', (self._interface_name,))
res = self.__proxy.call_sync('org.freedesktop.DBus.Properties.GetAll',
param,
Gio.DBusCallFlags.NONE,
GLib.MAXINT,
None)
props: Dict[str, Any] = res.unpack()[0]
for k, v in self.__fallback.items():
if k in props:
continue
else:
props[k] = v
return props
def destroy(self) -> None:
if self.__proxy:
del self.__proxy
def __getitem__(self, key: str) -> Any:
return self.get(key)
def __setitem__(self, key: str, value: Union[str, int, bool]) -> None:
self.set(key, value)
def __contains__(self, key: str) -> bool:
return key in self.get_properties()
blueman-2.4.3/blueman/bluez/Battery.py 0000664 0000000 0000000 00000000414 14650545052 0017700 0 ustar 00root root 0000000 0000000 from blueman.bluez.AnyBase import AnyBase
from blueman.bluez.Base import Base
_INTERFACE = "org.bluez.Battery1"
class Battery(Base):
_interface_name = _INTERFACE
class AnyBattery(AnyBase):
def __init__(self) -> None:
super().__init__(_INTERFACE)
blueman-2.4.3/blueman/bluez/Device.py 0000664 0000000 0000000 00000002554 14650545052 0017474 0 ustar 00root root 0000000 0000000 from typing import Optional, Callable
from blueman.bluez.Base import Base
from blueman.bluez.AnyBase import AnyBase
from blueman.bluez.errors import BluezDBusException
class Device(Base):
_interface_name = 'org.bluez.Device1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
def pair(
self,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._call('Pair', reply_handler=reply_handler, error_handler=error_handler)
def connect( # type: ignore
self,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._call('Connect', reply_handler=reply_handler, error_handler=error_handler)
def disconnect( # type: ignore
self,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._call('Disconnect', reply_handler=reply_handler, error_handler=error_handler)
@property
def display_name(self) -> str:
alias: str = self["Alias"]
return alias.strip()
class AnyDevice(AnyBase):
def __init__(self) -> None:
super().__init__('org.bluez.Device1')
blueman-2.4.3/blueman/bluez/Makefile.am 0000664 0000000 0000000 00000000574 14650545052 0017757 0 ustar 00root root 0000000 0000000 SUBDIRS = obex
bluemandir = $(pythondir)/blueman/bluez
blueman_PYTHON = \
__init__.py \
Adapter.py \
AgentManager.py \
AnyBase.py \
Base.py \
Battery.py \
Device.py \
errors.py \
Manager.py \
Network.py \
NetworkServer.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/bluez/Makefile.in 0000664 0000000 0000000 00000057226 14650545052 0017776 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/bluez
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = obex
bluemandir = $(pythondir)/blueman/bluez
blueman_PYTHON = \
__init__.py \
Adapter.py \
AgentManager.py \
AnyBase.py \
Base.py \
Battery.py \
Device.py \
errors.py \
Manager.py \
Network.py \
NetworkServer.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/bluez/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/bluez/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/bluez/Manager.py 0000664 0000000 0000000 00000015750 14650545052 0017651 0 ustar 00root root 0000000 0000000 import logging
from typing import List, Optional, Callable
from gi.repository import GObject, Gio
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Device import Device
from blueman.bluez.errors import DBusNoSuchAdapterError
from blueman.gobject import SingletonGObjectMeta
from blueman.bluemantyping import GSignals
class Manager(GObject.GObject, metaclass=SingletonGObjectMeta):
__gsignals__: GSignals = {
'adapter-added': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'adapter-removed': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'device-created': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'device-removed': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'battery-created': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'battery-removed': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
}
connect_signal = GObject.GObject.connect
disconnect_signal = GObject.GObject.disconnect
__bus_name = 'org.bluez'
def __init__(self) -> None:
super().__init__()
self._object_manager = Gio.DBusObjectManagerClient.new_for_bus_sync(
Gio.BusType.SYSTEM, Gio.DBusObjectManagerClientFlags.DO_NOT_AUTO_START,
self.__bus_name, '/', None, None, None)
self._object_manager.connect("object-added", self._on_object_added)
self._object_manager.connect("object-removed", self._on_object_removed)
self._object_manager.connect("interface-added", self._on_interface_added)
self._object_manager.connect("interface-removed", self._on_interface_removed)
def _on_object_added(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject) -> None:
device_proxy = dbus_object.get_interface('org.bluez.Device1')
adapter_proxy = dbus_object.get_interface('org.bluez.Adapter1')
battery_proxy = dbus_object.get_interface('org.bluez.Battery1')
if adapter_proxy:
assert isinstance(adapter_proxy, Gio.DBusProxy)
object_path = adapter_proxy.get_object_path()
logging.debug(f"Adapter1: {object_path}")
self.emit('adapter-added', object_path)
if device_proxy:
assert isinstance(device_proxy, Gio.DBusProxy)
object_path = device_proxy.get_object_path()
logging.debug(f"Device1: {object_path}")
self.emit('device-created', object_path)
if battery_proxy:
assert isinstance(device_proxy, Gio.DBusProxy)
object_path = device_proxy.get_object_path()
logging.debug(f"Battery1: {object_path}")
self.emit('battery-created', object_path)
def _on_object_removed(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject) -> None:
device_proxy = dbus_object.get_interface('org.bluez.Device1')
adapter_proxy = dbus_object.get_interface('org.bluez.Adapter1')
battery_proxy = dbus_object.get_interface('org.bluez.Battery1')
if adapter_proxy:
assert isinstance(adapter_proxy, Gio.DBusProxy)
object_path = adapter_proxy.get_object_path()
logging.debug(object_path)
self.emit('adapter-removed', object_path)
if device_proxy:
assert isinstance(device_proxy, Gio.DBusProxy)
object_path = device_proxy.get_object_path()
logging.debug(object_path)
self.emit('device-removed', object_path)
if battery_proxy:
assert isinstance(device_proxy, Gio.DBusProxy)
object_path = device_proxy.get_object_path()
logging.debug(object_path)
self.emit('battery-removed', object_path)
def _on_interface_added(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject,
_dbus_interface: Gio.DBusInterface) -> None:
object_path = dbus_object.get_object_path()
battery = dbus_object.get_interface("org.bluez.Battery1")
if battery is not None:
logging.debug(f"Battery1 added to {object_path}")
self.emit('battery-created', object_path)
def _on_interface_removed(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject,
_dbus_interface: Gio.DBusInterface) -> None:
object_path = dbus_object.get_object_path()
battery = dbus_object.get_interface("org.bluez.Battery1")
if battery is not None:
logging.debug(f"Battery1 removed from {object_path}")
self.emit('battery-removed', object_path)
def get_adapters(self) -> List[Adapter]:
paths = []
for obj_proxy in self._object_manager.get_objects():
proxy = obj_proxy.get_interface('org.bluez.Adapter1')
if proxy:
assert isinstance(proxy, Gio.DBusProxy)
paths.append(proxy.get_object_path())
return [Adapter(obj_path=path) for path in paths]
def get_adapter(self, pattern: Optional[str] = None) -> Adapter:
adapters = self.get_adapters()
if pattern is None:
if len(adapters):
return adapters[0]
else:
raise DBusNoSuchAdapterError("No adapter(s) found")
else:
for adapter in adapters:
path = adapter.get_object_path()
if path.endswith(pattern) or adapter['Address'] == pattern:
return adapter
raise DBusNoSuchAdapterError(f"No adapters found with pattern: {pattern}")
def get_devices(self, adapter_path: str = "/") -> List[Device]:
paths = []
for obj_proxy in self._object_manager.get_objects():
proxy = obj_proxy.get_interface('org.bluez.Device1')
if proxy:
assert isinstance(proxy, Gio.DBusProxy)
object_path = proxy.get_object_path()
if object_path.startswith(adapter_path):
paths.append(object_path)
return [Device(obj_path=path) for path in paths]
def populate_devices(self, adapter_path: str = "/") -> None:
for obj_proxy in self._object_manager.get_objects():
# We handle adapters differently so skip them.
if obj_proxy.get_interface("org.bluez.Adapter1") is not None:
continue
object_path = obj_proxy.get_object_path()
if object_path.startswith(adapter_path):
self._on_object_added(self._object_manager, obj_proxy)
def find_device(self, address: str, adapter_path: str = "/") -> Optional[Device]:
for device in self.get_devices(adapter_path):
if device['Address'] == address:
return device
return None
@classmethod
def watch_name_owner(
cls,
appeared_handler: Callable[[Gio.DBusConnection, str, str], None],
vanished_handler: Callable[[Gio.DBusConnection, str], None],
) -> None:
Gio.bus_watch_name(Gio.BusType.SYSTEM, cls.__bus_name, Gio.BusNameWatcherFlags.AUTO_START,
appeared_handler, vanished_handler)
blueman-2.4.3/blueman/bluez/Network.py 0000664 0000000 0000000 00000002135 14650545052 0017721 0 ustar 00root root 0000000 0000000 from typing import Optional, Callable
from blueman.bluez.Base import Base
from blueman.bluez.AnyBase import AnyBase
from gi.repository import GLib
from blueman.bluez.errors import BluezDBusException
class Network(Base):
_interface_name = 'org.bluez.Network1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
def connect( # type: ignore
self,
uuid: str,
reply_handler: Optional[Callable[[str], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
param = GLib.Variant('(s)', (uuid,))
self._call('Connect', param, reply_handler=reply_handler, error_handler=error_handler)
def disconnect( # type: ignore
self,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._call('Disconnect', reply_handler=reply_handler, error_handler=error_handler)
class AnyNetwork(AnyBase):
def __init__(self) -> None:
super().__init__('org.bluez.Network1')
blueman-2.4.3/blueman/bluez/NetworkServer.py 0000664 0000000 0000000 00000000774 14650545052 0021117 0 ustar 00root root 0000000 0000000 from blueman.bluez.Base import Base
from gi.repository import GLib
class NetworkServer(Base):
_interface_name = 'org.bluez.NetworkServer1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
def register(self, uuid: str, bridge: str) -> None:
param = GLib.Variant('(ss)', (uuid, bridge))
self._call('Register', param)
def unregister(self, uuid: str) -> None:
param = GLib.Variant('(s)', (uuid,))
self._call('Unregister', param)
blueman-2.4.3/blueman/bluez/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0020014 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/bluez/errors.py 0000664 0000000 0000000 00000007026 14650545052 0017610 0 ustar 00root root 0000000 0000000 from gi.repository import GLib
class BluezDBusException(Exception):
def __init__(self, reason: str):
self.reason = reason
def __str__(self) -> str:
return self.reason
class DBusFailedError(BluezDBusException):
pass
class DBusInvalidArgumentsError(BluezDBusException):
pass
class DBusNotAuthorizedError(BluezDBusException):
pass
class DBusOutOfMemoryError(BluezDBusException):
pass
class DBusNoSuchAdapterError(BluezDBusException):
pass
class DBusNotReadyError(BluezDBusException):
pass
class DBusNotAvailableError(BluezDBusException):
pass
class DBusNotConnectedError(BluezDBusException):
pass
class DBusConnectionAttemptFailedError(BluezDBusException):
pass
class DBusAlreadyExistsError(BluezDBusException):
pass
class DBusDoesNotExistError(BluezDBusException):
pass
class DBusNoReplyError(BluezDBusException):
pass
class DBusInProgressError(BluezDBusException):
pass
class DBusNotSupportedError(BluezDBusException):
pass
class DBusAuthenticationFailedError(BluezDBusException):
pass
class DBusAuthenticationTimeoutError(BluezDBusException):
pass
class DBusAuthenticationRejectedError(BluezDBusException):
pass
class DBusAuthenticationCanceledError(BluezDBusException):
pass
class DBusUnsupportedMajorClassError(BluezDBusException):
pass
class DBusServiceUnknownError(BluezDBusException):
pass
class DBusMainLoopNotSupportedError(BluezDBusException):
pass
class DBusMainLoopModuleNotFoundError(BluezDBusException):
pass
class BluezUnavailableAgentMethodError(BluezDBusException):
pass
__DICT_ERROR__ = {'org.bluez.Error.Failed': DBusFailedError,
'org.bluez.Error.InvalidArguments': DBusInvalidArgumentsError,
'org.bluez.Error.NotAuthorized': DBusNotAuthorizedError,
'org.bluez.Error.OutOfMemory': DBusOutOfMemoryError,
'org.bluez.Error.NoSuchAdapter': DBusNoSuchAdapterError,
'org.bluez.Error.NotReady': DBusNotReadyError,
'org.bluez.Error.NotAvailable': DBusNotAvailableError,
'org.bluez.Error.NotConnected': DBusNotConnectedError,
'org.bluez.serial.Error.ConnectionAttemptFailed': DBusConnectionAttemptFailedError,
'org.bluez.Error.AlreadyExists': DBusAlreadyExistsError,
'org.bluez.Error.DoesNotExist': DBusDoesNotExistError,
'org.bluez.Error.InProgress': DBusInProgressError,
'org.bluez.Error.NoReply': DBusNoReplyError,
'org.bluez.Error.NotSupported': DBusNotSupportedError,
'org.bluez.Error.AuthenticationFailed': DBusAuthenticationFailedError,
'org.bluez.Error.AuthenticationTimeout': DBusAuthenticationTimeoutError,
'org.bluez.Error.AuthenticationRejected': DBusAuthenticationRejectedError,
'org.bluez.Error.AuthenticationCanceled': DBusAuthenticationCanceledError,
'org.bluez.serial.Error.NotSupported': DBusNotSupportedError,
'org.bluez.Error.UnsupportedMajorClass': DBusUnsupportedMajorClassError,
'org.freedesktop.DBus.Error.ServiceUnknown': DBusServiceUnknownError}
def parse_dbus_error(exception: GLib.Error) -> BluezDBusException:
global __DICT_ERROR__
gerror, dbus_error, message = exception.message.split(':', 2)
try:
return __DICT_ERROR__[dbus_error](message)
except KeyError:
return BluezDBusException(dbus_error + message)
blueman-2.4.3/blueman/bluez/obex/ 0000775 0000000 0000000 00000000000 14650545052 0016652 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/bluez/obex/AgentManager.py 0000664 0000000 0000000 00000002214 14650545052 0021554 0 ustar 00root root 0000000 0000000 import logging
from blueman.bluez.errors import BluezDBusException
from blueman.bluez.obex.Base import Base
from gi.repository import GLib
class AgentManager(Base):
_interface_name = 'org.bluez.obex.AgentManager1'
_obj_path = '/org/bluez/obex'
def __init__(self) -> None:
super().__init__(obj_path=self._obj_path)
def register_agent(self, agent_path: str) -> None:
def on_registered() -> None:
logging.info(agent_path)
def on_register_failed(error: BluezDBusException) -> None:
logging.error(f"{agent_path} {error}")
param = GLib.Variant('(o)', (agent_path,))
self._call('RegisterAgent', param, reply_handler=on_registered, error_handler=on_register_failed)
def unregister_agent(self, agent_path: str) -> None:
def on_unregistered() -> None:
logging.info(agent_path)
def on_unregister_failed(error: BluezDBusException) -> None:
logging.error(f"{agent_path} {error}")
param = GLib.Variant('(o)', (agent_path,))
self._call('UnregisterAgent', param, reply_handler=on_unregistered, error_handler=on_unregister_failed)
blueman-2.4.3/blueman/bluez/obex/Base.py 0000664 0000000 0000000 00000000253 14650545052 0020076 0 ustar 00root root 0000000 0000000 from blueman.bluez.Base import Base as BlueZBase
from gi.repository import Gio
class Base(BlueZBase):
__bus_type = Gio.BusType.SESSION
__name = 'org.bluez.obex'
blueman-2.4.3/blueman/bluez/obex/Client.py 0000664 0000000 0000000 00000003253 14650545052 0020445 0 ustar 00root root 0000000 0000000 import logging
from blueman.bluez.errors import BluezDBusException
from blueman.bluez.obex.Base import Base
from gi.repository import GObject, GLib
from blueman.bluemantyping import GSignals
class Client(Base):
__gsignals__: GSignals = {
'session-failed': (GObject.SignalFlags.NO_HOOKS, None, (object,)),
}
_interface_name = 'org.bluez.obex.Client1'
_obj_path = '/org/bluez/obex'
def __init__(self) -> None:
super().__init__(obj_path=self._obj_path)
def create_session(self, dest_addr: str, source_addr: str = "00:00:00:00:00:00", pattern: str = "opp") -> None:
def on_session_created(session_path: str) -> None:
logging.info(f"{dest_addr} {source_addr} {pattern} {session_path}")
def on_session_failed(error: BluezDBusException) -> None:
logging.error(f"{dest_addr} {source_addr} {pattern} {error}")
self.emit("session-failed", error)
v_source_addr = GLib.Variant('s', source_addr)
v_pattern = GLib.Variant('s', pattern)
param = GLib.Variant('(sa{sv})', (dest_addr, {"Source": v_source_addr, "Target": v_pattern}))
self._call('CreateSession', param, reply_handler=on_session_created, error_handler=on_session_failed)
def remove_session(self, session_path: str) -> None:
def on_session_removed() -> None:
logging.info(session_path)
def on_session_remove_failed(error: BluezDBusException) -> None:
logging.error(f"{session_path} {error}")
param = GLib.Variant('(o)', (session_path,))
self._call('RemoveSession', param, reply_handler=on_session_removed,
error_handler=on_session_remove_failed)
blueman-2.4.3/blueman/bluez/obex/Makefile.am 0000664 0000000 0000000 00000000441 14650545052 0020705 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/bluez/obex
blueman_PYTHON = \
AgentManager.py \
Base.py \
Client.py \
Manager.py \
ObjectPush.py \
Session.py \
Transfer.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/bluez/obex/Makefile.in 0000664 0000000 0000000 00000042560 14650545052 0020726 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/bluez/obex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/bluez/obex
blueman_PYTHON = \
AgentManager.py \
Base.py \
Client.py \
Manager.py \
ObjectPush.py \
Session.py \
Transfer.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/bluez/obex/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/bluez/obex/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/bluez/obex/Manager.py 0000664 0000000 0000000 00000007405 14650545052 0020604 0 ustar 00root root 0000000 0000000 import logging
import weakref
from typing import Dict, Callable, List, Tuple
from gi.repository import GObject, Gio
from blueman.bluez.obex.Transfer import Transfer
from blueman.gobject import SingletonGObjectMeta
from blueman.bluemantyping import GSignals
class Manager(GObject.GObject, metaclass=SingletonGObjectMeta):
__gsignals__: GSignals = {
'session-added': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'session-removed': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'transfer-started': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'transfer-completed': (GObject.SignalFlags.NO_HOOKS, None, (str, bool)),
}
connect_signal = GObject.GObject.connect
disconnect_signal = GObject.GObject.disconnect
__bus_name = 'org.bluez.obex'
def __init__(self) -> None:
super().__init__()
self.__transfers: Dict[str, Tuple[Transfer, Tuple[int, ...]]] = {}
self._object_manager = Gio.DBusObjectManagerClient.new_for_bus_sync(
Gio.BusType.SESSION, Gio.DBusObjectManagerClientFlags.NONE,
self.__bus_name, '/', None, None, None)
self._manager_handlerids: List[int] = []
self._manager_handlerids.append(self._object_manager.connect('object-added', self._on_object_added))
self._manager_handlerids.append(self._object_manager.connect('object-removed', self._on_object_removed))
weakref.finalize(self, self._on_delete)
def _on_delete(self) -> None:
for handlerid in self._manager_handlerids:
self._object_manager.disconnect(handlerid)
self._manager_handlerids = []
def _on_object_added(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject) -> None:
session_proxy = dbus_object.get_interface('org.bluez.obex.Session1')
transfer_proxy = dbus_object.get_interface('org.bluez.obex.Transfer1')
object_path = dbus_object.get_object_path()
if transfer_proxy:
logging.info(object_path)
transfer = Transfer(obj_path=object_path)
chandlerid = transfer.connect_signal('completed', self._on_transfer_completed, True)
ehandlerid = transfer.connect_signal('error', self._on_transfer_completed, False)
self.__transfers[object_path] = (transfer, (chandlerid, ehandlerid))
self.emit('transfer-started', object_path)
if session_proxy:
logging.info(object_path)
self.emit('session-added', object_path)
def _on_object_removed(self, _object_manager: Gio.DBusObjectManager, dbus_object: Gio.DBusObject) -> None:
session_proxy = dbus_object.get_interface('org.bluez.obex.Session1')
transfer_proxy = dbus_object.get_interface('org.bluez.obex.Transfer1')
object_path = dbus_object.get_object_path()
if transfer_proxy and object_path in self.__transfers:
logging.info(object_path)
transfer, handlerids = self.__transfers.pop(object_path)
for handlerid in handlerids:
transfer.disconnect_signal(handlerid)
if session_proxy:
logging.info(object_path)
self.emit('session-removed', object_path)
def _on_transfer_completed(self, transfer: Transfer, success: bool) -> None:
transfer_path = transfer.get_object_path()
logging.info(f"{transfer_path} {success}")
self.emit('transfer-completed', transfer_path, success)
@classmethod
def watch_name_owner(
cls,
appeared_handler: Callable[[Gio.DBusConnection, str, str], None],
vanished_handler: Callable[[Gio.DBusConnection, str], None],
) -> None:
Gio.bus_watch_name(Gio.BusType.SESSION, cls.__bus_name, Gio.BusNameWatcherFlags.AUTO_START,
appeared_handler, vanished_handler)
blueman-2.4.3/blueman/bluez/obex/ObjectPush.py 0000664 0000000 0000000 00000002412 14650545052 0021271 0 ustar 00root root 0000000 0000000 import logging
from typing import Dict
from blueman.bluez.errors import BluezDBusException
from blueman.bluez.obex.Base import Base
from gi.repository import GObject, GLib
from blueman.bluemantyping import GSignals
class ObjectPush(Base):
__gsignals__: GSignals = {
'transfer-started': (GObject.SignalFlags.NO_HOOKS, None, (str, str,)),
'transfer-failed': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
}
_interface_name = 'org.bluez.obex.ObjectPush1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
def send_file(self, file_path: str) -> None:
def on_transfer_started(transfer_path: str, props: Dict[str, str]) -> None:
logging.info(" ".join((self.get_object_path(), file_path, transfer_path)))
self.emit('transfer-started', transfer_path, props['Filename'])
def on_transfer_error(error: BluezDBusException) -> None:
logging.error(f"{file_path} {error}")
self.emit('transfer-failed', error)
param = GLib.Variant('(s)', (file_path,))
self._call('SendFile', param, reply_handler=on_transfer_started, error_handler=on_transfer_error)
def get_session_path(self) -> str:
path: str = self.get_object_path()
return path
blueman-2.4.3/blueman/bluez/obex/Session.py 0000664 0000000 0000000 00000000624 14650545052 0020651 0 ustar 00root root 0000000 0000000 from blueman.bluez.obex.Base import Base
class Session(Base):
_interface_name = 'org.bluez.obex.Session1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
@property
def address(self) -> str:
dest: str = self.get('Destination')
return dest
@property
def root(self) -> str:
root: str = self.get('Root')
return root
blueman-2.4.3/blueman/bluez/obex/Transfer.py 0000664 0000000 0000000 00000003153 14650545052 0021012 0 ustar 00root root 0000000 0000000 import logging
from typing import List, Optional
from blueman.bluez.obex.Base import Base
from gi.repository import GObject, Gio, GLib
from blueman.bluemantyping import GSignals
class Transfer(Base):
__gsignals__: GSignals = {
'progress': (GObject.SignalFlags.NO_HOOKS, None, (int,)),
'completed': (GObject.SignalFlags.NO_HOOKS, None, ()),
'error': (GObject.SignalFlags.NO_HOOKS, None, ())
}
_interface_name = 'org.bluez.obex.Transfer1'
def __init__(self, obj_path: str):
super().__init__(obj_path=obj_path)
@property
def filename(self) -> Optional[str]:
name: Optional[str] = self.get("Filename")
return name
@property
def name(self) -> str:
name: str = self.get("Name")
return name
@property
def session(self) -> str:
session: str = self.get("Session")
return session
@property
def size(self) -> Optional[int]:
size: Optional[int] = self.get("Size")
return size
def _properties_changed(self, _proxy: Gio.DBusProxy, changed_properties: GLib.Variant,
_invalidated_properties: List[str]) -> None:
logging.debug(f"{changed_properties}")
for name, value in changed_properties.unpack().items():
logging.debug(f"{self.get_object_path()} {name} {value}")
if name == 'Transferred':
self.emit('progress', value)
elif name == 'Status':
if value == 'complete':
self.emit('completed')
elif value == 'error':
self.emit('error')
blueman-2.4.3/blueman/bluez/obex/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0020751 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/config/ 0000775 0000000 0000000 00000000000 14650545052 0016041 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/config/AutoConnectConfig.py 0000664 0000000 0000000 00000001677 14650545052 0021776 0 ustar 00root root 0000000 0000000 from typing import Tuple
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gio
class AutoConnectConfig(Gio.Settings):
def __init__(self) -> None:
super().__init__(schema_id="org.blueman.plugins.autoconnect")
def bind_to_menuitem(self, item: Gtk.CheckMenuItem, data: Tuple[str, str]) -> None:
def switch(active: bool) -> None:
services = set(self["services"])
if active:
self["services"] = set(services).union({data})
else:
self["services"] = set(self["services"]).difference({data})
def on_change(config: AutoConnectConfig, key: str) -> None:
if key == "services":
item.props.active = data in set(config[key])
item.props.active = data in set(self["services"])
item.connect("toggled", lambda i: switch(i.props.active))
self.connect("changed", on_change)
blueman-2.4.3/blueman/config/Makefile.am 0000664 0000000 0000000 00000000310 14650545052 0020067 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/config
blueman_PYTHON = \
__init__.py \
AutoConnectConfig.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/config/Makefile.in 0000664 0000000 0000000 00000042416 14650545052 0020115 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/config
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/config
blueman_PYTHON = \
__init__.py \
AutoConnectConfig.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/config/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/config/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/config/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0020140 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gobject.py 0000664 0000000 0000000 00000000505 14650545052 0016563 0 ustar 00root root 0000000 0000000 from typing import Any, Optional
from gi.types import GObjectMeta
class SingletonGObjectMeta(GObjectMeta):
_instance: Optional[Any] = None
def __call__(cls, *args: Any, **kwargs: Any) -> Any:
if not cls._instance:
cls._instance = super().__call__(*args, **kwargs)
return cls._instance
blueman-2.4.3/blueman/gui/ 0000775 0000000 0000000 00000000000 14650545052 0015360 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gui/Animation.py 0000664 0000000 0000000 00000002301 14650545052 0017645 0 ustar 00root root 0000000 0000000 from typing import Iterable, Optional
from gi import require_version
require_version("Gtk", "3.0")
from gi.repository import GLib, Gtk
class Animation:
def __init__(self, icon: Gtk.Image, icons: Iterable[str], rate: int = 1) -> None:
self.icon_names = list(icons)
self.timer: Optional[int] = None
self.current = 0
self.icon = icon
self.rate = int(1000 / rate)
def status(self) -> bool:
if self.timer:
return True
else:
return False
def set_rate(self, rate: float) -> None:
if not self.rate == int(1000 / rate):
self.rate = int(1000 / rate)
self.stop()
self.start()
def start(self) -> None:
self.timer = GLib.timeout_add(self.rate, self._animation)
def stop(self) -> None:
if self.timer:
GLib.source_remove(self.timer)
self.icon.props.icon_name = self.icon_names[0]
self.timer = None
def _animation(self) -> bool:
self.current += 1
if self.current > (len(self.icon_names) - 1):
self.current = 0
self.icon.props.icon_name = self.icon_names[self.current]
return True
blueman-2.4.3/blueman/gui/CommonUi.py 0000664 0000000 0000000 00000005524 14650545052 0017466 0 ustar 00root root 0000000 0000000 from datetime import datetime
from gettext import gettext as _
from typing import Optional, overload, TYPE_CHECKING
from blueman.Constants import WEBSITE, VERSION
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from typing_extensions import Literal
class ErrorDialog(Gtk.MessageDialog):
def __init__(self, markup: str, secondary_markup: Optional[str] = None, excp: Optional[object] = None,
icon_name: str = "dialog-error", buttons: Gtk.ButtonsType = Gtk.ButtonsType.CLOSE,
title: Optional[str] = None, parent: Optional[Gtk.Container] = None, modal: bool = False,
margin_left: int = 0,
) -> None:
super().__init__(name="ErrorDialog", icon_name=icon_name, buttons=buttons,
type=Gtk.MessageType.ERROR, title=title, parent=parent, modal=modal, margin_left=margin_left)
self.set_markup(markup)
if secondary_markup:
self.format_secondary_markup(secondary_markup)
if excp:
message_box = self.get_message_area()
label_expander = Gtk.Label(label="Exception", use_markup=True, visible=True)
excp_label = Gtk.Label(label=str(excp), selectable=True, visible=True)
expander = Gtk.Expander(label_widget=label_expander, visible=True)
expander.add(excp_label)
message_box.pack_start(expander, False, False, 10)
@overload
def show_about_dialog(app_name: str, run: "Literal[True]" = True, parent: Optional[Gtk.Window] = None) -> None:
...
@overload
def show_about_dialog(app_name: str, run: "Literal[False]", parent: Optional[Gtk.Window] = None) -> Gtk.AboutDialog:
...
def show_about_dialog(app_name: str, run: bool = True, parent: Optional[Gtk.Window] = None
) -> Optional[Gtk.AboutDialog]:
about = Gtk.AboutDialog()
about.set_transient_for(parent)
about.set_modal(True)
# on KDE it shows a close button which is unconnected.
about.connect("response", lambda x, y: about.destroy())
about.set_name(app_name)
about.set_version(VERSION)
about.set_copyright('Copyright © 2008 Valmantas Palikša\n'
'Copyright © 2008 Tadas Dailyda\n'
f'Copyright © 2008 - {datetime.now().year} blueman project'
)
about.set_comments(_('Blueman is a GTK+ Bluetooth manager'))
about.set_website(WEBSITE)
about.set_website_label(WEBSITE)
about.set_icon_name('blueman')
about.set_logo_icon_name('blueman')
about.set_authors(['Valmantas Palikša ',
'Tadas Dailyda ',
f'{WEBSITE}/graphs/contributors'
])
if run:
about.show()
return None
else:
return about
blueman-2.4.3/blueman/gui/DeviceList.py 0000664 0000000 0000000 00000031071 14650545052 0017767 0 ustar 00root root 0000000 0000000 from datetime import datetime
import logging
from typing import Dict, List, Optional, Any, Callable
from blueman.Functions import adapter_path_to_name
from blueman.gui.GenericList import GenericList, ListDataDict
from blueman.Constants import ICON_PATH
from blueman.bluez.Manager import Manager
from blueman.bluez.Device import Device, AnyDevice
from blueman.bluez.Adapter import Adapter, AnyAdapter
from blueman.bluez.errors import DBusNoSuchAdapterError, BluezDBusException
from gi.repository import GObject
from gi.repository import GLib
import gi
from blueman.bluemantyping import GSignals
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class DeviceList(GenericList):
__gsignals__: GSignals = {
# @param: device TreeIter
# note: None None is given when there ar no more rows, or when selected device is removed
'device-selected': (GObject.SignalFlags.RUN_LAST, None, (Device, Gtk.TreeIter,)),
# @param: device, TreeIter, (key, value)
'device-property-changed': (GObject.SignalFlags.RUN_LAST, None, (Device, Gtk.TreeIter, object,)),
# @param: adapter, (key, value)
'adapter-property-changed': (GObject.SignalFlags.RUN_LAST, None, (Adapter, object,)),
# @param: progress (0 to 1)
'discovery-progress': (GObject.SignalFlags.RUN_LAST, None, (float,)),
# @param: new adapter path, None if there are no more adapters
'adapter-changed': (GObject.SignalFlags.RUN_LAST, None, (str,)),
# @param: adapter path
'adapter-added': (GObject.SignalFlags.RUN_LAST, None, (str,)),
'adapter-removed': (GObject.SignalFlags.RUN_LAST, None, (str,)),
}
def __init__(self, adapter_name: Optional[str] = None, tabledata: Optional[List[ListDataDict]] = None,
headers_visible: bool = True) -> None:
if not tabledata:
tabledata = []
# cache for fast lookup in the list
self.path_to_row: Dict[str, Gtk.TreeRowReference] = {}
self.manager = Manager()
self._managerhandlers: List[int] = []
self._managerhandlers.append(self.manager.connect_signal('adapter-removed', self.__on_manager_signal,
'adapter-removed'))
self._managerhandlers.append(self.manager.connect_signal('adapter-added', self.__on_manager_signal,
'adapter-added'))
self._managerhandlers.append(self.manager.connect_signal('device-created', self.__on_manager_signal,
'device-created'))
self._managerhandlers.append(self.manager.connect_signal('device-removed', self.__on_manager_signal,
'device-removed'))
self.any_device = AnyDevice()
self._anydevhandler = self.any_device.connect_signal("property-changed", self._on_device_property_changed)
self.__discovery_time: float = 0
self.__adapter_path: Optional[str] = None
self.Adapter: Optional[Adapter] = None
self.discovering = False
data = tabledata + [
{"id": "device", "type": object},
{"id": "dbus_path", "type": str},
{"id": "timestamp", "type": float},
{"id": "no_name", "type": bool}
]
super().__init__(data, headers_visible=headers_visible)
self.set_name("DeviceList")
self.set_adapter(adapter_name)
self._any_adapter = AnyAdapter()
self._anyadapterhandler = self._any_adapter.connect_signal("property-changed", self._on_property_changed)
self._selectionhandler = self.selection.connect('changed', self.on_selection_changed)
self.icon_theme = Gtk.IconTheme.get_default()
self.icon_theme.prepend_search_path(ICON_PATH)
# handle icon theme changes
self.icon_theme.connect("changed", self.on_icon_theme_changed)
def destroy(self) -> None:
self.any_device.disconnect(self._anydevhandler)
self._any_adapter.disconnect(self._anyadapterhandler)
self.selection.disconnect(self._selectionhandler)
for handler in self._managerhandlers:
self.manager.disconnect(handler)
super().destroy()
def __on_manager_signal(self, _manager: Manager, path: str, signal_name: str) -> None:
if signal_name == 'adapter-removed':
self.emit("adapter-removed", path)
if path == self.__adapter_path:
self.clear()
self.Adapter = None
self.set_adapter()
if signal_name == 'adapter-added':
if self.Adapter is None:
self.set_adapter(path)
self.emit("adapter-added", path)
if signal_name == 'device-created':
self.device_add_event(path)
if signal_name == 'device-removed':
self.device_remove_event(path)
def on_selection_changed(self, selection: Gtk.TreeSelection) -> None:
model, tree_iter = selection.get_selected()
if tree_iter:
tree_iter = model.convert_iter_to_child_iter(tree_iter)
row = self.get(tree_iter, "device")
dev = row["device"]
self.emit("device-selected", dev, tree_iter)
def _on_property_changed(self, _adapter: AnyAdapter, key: str, value: object, path: str) -> None:
if not self.Adapter or self.Adapter.get_object_path() != path:
return
if key == "Discovering" and not value:
self.discovering = False
self.emit("adapter-property-changed", self.Adapter, (key, value))
def _on_device_property_changed(self, _device: AnyDevice, key: str, value: object, path: str) -> None:
tree_iter = self.find_device_by_path(path)
if tree_iter is not None:
dev = self.get(tree_iter, "device")["device"]
self.row_update_event(tree_iter, key, value)
self.emit("device-property-changed", dev, tree_iter, (key, value))
# Override when subclassing
def on_icon_theme_changed(self, _icon_them: Gtk.IconTheme) -> None:
logging.warning("Icons may not be updated with icon theme changes")
# ##### virtual funcs #####
# called when row needs to be initialized
def row_setup_event(self, tree_iter: Gtk.TreeIter, device: Device) -> None:
pass
# called when a property for a device changes
def row_update_event(self, tree_iter: Gtk.TreeIter, key: str, value: Any) -> None:
pass
# called when device needs to be added to the list
def device_add_event(self, object_path: str) -> None:
self.add_device(object_path)
def device_remove_event(self, object_path: str) -> None:
logging.debug(object_path)
tree_iter = self.find_device_by_path(object_path)
if tree_iter is None:
return
if self.compare(self.selected(), tree_iter):
self.emit("device-selected", None, None)
self.delete(tree_iter)
del self.path_to_row[object_path]
#########################
def set_adapter(self, adapter: Optional[str] = None) -> None:
self.clear()
if self.discovering:
self.stop_discovery()
self.emit("adapter-property-changed", self.Adapter, ("Discovering", False))
adapter = adapter_path_to_name(adapter)
logging.debug(f"Setting adapter to: {adapter}")
if adapter is not None:
try:
self.Adapter = self.manager.get_adapter(adapter)
self.__adapter_path = self.Adapter.get_object_path()
except DBusNoSuchAdapterError:
logging.warning('Failed to set adapter, trying first available.')
self.set_adapter(None)
return
else:
adapters = self.manager.get_adapters()
if len(adapters) > 0:
self.Adapter = adapters[0]
self.__adapter_path = self.Adapter.get_object_path()
else:
self.Adapter = None
self.__adapter_path = None
self.emit("adapter-changed", self.__adapter_path)
def update_progress(self, time: float, totaltime: float) -> bool:
if not self.discovering:
return False
self.__discovery_time += time
progress = self.__discovery_time / totaltime
if progress >= 1.0:
progress = 1.0
if self.__discovery_time >= totaltime:
self.stop_discovery()
return False
self.emit("discovery-progress", progress)
return True
def add_device(self, object_path: str) -> None:
device = Device(obj_path=object_path)
# device belongs to another adapter
if not self.Adapter or not device['Adapter'] == self.Adapter.get_object_path():
return
logging.info("adding new device")
colls = {
"device": device,
"dbus_path": object_path,
"timestamp": float(datetime.strftime(datetime.now(), '%Y%m%d%H%M%S%f')),
"no_name": "Name" not in device
}
tree_iter = self.append(**colls)
self.row_setup_event(tree_iter, device)
if self.get_selected_device() is None:
self.selection.select_path(Gtk.TreePath.new_first())
def populate_devices(self) -> None:
self.clear()
self.manager.populate_devices()
def discover_devices(self, time: float = 60.0,
error_handler: Optional[Callable[[BluezDBusException], None]] = None) -> None:
if not self.discovering:
self.__discovery_time = 0
if self.Adapter is not None:
self.Adapter.start_discovery(error_handler=error_handler)
self.discovering = True
t = 1.0 / 15 * 1000
GLib.timeout_add(int(t), self.update_progress, t / 1000, time)
def is_valid_adapter(self) -> bool:
if self.Adapter is None:
return False
else:
return True
def get_adapter_path(self) -> Optional[str]:
return self.__adapter_path if self.is_valid_adapter() else None
def stop_discovery(self) -> None:
self.discovering = False
if self.Adapter is not None:
self.Adapter.stop_discovery()
def get_selected_device(self) -> Optional[Device]:
selected = self.selected()
if selected is not None:
row = self.get(selected, "device")
device: Device = row["device"]
return device
return None
def clear(self) -> None:
if len(self.liststore):
for i in self.liststore:
tree_iter = i.iter
dbus_path = self.get(tree_iter, "dbus_path")["dbus_path"]
self.device_remove_event(dbus_path)
self.liststore.clear()
self.emit("device-selected", None, None)
self.path_to_row = {}
def find_device_by_path(self, object_path: str) -> Optional[Gtk.TreeIter]:
row = self.path_to_row.get(object_path, None)
if row is None:
return row
if row.valid():
tree_path = row.get_path()
assert tree_path is not None
tree_iter = self.liststore.get_iter(tree_path)
return tree_iter
else:
del self.path_to_row[object_path]
return None
def do_cache(self, tree_iter: Gtk.TreeIter, kwargs: Dict[str, Any]) -> None:
object_path = None
if "device" in kwargs:
if kwargs["device"]:
object_path = kwargs['device'].get_object_path()
elif "dbus_path" in kwargs:
if kwargs["dbus_path"]:
object_path = kwargs['dbus_path']
else:
existing = self.get(tree_iter, "dbus_path")["dbus_path"]
if existing is not None:
del self.path_to_row[existing]
if object_path:
logging.info(f"Caching new device {object_path}")
self.path_to_row[object_path] = Gtk.TreeRowReference.new(self.liststore,
self.liststore.get_path(tree_iter))
def append(self, **columns: object) -> Gtk.TreeIter:
tree_iter = super().append(**columns)
self.do_cache(tree_iter, columns)
return tree_iter
def prepend(self, **columns: object) -> Gtk.TreeIter:
tree_iter = super().prepend(**columns)
self.do_cache(tree_iter, columns)
return tree_iter
def set(self, tree_iter: Gtk.TreeIter, **kwargs: object) -> None:
super().set(tree_iter, **kwargs)
self.do_cache(tree_iter, kwargs)
blueman-2.4.3/blueman/gui/DeviceSelectorDialog.py 0000664 0000000 0000000 00000004073 14650545052 0021756 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Optional, Tuple
from blueman.bluez.Device import Device
from blueman.gui.DeviceList import DeviceList
from blueman.gui.DeviceSelectorWidget import DeviceSelectorWidget
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class DeviceSelectorDialog(Gtk.Dialog):
def __init__(self, title: str = _("Select Device"), parent: Optional[Gtk.Container] = None, discover: bool = True,
adapter_name: Optional[str] = None) -> None:
super().__init__(title=title, name="DeviceSelectorDialog", parent=parent, icon_name="blueman", resizable=False)
self.add_buttons(_("_Cancel"), Gtk.ResponseType.REJECT, _("_OK"), Gtk.ResponseType.ACCEPT)
self.vbox.props.halign = Gtk.Align.CENTER
self.vbox.props.valign = Gtk.Align.CENTER
self.vbox.props.hexpand = True
self.vbox.props.vexpand = True
self.vbox.props.margin = 6
self.selector = DeviceSelectorWidget(adapter_name=adapter_name, visible=True)
self.vbox.pack_start(self.selector, True, True, 0)
self.selection: Optional[Tuple[str, Optional[Device]]] = None
self.selector.List.connect("device-selected", self.on_device_selected)
self.selector.List.connect("adapter-changed", self.on_adapter_changed)
if discover:
self.selector.List.discover_devices()
self.selector.List.connect("row-activated", self.on_row_activated)
def close(self) -> None:
self.selector.destroy()
super().close()
def on_row_activated(self, _treeview: Gtk.TreeView, _path: Gtk.TreePath, _view_column: Gtk.TreeViewColumn,
*_args: object) -> None:
self.response(Gtk.ResponseType.ACCEPT)
def on_adapter_changed(self, _devlist: DeviceList, _adapter: str) -> None:
self.selection = None
def on_device_selected(self, devlist: DeviceList, device: Optional[Device], _tree_iter: Gtk.TreeIter) -> None:
assert devlist.Adapter is not None
self.selection = (devlist.Adapter.get_object_path(), device)
blueman-2.4.3/blueman/gui/DeviceSelectorList.py 0000664 0000000 0000000 00000004716 14650545052 0021476 0 ustar 00root root 0000000 0000000 from html import escape
from typing import Optional, Any, List
from blueman.bluez.Device import Device
from blueman.gui.DeviceList import DeviceList
from gi.repository import Pango
import gi
from blueman.gui.GenericList import ListDataDict
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class DeviceSelectorList(DeviceList):
def __init__(self, adapter_name: Optional[str] = None) -> None:
tabledata: List[ListDataDict] = [
# device picture
{"id": "device_icon", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.MENU),
"render_attrs": {"icon_name": 0}},
# device caption
{"id": "caption", "type": str, "renderer": Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END),
"render_attrs": {"markup": 1},
"view_props": {"expand": True}},
{"id": "paired_icon", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.MENU),
"render_attrs": {"icon_name": 2}},
{"id": "trusted_icon", "type": str, "renderer": Gtk.CellRendererPixbuf(stock_size=Gtk.IconSize.MENU),
"render_attrs": {"icon_name": 3}}
]
super().__init__(adapter_name, tabledata, headers_visible=False)
def on_icon_theme_changed(self, _icon_them: Gtk.IconTheme) -> None:
for row in self.liststore:
device = self.get(row.iter, "device")["device"]
self.row_setup_event(row.iter, device)
def row_setup_event(self, tree_iter: Gtk.TreeIter, device: Device) -> None:
self.row_update_event(tree_iter, "Trusted", device['Trusted'])
self.row_update_event(tree_iter, "Paired", device['Paired'])
self.row_update_event(tree_iter, "Alias", device.display_name)
self.row_update_event(tree_iter, "Icon", device['Icon'])
def row_update_event(self, tree_iter: Gtk.TreeIter, key: str, value: Any) -> None:
if key == "Trusted":
if value:
self.set(tree_iter, trusted_icon="blueman-trust-symbolic")
else:
self.set(tree_iter, trusted_icon=None)
elif key == "Paired":
if value:
self.set(tree_iter, paired_icon="blueman-pair-symbolic")
else:
self.set(tree_iter, paired_icon=None)
elif key == "Alias":
self.set(tree_iter, caption=escape(value))
elif key == "Icon":
self.set(tree_iter, device_icon=value)
blueman-2.4.3/blueman/gui/DeviceSelectorWidget.py 0000664 0000000 0000000 00000011560 14650545052 0022001 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import os
import logging
from typing import Optional, Tuple
from blueman.bluez.Adapter import Adapter
from blueman.gui.DeviceSelectorList import DeviceSelectorList
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class DeviceSelectorWidget(Gtk.Box):
def __init__(self, adapter_name: Optional[str] = None, orientation: Gtk.Orientation = Gtk.Orientation.VERTICAL,
visible: bool = False) -> None:
super().__init__(orientation=orientation, spacing=1, vexpand=True,
width_request=360, height_request=340,
name="DeviceSelectorWidget", visible=visible)
self.List = DeviceSelectorList(adapter_name)
if self.List.Adapter is not None:
self.List.populate_devices()
sw = Gtk.ScrolledWindow(hscrollbar_policy=Gtk.PolicyType.NEVER,
vscrollbar_policy=Gtk.PolicyType.AUTOMATIC,
shadow_type=Gtk.ShadowType.IN)
sw.add(self.List)
self.pack_start(sw, True, True, 0)
# Disable overlay scrolling
if Gtk.get_minor_version() >= 16:
sw.props.overlay_scrolling = False
model = Gtk.ListStore(str, str)
cell = Gtk.CellRendererText()
self.cb_adapters = Gtk.ComboBox(model=model, visible=True)
self.cb_adapters.set_tooltip_text(_("Adapter selection"))
self.cb_adapters.pack_start(cell, True)
self.cb_adapters.add_attribute(cell, 'text', 0)
spinner_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6, height_request=8)
self.spinner = Gtk.Spinner(halign=Gtk.Align.START, hexpand=True, has_tooltip=True,
tooltip_text=_("Discovering…"), margin=6)
spinner_box.add(self.cb_adapters)
spinner_box.add(self.spinner)
self.add(spinner_box)
self.cb_adapters.connect("changed", self.on_adapter_selected)
self.List.connect("adapter-changed", self.on_adapter_changed)
self.List.connect("adapter-added", self.on_adapter_added)
self.List.connect("adapter-removed", self.on_adapter_removed)
self.List.connect("adapter-property-changed", self.on_adapter_prop_changed)
self.update_adapters_list()
self.show_all()
def __del__(self) -> None:
self.List.destroy()
logging.debug("Deleting widget")
def on_adapter_prop_changed(self, _devlist: DeviceSelectorList, adapter: Adapter, key_value: Tuple[str, object]
) -> None:
key, value = key_value
if key == "Name" or key == "Alias":
self.update_adapters_list()
elif key == "Discovering":
if not value:
self.spinner.stop()
else:
self.spinner.start()
def on_adapter_added(self, _devlist: DeviceSelectorList, _adapter_path: str) -> None:
self.update_adapters_list()
def on_adapter_removed(self, _devlist: DeviceSelectorList, _adapter_path: str) -> None:
self.update_adapters_list()
def on_adapter_selected(self, cb_adapters: Gtk.ComboBox) -> None:
logging.info("selected")
tree_iter = cb_adapters.get_active_iter()
if tree_iter:
adapter_path = cb_adapters.get_model().get_value(tree_iter, 1)
if self.List.Adapter:
if self.List.Adapter.get_object_path() != adapter_path:
# Stop discovering on previous adapter
self.List.Adapter.stop_discovery()
self.List.set_adapter(os.path.basename(adapter_path))
# Start discovery on selected adapter
self.List.Adapter.start_discovery()
def on_adapter_changed(self, _devlist: DeviceSelectorList, adapter_path: str) -> None:
logging.info("changed")
if adapter_path is None:
self.update_adapters_list()
else:
if self.List.Adapter:
self.List.populate_devices()
def update_adapters_list(self) -> None:
model = self.cb_adapters.get_model()
assert isinstance(model, Gtk.ListStore)
model.clear()
adapters = self.List.manager.get_adapters()
num = len(adapters)
if num == 0:
self.cb_adapters.props.visible = False
self.List.props.sensitive = False
elif num == 1:
self.cb_adapters.props.visible = False
self.List.props.sensitive = True
elif num > 1:
self.List.props.sensitive = True
self.cb_adapters.props.visible = True
for adapter in adapters:
tree_iter = model.append([adapter.get_name(), adapter.get_object_path()])
if self.List.Adapter and adapter.get_object_path() == self.List.Adapter.get_object_path():
self.cb_adapters.set_active_iter(tree_iter)
blueman-2.4.3/blueman/gui/GenericList.py 0000664 0000000 0000000 00000010420 14650545052 0020137 0 ustar 00root root 0000000 0000000 from typing import Dict, Optional, TYPE_CHECKING, Iterable, Mapping, Callable, Tuple, Collection, Any
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from typing_extensions import TypedDict
class _ListDataDictBase(TypedDict):
id: str
type: type
class ListDataDict(_ListDataDictBase, total=False):
renderer: Gtk.CellRenderer
render_attrs: Mapping[str, int]
view_props: Mapping[str, object]
celldata_func: Tuple[Callable[[Gtk.TreeViewColumn, Gtk.CellRenderer, Gtk.TreeModelFilter, Gtk.TreeIter, Any],
None], Any]
else:
ListDataDict = dict
# noinspection PyAttributeOutsideInit
class GenericList(Gtk.TreeView):
def __init__(self, data: Iterable[ListDataDict], headers_visible: bool = True, visible: bool = False) -> None:
super().__init__(headers_visible=headers_visible, visible=visible)
self.set_name("GenericList")
self.selection = self.get_selection()
self._load(data)
def _load(self, data: Iterable[ListDataDict]) -> None:
self.ids: Dict[str, int] = {}
self.columns: Dict[str, Gtk.TreeViewColumn] = {}
types = [row["type"] for row in data]
self.liststore = Gtk.ListStore(*types)
self.filter = self.liststore.filter_new()
self.set_model(self.filter)
for i, row in enumerate(data):
self.ids[row["id"]] = i
if "renderer" not in row:
continue
column = Gtk.TreeViewColumn()
column.pack_start(row["renderer"], True)
column.set_attributes(row["renderer"], **row["render_attrs"])
if "view_props" in row:
column.set_properties(**row["view_props"])
if "celldata_func" in row:
func, user_data = row["celldata_func"]
column.set_cell_data_func(row["renderer"], func, user_data)
self.columns[row["id"]] = column
self.append_column(column)
def selected(self) -> Optional[Gtk.TreeIter]:
model, tree_iter = self.selection.get_selected()
if tree_iter is not None:
tree_iter = model.convert_iter_to_child_iter(tree_iter)
return tree_iter
def delete(self, tree_iter: Gtk.TreeIter) -> bool:
if self.liststore.iter_is_valid(tree_iter):
self.liststore.remove(tree_iter)
return True
else:
return False
def _add(self, **columns: object) -> Collection[object]:
items: Dict[int, object] = {}
for k, v in self.ids.items():
items[v] = None
for k, val in columns.items():
if k in self.ids:
items[self.ids[k]] = val
else:
raise Exception(f"Invalid key {k}")
return items.values()
def append(self, **columns: object) -> Gtk.TreeIter:
vals = self._add(**columns)
return self.liststore.append(vals)
def prepend(self, **columns: object) -> Gtk.TreeIter:
vals = self._add(**columns)
return self.liststore.prepend(vals)
def set(self, tree_iter: Gtk.TreeIter, **cols: object) -> None:
for k, v in cols.items():
self.liststore.set(tree_iter, self.ids[k], v)
def get(self, tree_iter: Gtk.TreeIter, *items: str) -> Dict[str, Any]:
row_data = {}
if not items:
columns = [(name, self.ids[name]) for name in self.ids]
else:
columns = [(name, self.ids[name]) for name in items if name in self.ids]
for name, colid in columns:
row_data[name] = self.liststore.get_value(tree_iter, colid)
return row_data
def get_iter(self, path: Optional[Gtk.TreePath]) -> Optional[Gtk.TreeIter]:
if path is None:
return None
try:
return self.liststore.get_iter(path)
except ValueError:
return None
def clear(self) -> None:
self.liststore.clear()
def compare(self, iter_a: Optional[Gtk.TreeIter], iter_b: Optional[Gtk.TreeIter]) -> bool:
if iter_a is not None and iter_b is not None:
assert self.liststore is not None
return self.liststore.get_path(iter_a) == self.liststore.get_path(iter_b)
else:
return False
blueman-2.4.3/blueman/gui/GsmSettings.py 0000664 0000000 0000000 00000002320 14650545052 0020176 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from blueman.main.Builder import Builder
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gio
class GsmSettings(Gtk.Dialog):
def __init__(self, bd_address: str) -> None:
super().__init__()
self.set_name("GsmSettings")
self.device = bd_address
builder = Builder("gsm-settings.ui")
gsm_grid = builder.get_widget("gsm_grid", Gtk.Grid)
self.config = Gio.Settings(schema_id="org.blueman.gsmsetting",
path=f"/org/blueman/gsmsettings/{bd_address}/")
self.props.icon_name = "network-wireless-symbolic"
self.props.title = _("GSM Settings")
self.props.resizable = False
a = self.get_content_area()
a.pack_start(gsm_grid, True, True, 0)
gsm_grid.show()
self.e_apn = builder.get_widget("e_apn", Gtk.Entry)
self.e_number = builder.get_widget("e_number", Gtk.Entry)
self.config.bind("apn", self.e_apn, "text", Gio.SettingsBindFlags.DEFAULT)
self.config.bind("number", self.e_number, "text", Gio.SettingsBindFlags.DEFAULT)
self.add_button(_("_Close"), Gtk.ResponseType.CLOSE)
blueman-2.4.3/blueman/gui/GtkAnimation.py 0000664 0000000 0000000 00000016555 14650545052 0020333 0 ustar 00root root 0000000 0000000 from typing import List, Optional, Collection, Iterable, TYPE_CHECKING
import cairo
import gi
from blueman.bluemantyping import GSignals
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
gi.require_version("Gdk", "3.0")
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import GLib
if TYPE_CHECKING:
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
BaseContext = cairo.Context[cairo.Surface]
class AnimBase(GObject.GObject):
__gsignals__: GSignals = {
'animation-finished': (GObject.SignalFlags.RUN_LAST, None, ()),
}
def __init__(self, state: float = 1.0) -> None:
super().__init__()
self._source: Optional[int] = None
self._state = state
self.frozen = False
self.fps = 24.0
def _do_transition(self) -> bool:
if abs(self._end - self._start) < 0.000001:
return False
self._state += self._step_size
if self._end - self._start < 0:
if self._state <= self._end:
self._state = self._end
self._state_changed(self._state)
self._source = None
self.emit("animation-finished")
return False
else:
if self._state >= self._end:
self._state = self._end
self._state_changed(self._state)
self._source = None
self.emit("animation-finished")
return False
self._state_changed(self._state)
return True
def thaw(self) -> None:
self.frozen = False
def freeze(self) -> None:
self.frozen = True
def animate(self, start: float = 1.0, end: float = 0.0, duration: int = 1000) -> None:
if self.frozen:
self.emit("animation-finished")
return
self._state = start
self._start = start
self._end = end
self._duration = duration
if self._source:
GLib.source_remove(self._source)
try:
self._step_size = (end - start) / (self.fps * (duration / 1000.0))
except ZeroDivisionError:
self._state = end
return
self._state_changed(self._state)
self._source = GLib.timeout_add(int(1.0 / self.fps * 1000), self._do_transition)
def _state_changed(self, state: float) -> None:
self.state_changed(state)
def state_changed(self, state: float) -> None:
pass
def get_state(self) -> float:
return self._state
def set_state(self, state: float) -> None:
self._state = state
self._state_changed(state)
def is_animating(self) -> bool:
return self._source is not None
class TreeRowFade(AnimBase):
def __init__(self, tw: "ManagerDeviceList",
path: Gtk.TreePath,
columns: Optional[Collection[Gtk.TreeViewColumn]] = None) -> None:
super().__init__(1.0)
self.tw = tw
assert self.tw.liststore is not None
self.sig: Optional[int] = self.tw.connect_after("draw", self.on_draw)
self.row = Gtk.TreeRowReference.new(self.tw.liststore, path)
self.stylecontext = tw.get_style_context()
self.columns = columns
def unref(self) -> None:
if self.sig is not None:
self.tw.disconnect(self.sig)
self.sig = None
def on_draw(self, widget: Gtk.Widget, cr: "BaseContext") -> bool:
if self.frozen:
return False
if not self.row.valid():
if self.sig is not None:
self.tw.disconnect(self.sig)
self.sig = None
return False
path = self.row.get_path()
if path is None:
return False
path = self.tw.filter.convert_child_path_to_path(path)
if path is None:
return False
color = self.stylecontext.get_background_color(Gtk.StateFlags.NORMAL)
if not self.columns:
self.columns = self.tw.get_columns()
assert self.columns is not None
for col in self.columns:
rect = self.tw.get_background_area(path, col)
cr.rectangle(rect.x, rect.y, rect.width, rect.height)
cr.clip()
cr.set_source_rgba(color.red, color.green, color.blue, 1.0 - self.get_state())
cr.set_operator(cairo.OPERATOR_OVER)
cr.paint()
return False
def state_changed(self, state: float) -> None:
self.tw.queue_draw()
class CellFade(AnimBase):
def __init__(self, tw: "ManagerDeviceList", path: Gtk.TreePath, columns: Iterable[int]) -> None:
super().__init__(1.0)
self.tw = tw
assert self.tw.liststore is not None
self.frozen = False
self.sig: Optional[int] = tw.connect_after("draw", self.on_draw)
self.row = Gtk.TreeRowReference.new(self.tw.liststore, path)
self.selection = tw.get_selection()
self.columns: List[Optional[Gtk.TreeViewColumn]] = []
for i in columns:
self.columns.append(self.tw.get_column(i))
def unref(self) -> None:
if self.sig is not None:
self.tw.disconnect(self.sig)
self.sig = None
def on_draw(self, _widget: Gtk.Widget, cr: "BaseContext") -> bool:
if self.frozen:
return False
if not self.row.valid():
if self.sig is not None:
self.tw.disconnect(self.sig)
self.sig = None
assert self.tw.liststore is not None
path = self.row.get_path()
if path is None:
return False
path = self.tw.filter.convert_child_path_to_path(path)
if path is None:
return False
# FIXME Use Gtk.render_background to render background.
# However it does not use the correct colors/gradient.
for col in self.columns:
bg_rect = self.tw.get_background_area(path, col)
rect = self.tw.get_cell_area(path, col)
rect.y = bg_rect.y
rect.height = bg_rect.height
cr.rectangle(rect.x, rect.y, rect.width, rect.height)
cr.clip()
maybe_selected = self.tw.selected()
if maybe_selected is not None:
selected = self.tw.liststore.get_path(maybe_selected) == path
else:
selected = False
stylecontext = self.tw.get_style_context()
if selected:
bg_color = stylecontext.get_background_color(Gtk.StateFlags.SELECTED)
else:
bg_color = stylecontext.get_background_color(Gtk.StateFlags.NORMAL)
cr.set_source_rgb(bg_color.red, bg_color.green, bg_color.blue)
cr.paint_with_alpha(1.0 - self.get_state())
return False
def state_changed(self, state: float) -> None:
self.tw.queue_draw()
class WidgetFade(AnimBase):
def __init__(self, widget: Gtk.Widget, color: Gdk.RGBA) -> None:
super().__init__(1.0)
self.widget = widget
self.color = color
self.sig = widget.connect_after("draw", self.on_draw)
def on_draw(self, _widget: Gtk.Widget, cr: "BaseContext") -> bool:
if not self.frozen:
cr.set_source_rgba(self.color.red, self.color.green, self.color.blue, self.color.alpha - self.get_state())
cr.set_operator(cairo.OPERATOR_OVER)
cr.paint()
return False
def state_changed(self, state: float) -> None:
self.widget.queue_draw()
blueman-2.4.3/blueman/gui/Makefile.am 0000664 0000000 0000000 00000000573 14650545052 0017421 0 ustar 00root root 0000000 0000000 SUBDIRS = \
applet \
manager
bluemandir = $(pythondir)/blueman/gui
blueman_PYTHON = Animation.py GsmSettings.py CommonUi.py DeviceList.py DeviceSelectorDialog.py DeviceSelectorList.py DeviceSelectorWidget.py GenericList.py GtkAnimation.py __init__.py Notification.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/gui/Makefile.in 0000664 0000000 0000000 00000057217 14650545052 0017441 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/gui
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = \
applet \
manager
bluemandir = $(pythondir)/blueman/gui
blueman_PYTHON = Animation.py GsmSettings.py CommonUi.py DeviceList.py DeviceSelectorDialog.py DeviceSelectorList.py DeviceSelectorWidget.py GenericList.py GtkAnimation.py __init__.py Notification.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/gui/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/gui/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/gui/Notification.py 0000664 0000000 0000000 00000025220 14650545052 0020361 0 ustar 00root root 0000000 0000000 from typing import Dict, List, Callable, Optional, Iterable, Tuple, Union, Type
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GLib
from gi.repository import Gio
from blueman.gui.GtkAnimation import AnimBase
import logging
OPACITY_START = 0.7
class Fade(AnimBase):
def __init__(self, window: Gtk.Window) -> None:
super().__init__(state=OPACITY_START)
self.window = window
def state_changed(self, state: float) -> None:
self.window.props.opacity = state
class _NotificationDialog(Gtk.MessageDialog):
def __init__(self, summary: str, message: str, _timeout: int = -1,
actions: Optional[Iterable[Tuple[str, str]]] = None,
actions_cb: Optional[Callable[[str], None]] = None, icon_name: Optional[str] = None,
image_data: Optional[GdkPixbuf.Pixbuf] = None) -> None:
super().__init__(parent=None, type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE, text=None)
self.set_name("NotificationDialog")
i = 100
self.actions_supported = True
self.actions: Dict[int, str] = {}
self.callback = actions_cb
if actions:
for a in actions:
action_id = a[0]
action_name = a[1]
self.actions[i] = action_id
self.add_button(action_name, i)
i += 1
self.actions[Gtk.ResponseType.DELETE_EVENT] = "close"
self.props.secondary_use_markup = True
self.resize(350, 50)
self.fader = Fade(self)
self.props.skip_taskbar_hint = False
self.props.title = summary
self.props.text = summary
self.props.secondary_text = message
self.props.window_position = Gtk.WindowPosition.CENTER
if icon_name:
self.set_icon_from_icon_name(icon_name, 48)
elif image_data:
self.set_icon_from_pixbuf(image_data)
self.connect("response", self.dialog_response)
self.props.icon_name = "blueman"
self.entered = False
def on_enter(_widget: "_NotificationDialog", _event: Gdk.Event) -> bool:
if self.get_window() == Gdk.Window.at_pointer()[0] or not self.entered:
self.fader.animate(start=self.fader.get_state(), end=1.0, duration=500)
self.entered = True
return False
def on_leave(_widget: "_NotificationDialog", _event: Gdk.Event) -> bool:
if not Gdk.Window.at_pointer():
self.entered = False
self.fader.animate(start=self.fader.get_state(), end=OPACITY_START, duration=500)
return False
self.connect("enter-notify-event", on_enter)
self.connect("leave-notify-event", on_leave)
def set_message(self, message: str) -> None:
self.props.secondary_text = message
def set_notification_icon(self, icon_name: str) -> None:
self.set_icon_from_icon_name(icon_name, 48)
def dialog_response(self, _dialog: Gtk.Dialog, response: int) -> None:
if self.callback:
self.callback(self.actions[response])
self.hide()
def show(self) -> None:
self.set_opacity(OPACITY_START)
self.present()
self.set_opacity(OPACITY_START)
def close(self) -> None:
self.hide()
def add_action(self, _action_id: str, _label: str, _callback: Optional[Callable[[str], None]] = None) -> None:
logging.warning("stub")
def set_icon_from_pixbuf(self, pixbuf: GdkPixbuf.Pixbuf) -> None:
im = Gtk.Image.new_from_pixbuf(pixbuf)
self.set_image(im)
im.show()
def set_icon_from_icon_name(self, icon_name: str, size: int) -> None:
im = Gtk.Image(icon_name=icon_name, pixel_size=size)
self.set_image(im)
im.show()
class _NotificationBubble(Gio.DBusProxy):
def __init__(self, summary: str, message: str, timeout: int = -1,
actions: Optional[Iterable[Tuple[str, str]]] = None,
actions_cb: Optional[Callable[[str], None]] = None, icon_name: Optional[str] = None,
image_data: Optional[GdkPixbuf.Pixbuf] = None) -> None:
super().__init__(
g_name='org.freedesktop.Notifications',
g_interface_name='org.freedesktop.Notifications',
g_object_path='/org/freedesktop/Notifications',
g_bus_type=Gio.BusType.SESSION,
g_flags=Gio.DBusProxyFlags.NONE)
self.init()
self._app_name = 'blueman'
self._app_icon = ''
self._actions: List[str] = []
self._callbacks: Dict[str, Callable[[str], None]] = {}
self._hints: Dict[str, GLib.Variant] = {}
# hint : (variant format, spec version)
self._supported_hints = {
'action-icons': ('b', 1.2),
'category': ('s', 0),
'desktop-entry': ('s', 0),
'image-data': ('(iiibiiay)', 1.2),
'image_data': ('(iiibiiay)', 1.1),
'image-path': ('s', 1.2),
'image_path': ('s', 1.1),
'icon_data': ('(iiibiiay)', 0),
'resident': ('b', 1.2),
'sound-file': ('s', 0),
'sound-name': ('s', 0),
'suppress-sound': ('b', 0),
'transient': ('b', 1.2),
'x': ('i', 0),
'y': ('i', 0),
'urgency': ('y', 0)}
self._body = message
self._summary = summary
self._timeout = timeout
self._return_id = None
if icon_name:
self._app_icon = icon_name
elif image_data:
w = image_data.props.width
h = image_data.props.height
stride = image_data.props.rowstride
alpha = image_data.props.has_alpha
bits = image_data.props.bits_per_sample
channel = image_data.props.n_channels
data = image_data.get_pixels()
supported_spec = float(self.server_information[-1])
if supported_spec < 1.1:
key = 'icon_data'
elif supported_spec < 1.2:
key = 'image_data'
elif supported_spec >= 1.2:
key = 'image-data'
else:
raise ValueError('Not supported by server')
self.set_hint(key, (w, h, stride, alpha, bits, channel, data))
if actions:
for action in actions:
self.add_action(action[0], action[1], actions_cb)
self._capabilities = self.GetCapabilities()
def set_message(self, message: str) -> None:
self._body = message
if self._return_id is not None:
self.show()
def set_notification_icon(self, icon_name: str) -> None:
self._app_icon = icon_name
if self._return_id is not None:
self.show()
@property
def server_information(self) -> Tuple[str, str, str, str]:
info: Tuple[str, str, str, str] = self.GetServerInformation()
return info
@property
def actions_supported(self) -> bool:
return 'actions' in self._capabilities
def set_hint(self, key: str, val: object) -> None:
if key not in self._supported_hints:
raise ValueError('Unsupported hint')
fmt, spec_version = self._supported_hints[key]
if spec_version > float(self.server_information[-1]):
raise ValueError('Not supported by server')
param = GLib.Variant(fmt, val)
self._hints[key] = param
def remove_hint(self, key: str) -> None:
del (self._hints[key])
def clear_hints(self) -> None:
self._hints = {}
def add_action(self, action_id: str, label: str, callback: Optional[Callable[[str], None]] = None) -> None:
self._actions.extend([action_id, label])
if callback:
self._callbacks[action_id] = callback
def clear_actions(self) -> None:
self._actions = []
self._callbacks = {}
def do_g_signal(self, _sender_name: str, signal_name: str, params: GLib.Variant) -> None:
notif_id, signal_val = params.unpack()
if notif_id != self._return_id:
return
logging.info(signal_val)
if signal_name == 'NotificationClosed':
if signal_val == 1:
logging.debug('The notification expired.')
elif signal_val == 2:
logging.debug('The notification was dismissed by the user.')
elif signal_val == 3:
logging.debug('The notification was closed by a call to CloseNotification.')
elif signal_val == 4:
logging.debug('Undefined/reserved reasons.')
elif signal_name == 'ActionInvoked':
if signal_val in self._callbacks:
self._callbacks[signal_val](signal_val)
def show(self) -> None:
replace_id = self._return_id if self._return_id else 0
return_id = self.Notify('(susssasa{sv}i)', self._app_name, replace_id, self._app_icon,
self._summary, self._body, self._actions, self._hints,
self._timeout)
self._return_id = return_id
def close(self) -> None:
param = GLib.Variant('(u)', (self._return_id,))
self.call_sync('CloseNotification', param, Gio.DBusCallFlags.NONE, -1, None)
self._return_id = None
def Notification(summary: str, message: str, timeout: int = -1, actions: Optional[Iterable[Tuple[str, str]]] = None,
actions_cb: Optional[Callable[[str], None]] = None, icon_name: Optional[str] = None,
image_data: Optional[GdkPixbuf.Pixbuf] = None) -> Union[_NotificationBubble, _NotificationDialog]:
forced_fallback = not Gio.Settings(schema_id='org.blueman.general')['notification-daemon']
try:
bus = Gio.bus_get_sync(Gio.BusType.SESSION)
caps = bus.call_sync('org.freedesktop.Notifications', '/org/freedesktop/Notifications',
'org.freedesktop.Notifications', 'GetCapabilities', None, None,
Gio.DBusCallFlags.NONE, -1, None).unpack()[0]
except GLib.Error:
caps = []
if forced_fallback or 'body' not in caps or (actions and 'actions' not in caps):
# Use fallback in the case:
# * user does not want to use a notification daemon
# * the notification daemon is not available
# * we have to show actions and the notification daemon does not provide them
klass: Type[Union[_NotificationBubble, _NotificationDialog]] = _NotificationDialog
else:
klass = _NotificationBubble
return klass(summary, message, timeout, actions, actions_cb, icon_name, image_data)
blueman-2.4.3/blueman/gui/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0017457 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gui/applet/ 0000775 0000000 0000000 00000000000 14650545052 0016645 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gui/applet/Makefile.am 0000664 0000000 0000000 00000000317 14650545052 0020702 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/gui/applet
blueman_PYTHON = \
PluginDialog.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/gui/applet/Makefile.in 0000664 0000000 0000000 00000042434 14650545052 0020721 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/gui/applet
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/gui/applet
blueman_PYTHON = \
PluginDialog.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/gui/applet/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/gui/applet/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/gui/applet/PluginDialog.py 0000664 0000000 0000000 00000032524 14650545052 0021603 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import TYPE_CHECKING, Type, Dict, cast, Optional, TypeVar
from blueman.main.Builder import Builder
from blueman.main.PluginManager import PluginManager
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.BasePlugin import Option, BasePlugin
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gdk, Gio, GLib, GObject
if TYPE_CHECKING:
from blueman.main.Applet import BluemanApplet
class PluginItem(GObject.Object):
__gtype_name__ = "PluginItem"
class _Props:
icon_name: str
plugin_name: str
description: str
enabled: bool
activatable: bool
props: _Props
icon_name = GObject.Property(type=str)
plugin_name = GObject.Property(type=str)
description = GObject.Property(type=str)
enabled = GObject.Property(type=bool, default=False)
activatable = GObject.Property(type=bool, default=False)
def __init__(self, icon_name: str, plugin_name: str, description: str, enabled: bool, activatable: bool):
super().__init__()
self.props.icon_name = icon_name
self.props.plugin_name = plugin_name
self.props.description = description
self.props.enabled = enabled
self.props.activatable = activatable
class SettingsWidget(Gtk.Box):
def __init__(self, inst: AppletPlugin, orientation: Gtk.Orientation = Gtk.Orientation.VERTICAL) -> None:
super().__init__(
name="SettingsWidget",
orientation=orientation,
spacing=2
)
self.inst = inst
self.construct_settings()
self.show_all()
def construct_settings(self) -> None:
for k, v in self.inst.__class__.__options__.items():
if len(v) > 2:
label = Gtk.Label(label=v["name"])
label.props.xalign = 0.0
w = self.get_control_widget(k, v)
self.pack_start(w, False, False, 0)
label = Gtk.Label(label="" + v["desc"] + "", wrap=True, use_markup=True, xalign=0.0)
self.pack_start(label, False, False, 0)
def handle_change(self, widget: Gtk.Widget, opt: str, params: "Option", prop: str) -> None:
val = params["type"](getattr(widget.props, prop))
logging.debug(f"changed {opt} {val}")
self.inst.set_option(opt, val)
def get_control_widget(self, opt: str, params: "Option") -> Gtk.Widget:
if params["type"] == bool:
c = Gtk.CheckButton(label=params["name"])
c.props.active = self.inst.get_option(opt)
c.connect("toggled", self.handle_change, opt, params, "active")
return c
elif params["type"] == int:
b = Gtk.Box(spacing=6)
label = Gtk.Label(label=params["name"])
b.pack_start(label, False, False, 0)
r = Gtk.SpinButton(numeric=True)
b.pack_start(r, False, False, 6)
r.set_increments(1, 3)
r.set_range(params["range"][0], params["range"][1])
r.props.value = self.inst.get_option(opt)
r.connect("value-changed", self.handle_change, opt, params, "value")
return b
elif params["type"] == str:
b = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
label = Gtk.Label(label=params["name"])
b.pack_start(label, False, False, 0)
e = Gtk.Entry()
b.pack_start(e, False, False, 6)
e.props.text = self.inst.get_option(opt)
e.connect("changed", self.handle_change, opt, params, "text")
return b
raise ValueError()
class PluginDialog(Gtk.ApplicationWindow):
def __init__(self, applet: "BluemanApplet") -> None:
super().__init__(
application=applet,
title=_("Plugins"),
icon_name="blueman",
name="PluginDialog",
border_width=10,
default_width=490,
default_height=380,
resizable=False,
visible=False
)
self.set_position(Gtk.WindowPosition.CENTER)
self.applet = applet
builder = Builder("applet-plugins-widget.ui")
self.description = builder.get_widget("description", Gtk.Label)
self.icon = builder.get_widget("icon", Gtk.Image)
self.author_txt = builder.get_widget("author_txt", Gtk.Label)
self.depends_txt = builder.get_widget("depends_txt", Gtk.Label)
self.conflicts_txt = builder.get_widget("conflicts_txt", Gtk.Label)
self.plugin_name = builder.get_widget("name", Gtk.Label)
self.main_container = builder.get_widget("main_container", Gtk.Bin)
self.content_grid = builder.get_widget("content", Gtk.Widget)
self.b_prefs = builder.get_widget("b_prefs", Gtk.ToggleButton)
self.b_prefs.connect("toggled", self.on_prefs_toggled)
self.add(builder.get_widget("all", Gtk.Container))
self.model = Gio.ListStore.new(PluginItem.__gtype__)
self.listbox = builder.get_widget("plugin_listbox", Gtk.ListBox)
self.listbox.bind_model(self.model, self._widget_factory)
self.listbox.connect("row-selected", self._on_row_selected)
plugin_list = builder.get_widget("plugin_list", Gtk.ScrolledWindow)
plugin_info = builder.get_widget("main_scrolled_window", Gtk.ScrolledWindow)
# Disable overlay scrolling
if Gtk.get_minor_version() >= 16:
plugin_list.props.overlay_scrolling = False
plugin_info.props.overlay_scrolling = False
self.populate()
self.sig_a: int = self.applet.Plugins.connect("plugin-loaded", self.plugin_state_changed, True)
self.sig_b: int = self.applet.Plugins.connect("plugin-unloaded", self.plugin_state_changed, False)
self.connect("delete-event", self._on_close)
close_action = Gio.SimpleAction.new("close", None)
close_action.connect("activate", lambda x, y: self.close())
self.add_action(close_action)
def _add_plugin_action(self, name: str, state: bool, activatable: bool) -> None:
logging.debug(f"adding action: {name}")
action = Gio.SimpleAction.new_stateful(
name, None, GLib.Variant.new_boolean(state)
)
action.set_property("enabled", activatable)
self.add_action(action)
action.connect("change-state", self._on_plugin_toggle)
def _widget_factory(self, item: GObject.Object, _data: Optional[object] = None) -> Gtk.Widget:
assert isinstance(item, PluginItem)
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5, visible=True)
checkbutton = Gtk.CheckButton(visible=True, sensitive=item.props.activatable)
box.add(checkbutton)
checkbutton.set_action_name(f"win.{item.props.plugin_name}")
self._add_plugin_action(item.props.plugin_name, item.props.enabled, item.props.activatable)
# Set active after adding action
checkbutton.set_active(item.props.enabled)
plugin_im = Gtk.Image(icon_name=item.props.icon_name, visible=True)
box.add(plugin_im)
label = Gtk.Label(label=item.props.description, use_markup=True, visible=True)
box.add(label)
return box
def _model_sort_func(self, item1: Optional[object], item2: Optional[object], _data: Optional[object] = None) -> int:
assert isinstance(item1, PluginItem)
assert isinstance(item2, PluginItem)
if item1.props.activatable and not item2.props.activatable:
return -1
elif not item1.props.activatable and item2.props.activatable:
return 1
if item1.props.plugin_name < item2.props.plugin_name:
return -1
elif item1.props.plugin_name > item2.props.plugin_name:
return 1
return 0
def _on_plugin_toggle(self, action: Gio.SimpleAction, state: GLib.Variant) -> None:
action.set_state(state)
plugin_name = action.get_name()
deps = self.applet.Plugins.get_dependencies()[plugin_name]
loaded = self.applet.Plugins.get_loaded()
to_unload = [dep for dep in deps if dep in loaded]
if to_unload:
if not self._ask_unload(
_("Plugin \"%(0)s\" depends on %(1)s. Unloading %(1)s will also unload "
"\"%(0)s\".\nProceed?") % {"0": ", ".join(to_unload), "1": plugin_name}
):
action.set_state(GLib.Variant.new_boolean(not state))
return
else:
conflicts = self.applet.Plugins.get_conflicts()[plugin_name]
to_unload = [conf for conf in conflicts if conf in loaded]
if to_unload and not self._ask_unload(
_("Plugin %(0)s conflicts with %(1)s. Loading %(1)s will unload %(0)s."
"\nProceed?") % {"0": ", ".join(to_unload), "1": plugin_name}
):
action.set_state(GLib.Variant.new_boolean(not state))
return
for p in to_unload:
logging.debug(f"unloading {p}")
self.applet.Plugins.set_config(p, False)
self.applet.Plugins.set_config(plugin_name, plugin_name not in self.applet.Plugins.get_loaded())
def _on_row_selected(self, _lb: Gtk.ListBox, lbrow: Gtk.ListBoxRow) -> None:
pos = lbrow.get_index()
item = self.model.get_item(pos)
assert isinstance(item, PluginItem)
cls: Type[AppletPlugin] = self.applet.Plugins.get_classes()[item.props.plugin_name]
self.plugin_name.props.label = "" + item.props.plugin_name + ""
self.icon.props.icon_name = cls.__icon__
self.author_txt.props.label = cls.__author__
self.description.props.label = cls.__description__
if cls.__depends__:
self.depends_txt.props.label = ", ".join(cls.__depends__)
else:
self.depends_txt.props.label = _("No dependencies")
if cls.__conflicts__:
self.conflicts_txt.props.label = ", ".join(cls.__conflicts__)
else:
self.conflicts_txt.props.label = _("No conflicts")
if cls.is_configurable() and item.props.plugin_name in self.applet.Plugins.get_loaded():
self.b_prefs.props.sensitive = True
else:
self.b_prefs.props.sensitive = False
self.update_config_widget(cls)
def _on_close(self, _widget: Gtk.Widget, _event: Gdk.Event) -> bool:
self.applet.Plugins.disconnect(self.sig_a)
self.applet.Plugins.disconnect(self.sig_b)
return False
def on_prefs_toggled(self, _button: Gtk.ToggleButton) -> None:
row = self.listbox.get_selected_row()
pos = row.get_index()
item = cast(PluginItem, self.model.get_item(pos))
cls: Type[AppletPlugin] = self.applet.Plugins.get_classes()[item.props.plugin_name]
self.update_config_widget(cls)
def update_config_widget(self, cls: Type[AppletPlugin]) -> None:
if self.b_prefs.props.active:
if not cls.is_configurable():
self.b_prefs.props.active = False
return
inst = cls.get_instance()
if not inst:
self.b_prefs.props.active = False
else:
c = self.main_container.get_child()
assert c is not None
self.main_container.remove(c)
if isinstance(c, SettingsWidget):
c.destroy()
self.main_container.add(SettingsWidget(inst))
else:
c = self.main_container.get_child()
assert c is not None
self.main_container.remove(c)
if isinstance(c, SettingsWidget):
c.destroy()
self.main_container.add(self.content_grid)
def populate(self) -> None:
classes: Dict[str, Type[AppletPlugin]] = self.applet.Plugins.get_classes()
loaded = self.applet.Plugins.get_loaded()
for name, cls in classes.items():
if cls.is_configurable():
desc = f"{name}"
else:
desc = name
plugin_item = PluginItem(cls.__icon__, name, desc, name in loaded, activatable=cls.__unloadable__)
self.model.insert_sorted(plugin_item, self._model_sort_func)
self.listbox.select_row(self.listbox.get_row_at_index(0))
_T = TypeVar("_T", bound="BasePlugin")
def plugin_state_changed(self, _plugins: PluginManager[_T], name: str, loaded: bool) -> None:
logging.debug(f"{name} {loaded}")
action = self.lookup_action(name)
assert isinstance(action, Gio.SimpleAction)
action.set_state(GLib.Variant.new_boolean(loaded))
cls: Type[AppletPlugin] = self.applet.Plugins.get_classes()[name]
if not loaded:
self.update_config_widget(cls)
self.b_prefs.props.sensitive = False
elif cls.is_configurable():
self.b_prefs.props.sensitive = True
def _ask_unload(self, text: str) -> bool:
dialog = Gtk.MessageDialog(parent=self, type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.YES_NO)
dialog.props.secondary_use_markup = True
dialog.props.icon_name = "blueman"
dialog.props.text = _("Dependency issue")
dialog.props.secondary_text = text
resp = dialog.run()
dialog.destroy()
return resp == Gtk.ResponseType.YES
blueman-2.4.3/blueman/gui/applet/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0020744 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gui/manager/ 0000775 0000000 0000000 00000000000 14650545052 0016772 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/gui/manager/Makefile.am 0000664 0000000 0000000 00000000505 14650545052 0021026 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/gui/manager
blueman_PYTHON = \
ManagerDeviceList.py \
ManagerDeviceMenu.py \
ManagerMenu.py \
ManagerProgressbar.py \
ManagerStats.py \
ManagerToolbar.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/gui/manager/Makefile.in 0000664 0000000 0000000 00000042624 14650545052 0021047 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/gui/manager
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/gui/manager
blueman_PYTHON = \
ManagerDeviceList.py \
ManagerDeviceMenu.py \
ManagerMenu.py \
ManagerProgressbar.py \
ManagerStats.py \
ManagerToolbar.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/gui/manager/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/gui/manager/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/gui/manager/ManagerDeviceList.py 0000664 0000000 0000000 00000066653 14650545052 0022712 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Optional, TYPE_CHECKING, List, Any, cast, Callable, Set, Dict
import html
import logging
import cairo
import os
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Battery import Battery
from blueman.bluez.Device import Device
from blueman.bluez.Manager import Manager
from blueman.gui.DeviceList import DeviceList
from blueman.DeviceClass import get_minor_class, get_major_class, gatt_appearance_to_name
from blueman.gui.GenericList import ListDataDict
from blueman.gui.manager.ManagerDeviceMenu import ManagerDeviceMenu
from blueman.Constants import PIXMAP_PATH
from blueman.Functions import launch
from blueman.Sdp import ServiceUUID, OBEX_OBJPUSH_SVCLASS_ID
from blueman.gui.GtkAnimation import TreeRowFade, CellFade, AnimBase
from _blueman import ConnInfoReadError, conn_info
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gio
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import Pango
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class SurfaceObject(GObject.Object):
__gtype_name__ = "SurfaceObject"
def __init__(self, surface: cairo.ImageSurface) -> None:
super().__init__()
self.surface = surface
class ManagerDeviceList(DeviceList):
def __init__(self, inst: "Blueman", adapter: Optional[str] = None) -> None:
cr = Gtk.CellRendererText()
cr.props.ellipsize = Pango.EllipsizeMode.END
tabledata: List[ListDataDict] = [
# device picture
{"id": "device_surface", "type": SurfaceObject, "renderer": Gtk.CellRendererPixbuf(),
"render_attrs": {}, "celldata_func": (self._set_cell_data, None)},
# device caption
{"id": "caption", "type": str, "renderer": cr,
"render_attrs": {"markup": 1}, "view_props": {"expand": True}},
{"id": "battery_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(),
"render_attrs": {}, "view_props": {"spacing": 0},
"celldata_func": (self._set_cell_data, "battery")},
{"id": "rssi_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(),
"render_attrs": {}, "view_props": {"spacing": 0},
"celldata_func": (self._set_cell_data, "rssi")},
{"id": "tpl_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(),
"render_attrs": {}, "view_props": {"spacing": 0},
"celldata_func": (self._set_cell_data, "tpl")},
{"id": "alias", "type": str}, # used for quick access instead of device.GetProperties
{"id": "connected", "type": bool}, # used for quick access instead of device.GetProperties
{"id": "paired", "type": bool}, # used for quick access instead of device.GetProperties
{"id": "trusted", "type": bool}, # used for quick access instead of device.GetProperties
{"id": "objpush", "type": bool}, # used to set Send File button
{"id": "battery", "type": float},
{"id": "rssi", "type": float},
{"id": "tpl", "type": float},
{"id": "cell_fader", "type": CellFade},
{"id": "row_fader", "type": TreeRowFade},
{"id": "initial_anim", "type": bool},
{"id": "blocked", "type": bool}
]
super().__init__(adapter, tabledata)
self.set_name("ManagerDeviceList")
self.set_headers_visible(False)
self.props.has_tooltip = True
self.Blueman = inst
self._monitored_devices: Set[str] = set()
self.manager.connect_signal("battery-created", self.on_battery_created)
self.manager.connect_signal("battery-removed", self.on_battery_removed)
self._batteries: Dict[str, Battery] = {}
self.Config = Gio.Settings(schema_id="org.blueman.general")
self.Config.connect('changed', self._on_settings_changed)
# Set the correct sorting
self._on_settings_changed(self.Config, "sort-by")
self._on_settings_changed(self.Config, "sort-type")
self.connect("query-tooltip", self.tooltip_query)
self.tooltip_row: Optional[Gtk.TreePath] = None
self.tooltip_col: Optional[Gtk.TreeViewColumn] = None
self.connect("popup-menu", self._on_popup_menu)
self.connect("button-press-event", self._on_event_clicked)
self.connect("button-release-event", self._on_event_clicked)
self.connect("key-press-event", self._on_key_pressed)
self.menu: Optional[ManagerDeviceMenu] = None
self.connect("drag_data_received", self.drag_recv)
self.connect("drag-motion", self.drag_motion)
Gtk.Widget.drag_dest_set(self, Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY | Gdk.DragAction.DEFAULT)
Gtk.Widget.drag_dest_add_uri_targets(self)
self.set_search_equal_func(self.search_func)
self.filter.set_visible_func(self.filter_func)
def _on_settings_changed(self, settings: Gio.Settings, key: str) -> None:
if key in ('sort-by', 'sort-order'):
sort_by = settings['sort-by']
sort_order = settings['sort-order']
if sort_order == 'ascending':
sort_type = Gtk.SortType.ASCENDING
else:
sort_type = Gtk.SortType.DESCENDING
column_id = self.ids.get(sort_by)
if column_id:
self.liststore.set_sort_column_id(column_id, sort_type)
def on_icon_theme_changed(self, _icon_them: Gtk.IconTheme) -> None:
for row in self.liststore:
device = self.get(row.iter, "device")["device"]
self.row_setup_event(row.iter, device)
def on_battery_created(self, _manager: Manager, obj_path: str) -> None:
if obj_path not in self._batteries:
battery_proxy = Battery(obj_path=obj_path)
self._batteries[obj_path] = battery_proxy
logging.debug(f"{obj_path} {battery_proxy['Percentage']}")
def on_battery_removed(self, _manager: Manager, obj_path: str) -> None:
if obj_path in self._batteries:
battery = self._batteries.pop(obj_path)
battery.destroy()
def search_func(self, model: Gtk.TreeModel, column: int, key: str, tree_iter: Gtk.TreeIter) -> bool:
row = self.get(tree_iter, "caption")
if key.lower() in row["caption"].lower():
return False
logging.info(f"{model} {column} {key} {tree_iter}")
return True
def filter_func(self, _model: Gtk.TreeModel, tree_iter: Gtk.TreeIter, _data: Any) -> bool:
row = self.get(tree_iter, "no_name", "device")
device = row["device"]
klass = get_minor_class(device["Class"]) if device is not None else None
if row["no_name"] and self.Config["hide-unnamed"] and klass not in (_("Keyboard"), _("Combo")):
logging.info("Hiding unnamed device")
return False
else:
return True
def drag_recv(self, _widget: Gtk.Widget, context: Gdk.DragContext, x: int, y: int, selection: Gtk.SelectionData,
_info: int, time: int) -> None:
uris = list(selection.get_uris())
context.finish(True, False, time)
path = self.get_path_at_pos(x, y)
if path:
tree_iter = self.get_iter(path[0])
assert tree_iter is not None
device = self.get(tree_iter, "device")["device"]
command = f"blueman-sendto --device={device['Address']}"
launch(command, paths=uris, name=_("File Sender"))
context.finish(True, False, time)
else:
context.finish(False, False, time)
def drag_motion(self, _widget: Gtk.Widget, drag_context: Gdk.DragContext, x: int, y: int, timestamp: int) -> bool:
result = self.get_path_at_pos(x, y)
if result is not None:
path = result[0]
assert path is not None
path = self.filter.convert_path_to_child_path(path)
if path is None:
return False
if not self.selection.path_is_selected(path):
tree_iter = self.get_iter(path)
assert tree_iter is not None
has_obj_push = self._has_objpush(self.get(tree_iter, "device")["device"])
if has_obj_push:
Gdk.drag_status(drag_context, Gdk.DragAction.COPY, timestamp)
self.set_cursor(path)
return True
else:
Gdk.drag_status(drag_context, Gdk.DragAction.DEFAULT, timestamp)
return False
return False
else:
Gdk.drag_status(drag_context, Gdk.DragAction.DEFAULT, timestamp)
return False
def _on_popup_menu(self, _widget: Gtk.Widget) -> bool:
if self.menu is None:
self.menu = ManagerDeviceMenu(self.Blueman)
window = self.get_window()
assert window is not None
selected = self.selected()
assert selected is not None
rect = self.get_cell_area(self.liststore.get_path(selected), self.get_column(1))
self.menu.popup_at_rect(window, rect, Gdk.Gravity.CENTER, Gdk.Gravity.NORTH)
return True
def _on_event_clicked(self, _widget: Gtk.Widget, event: Gdk.Event) -> bool:
if event.type not in (Gdk.EventType._2BUTTON_PRESS, Gdk.EventType.BUTTON_PRESS):
return False
posdata = self.get_path_at_pos(int(cast(Gdk.EventButton, event).x), int(cast(Gdk.EventButton, event).y))
if posdata is None:
return False
else:
path = posdata[0]
assert path is not None
tree_iter = self.filter.get_iter(path)
assert tree_iter is not None
child_iter = self.filter.convert_iter_to_child_iter(tree_iter)
assert child_iter is not None
row = self.get(child_iter, "device", "connected")
if not row:
return False
if self.menu is None:
self.menu = ManagerDeviceMenu(self.Blueman)
if event.type == Gdk.EventType._2BUTTON_PRESS and cast(Gdk.EventButton, event).button == 1:
if self.menu.show_generic_connect_calc(row["device"]['UUIDs']):
if row["connected"]:
self.menu.disconnect_service(row["device"])
elif Adapter(obj_path=row["device"]["Adapter"])["Powered"]:
self.menu.connect_service(row["device"])
if event.type == Gdk.EventType.BUTTON_PRESS and cast(Gdk.EventButton, event).button == 3:
self.menu.popup_at_pointer(event)
return False
def _on_key_pressed(self, _widget: Gtk.Widget, event: Gdk.EventKey) -> bool:
if not (event.state & Gdk.ModifierType.CONTROL_MASK and event.keyval == Gdk.KEY_c):
return False
selected = self.selected()
if not selected:
return False
row = self.get(selected, "device")
if not row:
return False
Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD).set_text(row["device"]["Address"], -1)
return True
def _load_surface(self, icon_name: str, size: int) -> cairo.ImageSurface:
window = self.get_window()
scale = self.get_scale_factor()
icon_info = self.icon_theme.lookup_icon_for_scale(icon_name, size, scale, Gtk.IconLookupFlags.FORCE_SIZE)
if icon_info is None:
logging.error(f"Failed to look up icon \"{icon_name}\" likely due to broken icon theme.")
missing_icon_info = self.icon_theme.lookup_icon_for_scale(
"image-missing",
size,
scale,
Gtk.IconLookupFlags.FORCE_SIZE
)
assert missing_icon_info is not None
return cast(cairo.ImageSurface, missing_icon_info.load_surface(window))
else:
return cast(cairo.ImageSurface, icon_info.load_surface(window))
def _make_device_icon(self, icon_name: str, is_paired: bool, is_connected: bool, is_trusted: bool,
is_blocked: bool) -> cairo.ImageSurface:
scale = self.get_scale_factor()
target = self._load_surface(icon_name, 48)
ctx = cairo.Context(target)
if is_connected or is_paired:
icon = "blueman-connected-emblem" if is_connected else "blueman-paired-emblem"
paired_surface = self._load_surface(icon, 16)
ctx.set_source_surface(paired_surface, 1 / scale, 1 / scale)
ctx.paint_with_alpha(0.8)
if is_trusted:
trusted_surface = self._load_surface("blueman-trusted-emblem", 16)
assert isinstance(target, cairo.ImageSurface)
height = target.get_height()
mini_height = trusted_surface.get_height()
y = height / scale - mini_height / scale - 1 / scale
ctx.set_source_surface(trusted_surface, 1 / scale, y)
ctx.paint_with_alpha(0.8)
if is_blocked:
blocked_surface = self._load_surface("blueman-blocked-emblem", 16)
assert isinstance(target, cairo.ImageSurface)
width = target.get_width()
mini_width = blocked_surface.get_width()
ctx.set_source_surface(blocked_surface, (width - mini_width - 1) / scale, 1 / scale)
ctx.paint_with_alpha(0.8)
return target
def device_remove_event(self, object_path: str) -> None:
tree_iter = self.find_device_by_path(object_path)
assert tree_iter is not None
iter_set, _child_tree_iter = self.filter.convert_child_iter_to_iter(tree_iter)
if iter_set:
row_fader = self.get(tree_iter, "row_fader")["row_fader"]
self._prepare_fader(row_fader, lambda: self.__fader_finished(object_path))
row_fader.animate(start=row_fader.get_state(), end=0.0, duration=400)
def __fader_finished(self, object_path: str) -> None:
super().device_remove_event(object_path)
@staticmethod
def make_caption(name: str, klass: str, address: str) -> str:
return "%(0)s\n%(1)s\n%(2)s" \
% {"0": html.escape(name), "1": klass, "2": address}
@staticmethod
def make_display_name(alias: str, klass: int, address: str) -> str:
if alias.replace("-", ":") == address:
return _("Unnamed device")
else:
return alias
@staticmethod
def get_device_class(device: Device) -> str:
klass = get_minor_class(device['Class'])
if klass != _("Uncategorized"):
return klass
else:
return get_major_class(device['Class'])
def row_setup_event(self, tree_iter: Gtk.TreeIter, device: Device) -> None:
if not self.get(tree_iter, "initial_anim")["initial_anim"]:
assert self.liststore is not None
child_path = self.liststore.get_path(tree_iter)
result = self.filter.convert_child_path_to_path(child_path)
if child_path is not None:
cell_fader = CellFade(self, child_path, [2, 3, 4, 5])
row_fader = TreeRowFade(self, child_path)
self.set(tree_iter, row_fader=row_fader, cell_fader=cell_fader)
cell_fader.freeze()
if result is not None:
self._prepare_fader(row_fader).animate(start=0.0, end=1.0, duration=500)
self.set(tree_iter, initial_anim=True)
else:
self.set(tree_iter, initial_anim=False)
has_objpush = self._has_objpush(device)
klass = get_minor_class(device['Class'])
# Bluetooth >= 4 devices use Appearance property
appearance = device["Appearance"]
if klass != _("Uncategorized") and klass != _("Unknown"):
description = klass
elif klass == _("Unknown") and appearance:
description = gatt_appearance_to_name(appearance)
else:
description = get_major_class(device['Class'])
surface = self._make_device_icon(device["Icon"], device["Paired"], device["Connected"], device["Trusted"],
device["Blocked"])
surface_object = SurfaceObject(surface)
display_name = self.make_display_name(device.display_name, device["Class"], device['Address'])
caption = self.make_caption(display_name, description, device['Address'])
self.set(tree_iter, caption=caption, alias=display_name, objpush=has_objpush, device_surface=surface_object)
try:
self.row_update_event(tree_iter, "Trusted", device['Trusted'])
except Exception as e:
logging.exception(e)
try:
self.row_update_event(tree_iter, "Paired", device['Paired'])
except Exception as e:
logging.exception(e)
try:
self.row_update_event(tree_iter, "Connected", device["Connected"])
except Exception as e:
logging.exception(e)
try:
self.row_update_event(tree_iter, "Blocked", device["Blocked"])
except Exception as e:
logging.exception(e)
if device["Connected"]:
self._monitor_power_levels(tree_iter, device)
def _monitor_power_levels(self, tree_iter: Gtk.TreeIter, device: Device) -> None:
if device["Address"] in self._monitored_devices:
return
assert self.Adapter is not None
cinfo = conn_info(device["Address"], os.path.basename(self.Adapter.get_object_path()))
try:
cinfo.init()
except ConnInfoReadError:
logging.warning("Failed to get power levels, probably a LE device.")
model = self.liststore
assert isinstance(model, Gtk.TreeModel)
r = Gtk.TreeRowReference.new(model, model.get_path(tree_iter))
self._update_power_levels(tree_iter, device, cinfo)
GLib.timeout_add(1000, self._check_power_levels, r, cinfo, device["Address"])
self._monitored_devices.add(device["Address"])
def _check_power_levels(self, row_ref: Gtk.TreeRowReference, cinfo: conn_info, address: str) -> bool:
if not row_ref.valid():
logging.warning("stopping monitor (row does not exist)")
cinfo.deinit()
self._monitored_devices.remove(address)
return False
tree_iter = self.get_iter(row_ref.get_path())
assert tree_iter is not None
device = self.get(tree_iter, "device")["device"]
if device["Connected"]:
self._update_power_levels(tree_iter, device, cinfo)
return True
else:
cinfo.deinit()
self._disable_power_levels(tree_iter)
self._monitored_devices.remove(address)
return False
def row_update_event(self, tree_iter: Gtk.TreeIter, key: str, value: Any) -> None:
logging.info(f"{key} {value}")
device = self.get(tree_iter, "device")["device"]
if key in ("Blocked", "Connected", "Paired", "Trusted"):
surface = self._make_device_icon(device["Icon"], device["Paired"], device["Connected"], device["Trusted"],
device["Blocked"])
self.set(tree_iter, device_surface=SurfaceObject(surface))
if key == "Trusted":
if value:
self.set(tree_iter, trusted=True)
else:
self.set(tree_iter, trusted=False)
elif key == "Paired":
if value:
self.set(tree_iter, paired=True)
else:
self.set(tree_iter, paired=False)
elif key == "Alias":
c = self.make_caption(value, self.get_device_class(device), device['Address'])
name = self.make_display_name(device.display_name, device["Class"], device["Address"])
self.set(tree_iter, caption=c, alias=name)
elif key == "UUIDs":
has_objpush = self._has_objpush(device)
self.set(tree_iter, objpush=has_objpush)
elif key == "Connected":
self.set(tree_iter, connected=value)
if value:
self._monitor_power_levels(tree_iter, device)
else:
self._disable_power_levels(tree_iter)
elif key == "Name":
self.set(tree_iter, no_name=False)
self.filter.refilter()
elif key == "Blocked":
self.set(tree_iter, blocked=value)
def _update_power_levels(self, tree_iter: Gtk.TreeIter, device: Device, cinfo: conn_info) -> None:
row = self.get(tree_iter, "cell_fader", "battery", "rssi", "lq", "tpl")
bars = {}
obj_path = device.get_object_path()
if obj_path in self._batteries:
bars["battery"] = self._batteries[obj_path]["Percentage"]
# cinfo init may fail for bluetooth devices version 4 and up
# FIXME Workaround is horrible and we should show something better
if cinfo.failed:
bars.update({"rssi": 100.0, "tpl": 100.0})
else:
try:
bars["rssi"] = max(50 + float(cinfo.get_rssi()) / 127 * 50, 10)
except ConnInfoReadError:
bars["rssi"] = 50
try:
bars["tpl"] = max(50 + float(cinfo.get_tpl()) / 127 * 50, 10)
except ConnInfoReadError:
bars["tpl"] = 50
if row["battery"] == row["rssi"] == row["tpl"] == 0:
self._prepare_fader(row["cell_fader"]).animate(start=0.0, end=1.0, duration=400)
w = 14 * self.get_scale_factor()
h = 48 * self.get_scale_factor()
for (name, perc) in bars.items():
if round(row[name], -1) != round(perc, -1):
icon_name = f"blueman-{name}-{int(round(perc, -1))}.png"
icon = GdkPixbuf.Pixbuf.new_from_file_at_scale(os.path.join(PIXMAP_PATH, icon_name), w, h, True)
self.set(tree_iter, **{name: perc, f"{name}_pb": icon})
def _disable_power_levels(self, tree_iter: Gtk.TreeIter) -> None:
row = self.get(tree_iter, "cell_fader", "battery", "rssi", "tpl")
if row["battery"] == row["rssi"] == row["tpl"] == 0:
return
self.set(tree_iter, battery=0, rssi=0, tpl=0)
self._prepare_fader(row["cell_fader"], lambda: self.set(tree_iter, battery_pb=None, rssi_pb=None,
tpl_pb=None)).animate(start=1.0, end=0.0, duration=400)
def _prepare_fader(self, fader: AnimBase, callback: Optional[Callable[[], None]] = None) -> AnimBase:
def on_finished(finished_fader: AnimBase) -> None:
finished_fader.disconnect(handler)
finished_fader.freeze()
if callback:
callback()
fader.thaw()
handler = fader.connect("animation-finished", on_finished)
return fader
def tooltip_query(self, _tw: Gtk.Widget, x: int, y: int, _kb: bool, tooltip: Gtk.Tooltip) -> bool:
path = self.get_path_at_pos(x, y)
if path is None:
return False
if path[0] != self.tooltip_row or path[1] != self.tooltip_col:
self.tooltip_row = path[0]
self.tooltip_col = path[1]
return False
if path[1] == self.columns["device_surface"]:
tree_iter = self.get_iter(path[0])
assert tree_iter is not None
row = self.get(tree_iter, "connected", "trusted", "paired", "blocked")
str_list = []
if row["connected"]:
str_list.append(_("Connected"))
if row["trusted"]:
str_list.append(_("Trusted"))
if row["paired"]:
str_list.append(_("Paired"))
if row["blocked"]:
str_list.append(_("Blocked"))
text = ", ".join(str_list)
if text:
tooltip.set_markup(f"{text}")
else:
return False
self.tooltip_row = path[0]
self.tooltip_col = path[1]
return True
elif path[1] == self.columns["battery_pb"] \
or path[1] == self.columns["tpl_pb"] \
or path[1] == self.columns["rssi_pb"]:
tree_iter = self.get_iter(path[0])
assert tree_iter is not None
dt = self.get(tree_iter, "connected")["connected"]
if not dt:
return False
lines = [_("Connected")]
battery = self.get(tree_iter, "battery")["battery"]
rssi = self.get(tree_iter, "rssi")["rssi"]
tpl = self.get(tree_iter, "tpl")["tpl"]
if battery != 0:
if path[1] == self.columns["battery_pb"]:
lines.append(f"Battery: {int(battery)}%")
else:
lines.append(f"Battery: {int(battery)}%")
if rssi != 0:
if rssi < 30:
rssi_state = _("Poor")
elif rssi < 40:
rssi_state = _("Sub-optimal")
elif rssi < 60:
rssi_state = _("Optimal")
elif rssi < 70:
rssi_state = _("Much")
else:
rssi_state = _("Too much")
if path[1] == self.columns["rssi_pb"]:
lines.append(_("Received Signal Strength: %(rssi)u%% (%(rssi_state)s)") %
{"rssi": rssi, "rssi_state": rssi_state})
else:
lines.append(_("Received Signal Strength: %(rssi)u%% (%(rssi_state)s)") %
{"rssi": rssi, "rssi_state": rssi_state})
if tpl != 0:
if tpl < 30:
tpl_state = _("Low")
elif tpl < 40:
tpl_state = _("Sub-optimal")
elif tpl < 60:
tpl_state = _("Optimal")
elif tpl < 70:
tpl_state = _("High")
else:
tpl_state = _("Very High")
if path[1] == self.columns["tpl_pb"]:
lines.append(_("Transmit Power Level: %(tpl)u%% (%(tpl_state)s)") %
{"tpl": tpl, "tpl_state": tpl_state})
else:
lines.append(_("Transmit Power Level: %(tpl)u%% (%(tpl_state)s)") %
{"tpl": tpl, "tpl_state": tpl_state})
tooltip.set_markup("\n".join(lines))
self.tooltip_row = path[0]
self.tooltip_col = path[1]
return True
return False
def _has_objpush(self, device: Device) -> bool:
if device is None:
return False
for uuid in device["UUIDs"]:
if ServiceUUID(uuid).short_uuid == OBEX_OBJPUSH_SVCLASS_ID:
return True
return False
def _set_cell_data(self, _col: Gtk.TreeViewColumn, cell: Gtk.CellRenderer, model: Gtk.TreeModelFilter,
tree_iter: Gtk.TreeIter, data: Optional[str]) -> None:
tree_iter = model.convert_iter_to_child_iter(tree_iter)
if data is None:
row = self.get(tree_iter, "device_surface")
cell.set_property("surface", row["device_surface"].surface)
else:
window = self.get_window()
scale = self.get_scale_factor()
pb = self.get(tree_iter, data + "_pb")[data + "_pb"]
if pb:
surface = Gdk.cairo_surface_create_from_pixbuf(pb, scale, window)
cell.set_property("surface", surface)
else:
cell.set_property("surface", None)
blueman-2.4.3/blueman/gui/manager/ManagerDeviceMenu.py 0000664 0000000 0000000 00000043624 14650545052 0022674 0 ustar 00root root 0000000 0000000 import logging
from enum import Enum, auto
from gettext import gettext as _
from operator import attrgetter
from typing import Dict, List, Tuple, Optional, TYPE_CHECKING, Union, Iterable
from blueman.Functions import create_menuitem, e_
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Network import AnyNetwork
from blueman.bluez.Device import AnyDevice, Device
from blueman.config.AutoConnectConfig import AutoConnectConfig
from blueman.gui.manager.ManagerProgressbar import ManagerProgressbar
from blueman.main.Builder import Builder
from blueman.main.DBusProxies import AppletService, DBusProxyFailed
from blueman.Sdp import (
ServiceUUID,
AUDIO_SOURCE_SVCLASS_ID,
AUDIO_SINK_SVCLASS_ID,
HANDSFREE_AGW_SVCLASS_ID,
HANDSFREE_SVCLASS_ID,
HEADSET_SVCLASS_ID,
HID_SVCLASS_ID)
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
gi.require_version("Gdk", "3.0")
from gi.repository import Gdk
from gi.repository import GLib
if TYPE_CHECKING:
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
from blueman.main.Manager import Blueman
class DeviceMenuItem:
class Group(Enum):
CONNECT = auto()
DISCONNECT = auto()
AUTOCONNECT = auto()
ACTIONS = auto()
def __init__(self, item: Gtk.MenuItem, group: Group, position: int):
self.item = item
self.group = group
self.position = position
class MenuItemsProvider:
def on_request_menu_items(
self,
_manager_menu:
"ManagerDeviceMenu",
_device: Device,
_powered: bool,
) -> List[DeviceMenuItem]:
return []
class ManagerDeviceMenu(Gtk.Menu):
__ops__: Dict[str, str] = {}
__instances__: List["ManagerDeviceMenu"] = []
SelectedDevice: Device
def __init__(self, blueman: "Blueman") -> None:
super().__init__()
self.set_name("ManagerDeviceMenu")
self.Blueman = blueman
self.is_popup = False
self._device_property_changed_signal = self.Blueman.List.connect("device-property-changed",
self.on_device_property_changed)
ManagerDeviceMenu.__instances__.append(self)
self._any_network = AnyNetwork()
self._any_network.connect_signal('property-changed', self._on_service_property_changed)
self._any_device = AnyDevice()
self._any_device.connect_signal('property-changed', self._on_service_property_changed)
try:
self._appl: Optional[AppletService] = AppletService()
except DBusProxyFailed:
logging.error("** Failed to connect to applet", exc_info=True)
self._appl = None
self.generate()
def __del__(self) -> None:
logging.debug("deleting devicemenu")
def popup_at_pointer(self, event: Optional[Gdk.Event]) -> None:
self.is_popup = True
self.generate()
super().popup_at_pointer(event)
def clear(self) -> None:
def remove_and_destroy(child: Gtk.Widget) -> None:
self.remove(child)
child.destroy()
self.foreach(remove_and_destroy)
def set_op(self, device: Device, message: str) -> None:
ManagerDeviceMenu.__ops__[device.get_object_path()] = message
for inst in ManagerDeviceMenu.__instances__:
logging.info(f"op: regenerating instance {inst}")
if inst.SelectedDevice == self.SelectedDevice and not (inst.is_popup and not inst.props.visible):
inst.generate()
def get_op(self, device: Device) -> Optional[str]:
try:
return ManagerDeviceMenu.__ops__[device.get_object_path()]
except KeyError:
return None
def unset_op(self, device: Device) -> None:
del ManagerDeviceMenu.__ops__[device.get_object_path()]
for inst in ManagerDeviceMenu.__instances__:
logging.info(f"op: regenerating instance {inst}")
if inst.SelectedDevice == self.SelectedDevice and not (inst.is_popup and not inst.props.visible):
inst.generate()
def _on_service_property_changed(self, _service: Union[AnyNetwork, AnyDevice], key: str, _value: object,
_path: str) -> None:
if key == "Connected":
self.generate()
GENERIC_CONNECT = "00000000-0000-0000-0000-000000000000"
def connect_service(self, device: Device, uuid: str = GENERIC_CONNECT) -> None:
def success(_obj: AppletService, _result: None, _user_data: None) -> None:
logging.info("success")
prog.message(_("Success!"))
self.unset_op(device)
def fail(_obj: Optional[AppletService], result: GLib.Error, _user_data: None) -> None:
prog.message(_("Failed"))
self.unset_op(device)
logging.warning(f"fail {result}")
self._handle_error_message(result)
self.set_op(device, _("Connecting…"))
prog = ManagerProgressbar(self.Blueman, cancellable=uuid == self.GENERIC_CONNECT)
if uuid == self.GENERIC_CONNECT:
prog.connect("cancelled", lambda x: self.disconnect_service(device))
if self._appl is None:
fail(None, GLib.Error('Applet DBus Service not available'), None)
return
self._appl.ConnectService('(os)', device.get_object_path(), uuid,
result_handler=success, error_handler=fail,
timeout=GLib.MAXINT)
prog.start()
def disconnect_service(self, device: Device, uuid: str = GENERIC_CONNECT, port: int = 0) -> None:
def ok(_obj: AppletService, _result: None, _user_date: None) -> None:
logging.info("disconnect success")
self.generate()
def err(_obj: Optional[AppletService], result: GLib.Error, _user_date: None) -> None:
logging.warning(f"disconnect failed {result}")
msg, tb = e_(result.message)
self.Blueman.infobar_update(_("Disconnection Failed: ") + msg, bt=tb)
self.generate()
if self._appl is None:
err(None, GLib.Error('Applet DBus Service not available'), None)
return
self._appl.DisconnectService('(osd)', device.get_object_path(), uuid, port,
result_handler=ok, error_handler=err, timeout=GLib.MAXINT)
def on_device_property_changed(self, lst: "ManagerDeviceList", _device: Device, tree_iter: Gtk.TreeIter,
key_value: Tuple[str, object]) -> None:
key, value = key_value
# print "menu:", key, value
if lst.compare(tree_iter, lst.selected()):
if key in ("Connected", "UUIDs", "Trusted", "Paired", "Blocked"):
self.generate()
def _handle_error_message(self, error: GLib.Error) -> None:
err = self._BLUEZ_ERROR_MAP.get(error.message.split(":", 3)[-1].strip())
if err == self._BluezError.PROFILE_UNAVAILABLE:
logging.warning("No audio endpoints registered to bluetoothd. "
"Pulseaudio Bluetooth module, bluez-alsa, PipeWire or other audio support missing.")
msg = _("No audio endpoints registered")
elif err == self._BluezError.CREATE_SOCKET:
logging.warning("bluetoothd reported input/output error. Check its logs for context.")
msg = _("Input/output error")
elif err == self._BluezError.PAGE_TIMEOUT:
msg = _("Device did not respond")
elif err == self._BluezError.UNKNOWN:
logging.warning("bluetoothd reported an unknown error. "
"Retry or check its logs for context.")
msg = _("Unknown error")
else:
msg = error.message.split(":", 3)[-1].strip()
if err != self._BluezError.CANCELED:
self.Blueman.infobar_update(_("Connection Failed: ") + msg)
class _BluezError(Enum):
PAGE_TIMEOUT = auto()
PROFILE_UNAVAILABLE = auto()
CREATE_SOCKET = auto()
CANCELED = auto()
UNKNOWN = auto()
# BlueZ 5.62 introduced machine-readable error strings while earlier versions
# used strerror() so that the messages depend on the libc implementation:
# https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/gnu/errlist.h
# https://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h
# https://git.uclibc.org/uClibc/tree/libc/string/_string_syserrmsgs.c
_BLUEZ_ERROR_MAP = {
"Protocol not available": _BluezError.PROFILE_UNAVAILABLE,
"br-connection-profile-unavailable": _BluezError.PROFILE_UNAVAILABLE,
"Input/output error": _BluezError.CREATE_SOCKET,
"I/O error": _BluezError.CREATE_SOCKET,
"br-connection-create-socket": _BluezError.CREATE_SOCKET,
"le-connection-create-socket": _BluezError.CREATE_SOCKET,
"Host is down": _BluezError.PAGE_TIMEOUT,
"br-connection-page-timeout": _BluezError.PAGE_TIMEOUT,
"br-connection-unknown": _BluezError.UNKNOWN,
"Cancelled": _BluezError.CANCELED,
"br-connection-canceled": _BluezError.CANCELED,
}
def show_generic_connect_calc(self, device_uuids: Iterable[str]) -> bool:
# Generic (dis)connect
for uuid in device_uuids:
service_uuid = ServiceUUID(uuid)
if service_uuid.short_uuid in (
AUDIO_SOURCE_SVCLASS_ID, AUDIO_SINK_SVCLASS_ID, HANDSFREE_AGW_SVCLASS_ID, HANDSFREE_SVCLASS_ID,
HEADSET_SVCLASS_ID, HID_SVCLASS_ID, 0x1812
):
return True
elif not service_uuid.reserved:
if uuid == '03b80e5a-ede8-4b33-a751-6ce34ec4c700':
return True
# LE devices do not appear to expose certain properties like uuids until connect to at least once.
return not device_uuids
def generate(self) -> None:
self.clear()
if not self.is_popup or self.props.visible:
selected = self.Blueman.List.selected()
if not selected:
return
row = self.Blueman.List.get(selected, "alias", "paired", "connected", "trusted", "objpush", "device",
"blocked")
else:
(x, y) = self.Blueman.List.get_pointer()
posdata = self.Blueman.List.get_path_at_pos(x, y)
if posdata is None:
return
path = posdata[0]
if path is None:
raise TypeError("Path should never be None")
tree_iter = self.Blueman.List.filter.get_iter(path)
assert tree_iter is not None
child_iter = self.Blueman.List.filter.convert_iter_to_child_iter(tree_iter)
assert child_iter is not None
row = self.Blueman.List.get(child_iter, "alias", "paired", "connected", "trusted", "objpush", "device",
"blocked")
self.SelectedDevice = row["device"]
op = self.get_op(self.SelectedDevice)
if op is not None:
item: Gtk.MenuItem = create_menuitem(op, "network-transmit-receive-symbolic")
item.props.sensitive = False
item.show()
self.append(item)
return
show_generic_connect = self.show_generic_connect_calc(self.SelectedDevice['UUIDs'])
powered = Adapter(obj_path=self.SelectedDevice["Adapter"])["Powered"]
if not row["connected"] and show_generic_connect and powered:
connect_item = create_menuitem(_("_Connect"), "bluetooth-symbolic")
connect_item.connect("activate", lambda _item: self.connect_service(self.SelectedDevice))
connect_item.props.tooltip_text = _("Connects auto connect profiles A2DP source, A2DP sink, and HID")
connect_item.show()
self.append(connect_item)
elif row["connected"] and show_generic_connect:
connect_item = create_menuitem(_("_Disconnect"), "bluetooth-disabled-symbolic")
connect_item.props.tooltip_text = _("Forcefully disconnect the device")
connect_item.connect("activate", lambda _item: self.disconnect_service(self.SelectedDevice))
connect_item.show()
self.append(connect_item)
logging.debug(row["alias"])
items = [item for plugin in self.Blueman.Plugins.get_loaded_plugins(MenuItemsProvider)
for item in plugin.on_request_menu_items(self, self.SelectedDevice, powered)]
connect_items = [i for i in items if i.group == DeviceMenuItem.Group.CONNECT]
disconnect_items = [i for i in items if i.group == DeviceMenuItem.Group.DISCONNECT]
autoconnect_items = [item for item in items if item.group == DeviceMenuItem.Group.AUTOCONNECT]
action_items = [i for i in items if i.group == DeviceMenuItem.Group.ACTIONS]
if connect_items:
self.append(self._create_header(_("Connect To:")))
for it in sorted(connect_items, key=attrgetter("position")):
self.append(it.item)
if disconnect_items:
self.append(self._create_header(_("Disconnect:")))
for it in sorted(disconnect_items, key=attrgetter("position")):
self.append(it.item)
config = AutoConnectConfig()
generic_service = ServiceUUID("00000000-0000-0000-0000-000000000000")
object_path = self.SelectedDevice.get_object_path()
generic_autoconnect = (object_path, str(generic_service)) in set(config["services"])
if row["connected"] or generic_autoconnect or autoconnect_items:
self.append(self._create_header(_("Auto-connect:")))
if row["connected"] or generic_autoconnect:
item = Gtk.CheckMenuItem(label=generic_service.name)
config.bind_to_menuitem(item, (object_path, str(generic_service)))
item.show()
self.append(item)
for it in sorted(autoconnect_items, key=attrgetter("position")):
self.append(it.item)
if (powered and show_generic_connect) or connect_items or disconnect_items or autoconnect_items:
item = Gtk.SeparatorMenuItem()
item.show()
self.append(item)
for it in sorted(action_items, key=attrgetter("position")):
self.append(it.item)
if powered:
send_item = create_menuitem(_("Send a _File…"), "blueman-send-symbolic")
send_item.props.sensitive = False
self.append(send_item)
send_item.show()
if row["objpush"]:
send_item.connect("activate", lambda x: self.Blueman.send(self.SelectedDevice))
send_item.props.sensitive = True
item = Gtk.SeparatorMenuItem()
item.show()
self.append(item)
item = create_menuitem(_("_Pair"), "blueman-pair-symbolic")
item.props.tooltip_text = _("Create pairing with the device")
self.append(item)
item.show()
if not row["paired"]:
item.connect("activate", lambda x: self.Blueman.bond(self.SelectedDevice))
else:
item.props.sensitive = False
if not row["trusted"]:
item = create_menuitem(_("_Trust"), "blueman-trust-symbolic")
item.connect("activate", lambda x: self.Blueman.toggle_trust(self.SelectedDevice))
self.append(item)
item.show()
else:
item = create_menuitem(_("_Untrust"), "blueman-untrust-symbolic")
self.append(item)
item.connect("activate", lambda x: self.Blueman.toggle_trust(self.SelectedDevice))
item.show()
item.props.tooltip_text = _("Mark/Unmark this device as trusted")
if not row["blocked"]:
item = create_menuitem(_("_Block"), "blueman-block-symbolic")
item.connect("activate", lambda x: self.Blueman.toggle_blocked(self.SelectedDevice))
self.append(item)
item.show()
else:
item = create_menuitem(_("_Unblock"), "blueman-block-symbolic")
self.append(item)
item.connect("activate", lambda x: self.Blueman.toggle_blocked(self.SelectedDevice))
item.show()
item.props.tooltip_text = _("Block/Unblock this device")
def on_rename(_item: Gtk.MenuItem, device: Device) -> None:
def on_response(dialog: Gtk.Dialog, response_id: int) -> None:
if response_id == Gtk.ResponseType.ACCEPT:
assert isinstance(alias_entry, Gtk.Entry) # https://github.com/python/mypy/issues/2608
device.set('Alias', alias_entry.get_text())
elif response_id == 1:
device.set('Alias', '')
dialog.destroy()
builder = Builder("rename-device.ui")
dialog = builder.get_widget("dialog", Gtk.Dialog)
dialog.set_transient_for(self.Blueman.window)
dialog.props.icon_name = "blueman"
alias_entry = builder.get_widget("alias_entry", Gtk.Entry)
alias_entry.set_text(device['Alias'])
dialog.connect("response", on_response)
dialog.present()
item = Gtk.MenuItem.new_with_mnemonic(_("R_ename device…"))
item.connect('activate', on_rename, self.SelectedDevice)
self.append(item)
item.show()
item = Gtk.SeparatorMenuItem()
item.show()
self.append(item)
item = create_menuitem(_("_Remove…"), "list-remove-symbolic")
item.connect("activate", lambda x: self.Blueman.remove(self.SelectedDevice))
self.append(item)
item.show()
item.props.tooltip_text = _("Remove this device from the known devices list")
@staticmethod
def _create_header(text: str) -> Gtk.MenuItem:
item = Gtk.MenuItem()
label = Gtk.Label()
label.set_markup(text)
label.props.xalign = 0.0
label.show()
item.add(label)
item.props.sensitive = False
item.show()
return item
blueman-2.4.3/blueman/gui/manager/ManagerMenu.py 0000664 0000000 0000000 00000023513 14650545052 0021547 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import Dict, Tuple, TYPE_CHECKING, Any, Optional, Sequence
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Device import Device
from blueman.bluez.Manager import Manager
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
from blueman.gui.manager.ManagerDeviceMenu import ManagerDeviceMenu
from blueman.gui.CommonUi import show_about_dialog
from blueman.Constants import WEBSITE
from blueman.Functions import launch, adapter_path_to_name
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import Gio
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class ManagerMenu:
def __init__(self, blueman: "Blueman"):
self.blueman = blueman
self.Config = Gio.Settings(schema_id="org.blueman.general")
self.adapter_items: Dict[str, Tuple[Gtk.RadioMenuItem, Adapter]] = {}
self._adapters_group: Sequence[Gtk.RadioMenuItem] = []
self._insert_adapter_item_pos = 2
self.item_adapter = self.blueman.builder.get_widget("item_adapter", Gtk.MenuItem)
self.item_device = self.blueman.builder.get_widget("item_device", Gtk.MenuItem)
self.item_view = self.blueman.builder.get_widget("item_view", Gtk.MenuItem)
self.item_help = self.blueman.builder.get_widget("item_help", Gtk.MenuItem)
report_item = blueman.builder.get_widget("report", Gtk.ImageMenuItem)
report_item.connect("activate", lambda x: launch(f"xdg-open {WEBSITE}/issues"))
help_item = blueman.builder.get_widget("help", Gtk.ImageMenuItem)
assert self.blueman.window is not None
widget = self.blueman.window.get_toplevel()
assert isinstance(widget, Gtk.Window)
window = widget
help_item.connect("activate", lambda x: show_about_dialog('Blueman ' + _('Device Manager'), parent=window))
item_toolbar = blueman.builder.get_widget("show_tb_item", Gtk.CheckMenuItem)
self.blueman.Config.bind("show-toolbar", item_toolbar, "active", Gio.SettingsBindFlags.DEFAULT)
item_statusbar = blueman.builder.get_widget("show_sb_item", Gtk.CheckMenuItem)
self.blueman.Config.bind("show-statusbar", item_statusbar, "active", Gio.SettingsBindFlags.DEFAULT)
item_unnamed = blueman.builder.get_widget("hide_unnamed_item", Gtk.CheckMenuItem)
self.blueman.Config.bind("hide-unnamed", item_unnamed, "active", Gio.SettingsBindFlags.DEFAULT)
self.device_menu: Optional[ManagerDeviceMenu] = None
self._sort_alias_item = blueman.builder.get_widget("sort_name_item", Gtk.CheckMenuItem)
self._sort_timestamp_item = blueman.builder.get_widget("sort_added_item", Gtk.CheckMenuItem)
sort_config = self.Config['sort-by']
if sort_config == "alias":
self._sort_alias_item.props.active = True
else:
self._sort_timestamp_item.props.active = True
self._sort_type_item = blueman.builder.get_widget("sort_descending_item", Gtk.CheckMenuItem)
if self.Config['sort-order'] == "ascending":
self._sort_type_item.props.active = False
else:
self._sort_type_item.props.active = True
item_plugins = blueman.builder.get_widget("plugins_item", Gtk.ImageMenuItem)
item_plugins.connect('activate', self._on_plugin_dialog_activate)
item_services = blueman.builder.get_widget("services_item", Gtk.ImageMenuItem)
item_services.connect('activate', lambda *args: launch("blueman-services", name=_("Service Preferences")))
self.Search = search_item = blueman.builder.get_widget("search_item", Gtk.ImageMenuItem)
search_item.connect("activate", lambda x: self.blueman.inquiry())
self._adapter_settings = blueman.builder.get_widget("prefs_item", Gtk.ImageMenuItem)
self._adapter_settings.connect("activate", lambda x: self.blueman.adapter_properties())
exit_item = blueman.builder.get_widget("exit_item", Gtk.ImageMenuItem)
exit_item.connect("activate", lambda x: self.blueman.quit())
self._manager = Manager()
self._manager.connect_signal("adapter-added", self.on_adapter_added)
self._manager.connect_signal("adapter-removed", self.on_adapter_removed)
blueman.List.connect("device-selected", self.on_device_selected)
for adapter in self._manager.get_adapters():
self.on_adapter_added(None, adapter.get_object_path())
self.Config.connect("changed", self._on_settings_changed)
self._sort_alias_item.connect("activate", self._on_sorting_changed, "alias")
self._sort_timestamp_item.connect("activate", self._on_sorting_changed, "timestamp")
self._sort_type_item.connect("activate", self._on_sorting_changed, "sort-type")
def _on_sorting_changed(self, btn: Gtk.CheckMenuItem, sort_opt: str) -> None:
if sort_opt == 'alias' and btn.props.active:
self.Config['sort-by'] = "alias"
elif sort_opt == "timestamp" and btn.props.active:
self.Config['sort-by'] = "timestamp"
elif sort_opt == 'sort-type':
# FIXME bind widget to gsetting
if btn.props.active:
self.Config["sort-order"] = "descending"
else:
self.Config["sort-order"] = "ascending"
def _on_settings_changed(self, settings: Gio.Settings, key: str) -> None:
value = settings[key]
if key == 'sort-by':
if value == "alias":
if not self._sort_alias_item.props.active:
self._sort_alias_item.props.active = True
elif value == "timestamp":
if not self._sort_timestamp_item.props.active:
self._sort_timestamp_item.props.active = True
elif key == "sort-type":
if value == "ascending":
if not self._sort_type_item.props.active:
self._sort_type_item.props.active = True
else:
if not self._sort_type_item.props.active:
self._sort_type_item.props.active = False
elif key == "hide-unnamed":
logging.debug("refilter")
self.blueman.List.filter.refilter()
def on_device_selected(self, _lst: ManagerDeviceList, device: Optional[Device], tree_iter: Gtk.TreeIter) -> None:
if tree_iter and device:
self.item_device.props.sensitive = True
if self.device_menu is None:
self.device_menu = ManagerDeviceMenu(self.blueman)
self.item_device.set_submenu(self.device_menu)
else:
def idle() -> bool:
assert self.device_menu is not None # https://github.com/python/mypy/issues/2608
self.device_menu.generate()
return False
GLib.idle_add(idle, priority=GLib.PRIORITY_LOW)
else:
self.item_device.props.sensitive = False
def on_adapter_property_changed(self, _adapter: Adapter, name: str, value: Any, path: str) -> None:
if name == "Name" or name == "Alias":
item = self.adapter_items[path][0]
item.set_label(value)
elif name == "Discovering":
if self.Search:
if value:
self.Search.props.sensitive = False
else:
self.Search.props.sensitive = True
elif name == "Powered":
self._update_power()
def on_adapter_selected(self, menuitem: Gtk.CheckMenuItem, adapter_path: str) -> None:
if menuitem.props.active:
assert self.blueman.List.Adapter is not None
if adapter_path != self.blueman.List.Adapter.get_object_path():
logging.info(f"selected {adapter_path}")
self.blueman.Config["last-adapter"] = adapter_path_to_name(adapter_path)
self.blueman.List.set_adapter(adapter_path)
def on_adapter_added(self, _manager: Optional[Manager], adapter_path: str) -> None:
adapter = Adapter(obj_path=adapter_path)
menu = self.item_adapter.get_submenu()
assert isinstance(menu, Gtk.Menu)
item = Gtk.RadioMenuItem.new_with_label(self._adapters_group, adapter.get_name())
item.show()
self._adapters_group = item.get_group()
self._itemhandler = item.connect("activate", self.on_adapter_selected, adapter_path)
self._adapterhandler = adapter.connect_signal("property-changed", self.on_adapter_property_changed)
menu.insert(item, self._insert_adapter_item_pos)
self._insert_adapter_item_pos += 1
self.adapter_items[adapter_path] = (item, adapter)
assert self.blueman.List.Adapter is not None
if adapter_path == self.blueman.List.Adapter.get_object_path():
item.props.active = True
self._update_power()
def on_adapter_removed(self, _manager: Manager, adapter_path: str) -> None:
item, adapter = self.adapter_items.pop(adapter_path)
menu = self.item_adapter.get_submenu()
assert isinstance(menu, Gtk.Menu)
item.disconnect(self._itemhandler)
adapter.disconnect(self._adapterhandler)
menu.remove(item)
self._insert_adapter_item_pos -= 1
self._update_power()
def _update_power(self) -> None:
if self.device_menu is not None:
self.device_menu.generate()
if any(adapter["Powered"] for (_, adapter) in self.adapter_items.values()):
self.Search.props.visible = True
self._adapter_settings.props.visible = True
else:
self.Search.props.visible = False
self._adapter_settings.props.visible = False
def _on_plugin_dialog_activate(self, _item: Gtk.MenuItem) -> None:
def cb(_proxy: Gio.DBusProxy, _res: Any, _userdata: Any) -> None:
pass
self.blueman.Applet.OpenPluginDialog(result_handler=cb)
blueman-2.4.3/blueman/gui/manager/ManagerProgressbar.py 0000664 0000000 0000000 00000013756 14650545052 0023144 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import List, TYPE_CHECKING, Callable
import gi
from blueman.bluemantyping import GSignals
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Pango
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class ManagerProgressbar(GObject.GObject):
__gsignals__: GSignals = {
'cancelled': (GObject.SignalFlags.RUN_LAST, None, ()),
}
__instances__: List["ManagerProgressbar"] = []
def __init__(self, blueman: "Blueman", cancellable: bool = True, text: str = _("Connecting")) -> None:
super().__init__()
self.Blueman = blueman
self.cancellable = cancellable
self.hbox = hbox = blueman.builder.get_widget("status_data", Gtk.Box)
self.progressbar = Gtk.ProgressBar()
self.progressbar.set_name("ManagerProgressbar")
self._signals: List[int] = []
self.button = Gtk.Image(icon_name="process-stop", pixel_size=16)
self.eventbox = eventbox = Gtk.EventBox()
eventbox.add(self.button)
eventbox.props.tooltip_text = _("Cancel Operation")
eventbox.connect("enter-notify-event", self._on_enter)
eventbox.connect("leave-notify-event", self._on_leave)
eventbox.connect("button-press-event", self._on_clicked)
self.progressbar.set_size_request(100, 15)
self.progressbar.set_ellipsize(Pango.EllipsizeMode.END)
self.progressbar.set_text(text)
self.progressbar.set_show_text(True)
self.progressbar.set_pulse_step(0.05)
hbox.pack_end(eventbox, True, False, 5)
hbox.pack_end(self.progressbar, False, False, 5)
if ManagerProgressbar.__instances__:
logging.info(f"hiding {ManagerProgressbar.__instances__[-1]}")
ManagerProgressbar.__instances__[-1].hide()
self.show()
if not self.cancellable:
self.eventbox.props.sensitive = False
self.pulsing = False
self.finalized = False
ManagerProgressbar.__instances__.append(self)
def _get_window(self) -> Gdk.Window:
assert self.Blueman.window is not None
window = self.Blueman.window.get_window()
assert window is not None
return window
def _on_enter(self, _evbox: Gtk.EventBox, _event: Gdk.Event) -> bool:
c = Gdk.Cursor.new(Gdk.CursorType.HAND2)
self._get_window().set_cursor(c)
return False
def _on_leave(self, _evbox: Gtk.EventBox, _event: Gdk.Event) -> bool:
assert self.Blueman.window is not None
self._get_window().set_cursor(None)
return False
def _on_clicked(self, _evbox: Gtk.EventBox, _event: Gdk.Event) -> bool:
self.eventbox.props.sensitive = False
self.emit("cancelled")
return False
def connect(self, signal: str, callback: Callable[..., None], *args: object) -> int:
handler_id: int = super().connect(signal, callback, *args)
self._signals.append(handler_id)
return handler_id
def show(self) -> None:
if not self.Blueman.Config["show-statusbar"]:
statusbar = self.Blueman.builder.get_widget("statusbar", Gtk.Box)
statusbar.props.visible = True
self.progressbar.props.visible = True
self.eventbox.props.visible = True
self.button.props.visible = True
def hide(self) -> None:
self.Blueman.Stats.hbox.show_all()
self.progressbar.props.visible = False
self.eventbox.props.visible = False
self.button.props.visible = False
def message(self, msg: str, timeout: int = 1500) -> None:
self.stop()
self.set_label(msg)
self.set_cancellable(False)
GLib.timeout_add(timeout, self.finalize)
def finalize(self) -> bool:
if not self.finalized:
self.hide()
self.stop()
self._get_window().set_cursor(None)
self.hbox.remove(self.eventbox)
self.hbox.remove(self.progressbar)
# self.hbox.remove(self.separator)
self.finalized = True
if ManagerProgressbar.__instances__[-1] == self:
ManagerProgressbar.__instances__.pop()
# remove all finalized instances
for inst in reversed(ManagerProgressbar.__instances__):
if inst.finalized:
ManagerProgressbar.__instances__.pop()
else:
# show last active progress bar
inst.show()
break
if not ManagerProgressbar.__instances__:
if not self.Blueman.Config["show-statusbar"]:
statusbar = self.Blueman.builder.get_widget("statusbar", Gtk.Box)
statusbar.props.visible = False
for sig in self._signals:
if self.handler_is_connected(sig):
self.disconnect(sig)
self._signals = []
return False
def set_cancellable(self, b: bool, hide: bool = False) -> None:
if b:
self.eventbox.props.visible = True
self.eventbox.props.sensitive = True
else:
if hide:
self.eventbox.props.visible = False
else:
self.eventbox.props.sensitive = False
def set_label(self, label: str) -> None:
self.progressbar.props.text = label
def fraction(self, frac: float) -> None:
if not self.finalized:
self.progressbar.set_fraction(frac)
def started(self) -> bool:
return self.pulsing
def start(self) -> None:
def pulse() -> bool:
self.progressbar.pulse()
return self.pulsing
if not self.pulsing:
self.pulsing = True
GLib.timeout_add(41, pulse)
def stop(self) -> None:
self.pulsing = False
self.progressbar.set_fraction(0.0)
blueman-2.4.3/blueman/gui/manager/ManagerStats.py 0000664 0000000 0000000 00000007760 14650545052 0021747 0 ustar 00root root 0000000 0000000 from typing import TYPE_CHECKING, Optional
from _blueman import device_info
from gi.repository import GLib
from gi.repository import Gtk
from blueman.gui.Animation import Animation
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
from blueman.main.SpeedCalc import SpeedCalc
from blueman.Functions import adapter_path_to_name
from blueman.Functions import format_bytes
import gettext
_ = gettext.gettext
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class ManagerStats:
hbox: Gtk.Box
def __init__(self, blueman: "Blueman") -> None:
blueman.List.connect("adapter-changed", self.on_adapter_changed)
self.hci = (
None
if blueman.List.Adapter is None
else adapter_path_to_name(blueman.List.Adapter.get_object_path())
)
self.time = None
self.up_speed = SpeedCalc()
self.down_speed = SpeedCalc()
self.im_upload = blueman.builder.get_widget("im_upload", Gtk.Image)
self.im_download = blueman.builder.get_widget("im_download", Gtk.Image)
self.down_rate = blueman.builder.get_widget("label_down_rate", Gtk.Label)
self.up_rate = blueman.builder.get_widget("label_up_rate", Gtk.Label)
self.hbox = blueman.builder.get_widget("status_activity", Gtk.Box)
self.on_adapter_changed(blueman.List, blueman.List.get_adapter_path())
self.up_blinker = Animation(self.im_upload, ["blueman-up-inactive", "blueman-up-active"])
self.down_blinker = Animation(self.im_download, ["blueman-down-inactive", "blueman-down-active"])
self.start_update()
def on_adapter_changed(self, _lst: ManagerDeviceList, adapter_path: Optional[str]) -> None:
self.hci = adapter_path_to_name(adapter_path)
if self.hci is None:
self.hbox.props.sensitive = False
else:
self.hbox.props.sensitive = True
self.up_speed.reset()
self.down_speed.reset()
def set_blinker_by_speed(self, blinker: Animation, speed: float) -> None:
if speed > 0 and not blinker.status():
blinker.start()
if speed > 40 * 1024 and blinker.status():
blinker.set_rate(10)
elif speed > (30 * 1024) and blinker.status():
blinker.set_rate(8)
elif speed > (20 * 1024) and blinker.status():
blinker.set_rate(6)
elif speed > (10 * 1024) and blinker.status():
blinker.set_rate(4)
elif speed > 1024 and blinker.status():
blinker.set_rate(2)
elif speed == 0 and blinker.status():
blinker.stop()
else:
blinker.set_rate(1)
def _update(self) -> bool:
if self.hci is not None:
devinfo = device_info(self.hci)
_tx = devinfo["stat"]["byte_tx"]
_rx = devinfo["stat"]["byte_rx"]
tx, s_tx = format_bytes(_tx)
rx, s_rx = format_bytes(_rx)
_u_speed = self.up_speed.calc(_tx)
_d_speed = self.down_speed.calc(_rx)
self.set_blinker_by_speed(self.up_blinker, _u_speed)
self.set_blinker_by_speed(self.down_blinker, _d_speed)
u_speed, s_u_speed = format_bytes(_u_speed)
d_speed, s_d_speed = format_bytes(_d_speed)
self.set_data(tx, s_tx, rx, s_rx, u_speed, s_u_speed, d_speed, s_d_speed)
return True
def start_update(self) -> None:
self._update()
self.timer = GLib.timeout_add(1000, self._update)
def stop_update(self) -> None:
if self.timer:
GLib.source_remove(self.timer)
def set_data(self, uploaded: float, u_name: str, downloaded: float, d_name: str, u_speed: float, us_name: str,
d_speed: float, ds_name: str) -> None:
self.down_rate.set_markup(
f'{downloaded:.2f} {d_name} {d_speed:5.2f} {ds_name}/s')
self.up_rate.set_markup(
f'{uploaded:.2f} {u_name} {u_speed:5.2f} {us_name}/s')
blueman-2.4.3/blueman/gui/manager/ManagerToolbar.py 0000664 0000000 0000000 00000011107 14650545052 0022241 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import TYPE_CHECKING, Callable, Tuple, Optional
import gi
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Device import Device
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class ManagerToolbar:
def __init__(self, blueman: "Blueman") -> None:
self.blueman = blueman
self.blueman.List.connect("device-selected", self.on_device_selected)
self.blueman.List.connect("device-property-changed", self.on_device_propery_changed)
self.blueman.List.connect("adapter-changed", self.on_adapter_changed)
self.blueman.List.connect("adapter-property-changed", self.on_adapter_property_changed)
self.b_search = blueman.builder.get_widget("b_search", Gtk.ToolButton)
self.b_search.connect("clicked", lambda button: blueman.inquiry())
self.b_bond = blueman.builder.get_widget("b_bond", Gtk.ToolButton)
self.b_bond.connect("clicked", self.on_action, self.blueman.bond)
self.b_trust = blueman.builder.get_widget("b_trust", Gtk.ToolButton)
self.b_trust.connect("clicked", self.on_action, self.blueman.toggle_trust)
self.b_trust.set_homogeneous(False)
self.b_trust.props.label = _("Untrust")
(size, nsize) = Gtk.Widget.get_preferred_size(self.b_trust)
self.b_trust.props.label = _("Trust")
(size2, nsize2) = Gtk.Widget.get_preferred_size(self.b_trust)
self.b_trust.props.width_request = max(size.width, size2.width)
self.b_remove = blueman.builder.get_widget("b_remove", Gtk.ToolButton)
self.b_remove.connect("clicked", self.on_action, self.blueman.remove)
self.b_send = blueman.builder.get_widget("b_send", Gtk.ToolButton)
self.b_send.props.sensitive = False
self.b_send.connect("clicked", self.on_action, self.blueman.send)
self.b_send.set_homogeneous(False)
self.on_adapter_changed(blueman.List, blueman.List.get_adapter_path())
def on_action(self, _button: Gtk.ToolButton, func: Callable[[Device], None]) -> None:
device = self.blueman.List.get_selected_device()
if device is not None:
func(device)
def on_adapter_property_changed(self, _lst: ManagerDeviceList, adapter: Adapter,
key_value: Tuple[str, object]) -> None:
key, value = key_value
if key == "Discovering" or key == "Powered":
self._update_buttons(adapter)
def on_adapter_changed(self, _lst: ManagerDeviceList, adapter_path: Optional[str]) -> None:
logging.debug(f"toolbar adapter {adapter_path}")
self._update_buttons(None if adapter_path is None else Adapter(obj_path=adapter_path))
def on_device_selected(
self,
dev_list: ManagerDeviceList,
device: Optional[Device],
_tree_iter: Gtk.TreeIter,
) -> None:
self._update_buttons(None if device is None else Adapter(obj_path=device["Adapter"]))
def _update_buttons(self, adapter: Optional[Adapter]) -> None:
powered = adapter is not None and adapter["Powered"]
self.b_search.props.sensitive = powered and not (adapter and adapter["Discovering"])
tree_iter = self.blueman.List.selected()
if tree_iter is None:
self.b_bond.props.sensitive = False
self.b_trust.props.sensitive = False
self.b_remove.props.sensitive = False
self.b_send.props.sensitive = False
else:
row = self.blueman.List.get(tree_iter, "paired", "trusted", "objpush")
self.b_bond.props.sensitive = powered and not row["paired"]
self.b_trust.props.sensitive = True
self.b_remove.props.sensitive = True
self.b_send.props.sensitive = powered and row["objpush"]
icon_name = "blueman-untrust-symbolic" if row["trusted"] else "blueman-trust-symbolic"
self.b_trust.props.icon_widget = Gtk.Image(icon_name=icon_name, pixel_size=24, visible=True)
self.b_trust.props.label = _("Untrust") if row["trusted"] else _("Trust")
def on_device_propery_changed(self, dev_list: ManagerDeviceList, device: Device, tree_iter: Gtk.TreeIter,
key_value: Tuple[str, object]) -> None:
key, value = key_value
if dev_list.compare(tree_iter, dev_list.selected()):
if key == "Trusted" or key == "Paired" or key == "UUIDs":
self.on_device_selected(dev_list, device, tree_iter)
blueman-2.4.3/blueman/gui/manager/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0021071 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/ 0000775 0000000 0000000 00000000000 14650545052 0015520 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/Adapter.py 0000664 0000000 0000000 00000022145 14650545052 0017456 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import os.path
import logging
import gettext
import signal
from typing import Dict, TypedDict, Optional, Any
from blueman.Functions import *
from blueman.bluez.Manager import Manager
from blueman.bluez.Adapter import Adapter
from blueman.main.Builder import Builder
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
gi.require_version("Pango", "1.0")
from gi.repository import Gtk, Gio, Gdk, GLib
from gi.repository import Pango
class Tab(TypedDict):
grid: Gtk.Grid
hidden_radio: Gtk.RadioButton
always_radio: Gtk.RadioButton
temparary_radio: Gtk.RadioButton
visible: bool
label: Gtk.Label
name_entry: Gtk.Entry
class BluemanAdapters(Gtk.Application):
def __init__(self, selected_hci_dev: Optional[str], socket_id: Optional[int]) -> None:
super().__init__(application_id="org.blueman.Adapters")
def do_quit(_: object) -> bool:
self.quit()
return False
s = GLib.unix_signal_source_new(signal.SIGINT)
s.set_callback(do_quit)
s.attach()
self.socket_id = socket_id
self.selected_hci_dev = selected_hci_dev
self.notebook = Gtk.Notebook(visible=True)
self.window: Optional[Gtk.ApplicationWindow] = None
self.tabs: Dict[str, "Tab"] = {}
self._adapters: Dict[str, Adapter] = {}
setup_icon_path()
Manager.watch_name_owner(self._on_dbus_name_appeared, self._on_dbus_name_vanished)
self.manager = Manager()
check_bluetooth_status(_("Bluetooth needs to be turned on for the adapter manager to work"), bmexit)
adapters = self.manager.get_adapters()
if not adapters:
logging.error('No adapter(s) found')
bmexit()
self.manager.connect_signal('adapter-added', self.on_adapter_added)
self.manager.connect_signal('adapter-removed', self.on_adapter_removed)
for adapter in adapters:
path = adapter.get_object_path()
self.on_adapter_added(self.manager, path)
# activate a particular tab according to command line option
if selected_hci_dev is not None:
if selected_hci_dev in self.tabs:
hci_dev_num = int(selected_hci_dev[3:])
self.notebook.set_current_page(hci_dev_num)
else:
logging.error('Error: the selected adapter does not exist')
self.notebook.show_all()
close_action = Gio.SimpleAction.new("quit", None)
close_action.connect("activate", lambda x, y: self.quit())
self.add_action(close_action)
def do_activate(self) -> None:
def app_release(_plug: Gtk.Plug, _event: Gdk.Event) -> bool:
self.release()
return False
if self.socket_id:
self.hold()
plug = Gtk.Plug.new(self.socket_id)
plug.show()
plug.connect('delete-event', app_release)
plug.add(self.notebook)
return
if not self.window:
self.window = Gtk.ApplicationWindow(application=self, title=_("Bluetooth Adapters"), border_width=10,
resizable=False, icon_name="blueman-device", name="BluemanAdapters")
self.window.add(self.notebook)
self.window.set_position(Gtk.WindowPosition.CENTER)
self.window.present_with_time(Gtk.get_current_event_time())
def do_startup(self) -> None:
Gtk.Application.do_startup(self)
self.set_accels_for_action("app.quit", ["w", "q", "Escape"])
def on_property_changed(self, _adapter: Adapter, name: str, value: Any, path: str) -> None:
hci_dev = os.path.basename(path)
if name == "Discoverable" and value == 0:
self.tabs[hci_dev]["hidden_radio"].set_active(True)
elif name == "Alias":
self.tabs[hci_dev]["label"].set_text(f"{value} ({hci_dev})")
self.tabs[hci_dev]["name_entry"].set_text(value)
def on_adapter_added(self, _manager: Manager, adapter_path: str) -> None:
hci_dev = os.path.basename(adapter_path)
if hci_dev not in self._adapters:
self._adapters[hci_dev] = Adapter(obj_path=adapter_path)
self._adapters[hci_dev].connect_signal("property-changed", self.on_property_changed)
self.add_to_notebook(self._adapters[hci_dev])
def on_adapter_removed(self, _manager: Manager, adapter_path: str) -> None:
hci_dev = os.path.basename(adapter_path)
self.remove_from_notebook(self._adapters[hci_dev])
def _on_dbus_name_appeared(self, _connection: Gio.DBusConnection, name: str, owner: str) -> None:
logging.info(f"{name} {owner}")
def _on_dbus_name_vanished(self, _connection: Gio.DBusConnection, name: str) -> None:
logging.info(name)
# FIXME: show error dialog and exit
def build_adapter_tab(self, adapter: Adapter) -> Tab:
def on_hidden_toggle(radio: Gtk.RadioButton) -> None:
if not radio.props.active:
return
adapter['DiscoverableTimeout'] = 0
adapter['Discoverable'] = False
hscale.set_sensitive(False)
def on_always_toggle(radio: Gtk.RadioButton) -> None:
if not radio.props.active:
return
adapter['DiscoverableTimeout'] = 0
adapter['Discoverable'] = True
hscale.set_sensitive(False)
def on_temporary_toggle(radio: Gtk.RadioButton) -> None:
if not radio.props.active:
return
adapter['Discoverable'] = True
hscale.set_sensitive(True)
hscale.set_value(3)
def on_scale_format_value(_scale: Gtk.Scale, value: float) -> str:
if value == 0:
if adapter['Discoverable']:
return _("Always")
else:
return _("Hidden")
else:
return gettext.ngettext("%(minutes)d Minute", "%(minutes)d Minutes", int(value)) % {"minutes": value}
def on_scale_value_changed(scale: Gtk.Scale) -> None:
val = scale.get_value()
logging.info(f"value: {val}")
if val == 0 and adapter['Discoverable']:
always_radio.props.active = True
timeout = int(val * 60)
adapter['DiscoverableTimeout'] = timeout
def on_name_changed(entry: Gtk.Entry) -> None:
adapter['Alias'] = entry.get_text()
builder = Builder("adapters-tab.ui")
hscale = builder.get_widget("hscale", Gtk.Scale)
hscale.connect("format-value", on_scale_format_value)
hscale.connect("value-changed", on_scale_value_changed)
hscale.set_range(0, 30)
hscale.set_increments(1, 1)
hidden_radio = builder.get_widget("hidden", Gtk.RadioButton)
always_radio = builder.get_widget("always", Gtk.RadioButton)
temporary_radio = builder.get_widget("temporary", Gtk.RadioButton)
if adapter['Discoverable'] and adapter['DiscoverableTimeout'] > 0:
temporary_radio.set_active(True)
hscale.set_value(adapter['DiscoverableTimeout'])
hscale.set_sensitive(True)
elif adapter['Discoverable'] and adapter['DiscoverableTimeout'] == 0:
always_radio.set_active(True)
else:
hidden_radio.set_active(True)
name_entry = builder.get_widget("name_entry", Gtk.Entry)
name_entry.set_text(adapter.get_name())
hidden_radio.connect("toggled", on_hidden_toggle)
always_radio.connect("toggled", on_always_toggle)
temporary_radio.connect("toggled", on_temporary_toggle)
name_entry.connect("changed", on_name_changed)
return Tab(
grid=builder.get_widget("grid", Gtk.Grid),
hidden_radio=hidden_radio,
always_radio=always_radio,
temparary_radio=temporary_radio,
visible=False,
label=Gtk.Label(),
name_entry=name_entry
)
def add_to_notebook(self, adapter: Adapter) -> None:
hci_dev = os.path.basename(adapter.get_object_path())
hci_dev_num = int(hci_dev[3:])
if hci_dev not in self.tabs:
self.tabs[hci_dev] = self.build_adapter_tab(adapter)
else:
if self.tabs[hci_dev]['visible']:
return
# might need to update settings at this point
ui = self.tabs[hci_dev]
ui['visible'] = True
name = f"{adapter.get_name()} ({hci_dev})"
if name == '':
name = _('Adapter') + ' %d' % (hci_dev_num + 1)
label = Gtk.Label(label=name)
ui['label'] = label
label.set_max_width_chars(20)
label.props.hexpand = True
label.set_ellipsize(Pango.EllipsizeMode.END)
self.notebook.insert_page(ui['grid'], label, hci_dev_num)
def remove_from_notebook(self, adapter: Adapter) -> None:
hci_dev = os.path.basename(adapter.get_object_path())
hci_dev_num = int(hci_dev[3:])
self.tabs[hci_dev]['visible'] = False
self.notebook.remove_page(hci_dev_num)
# leave actual tab contents intact in case adapter becomes present once again
blueman-2.4.3/blueman/main/Applet.py 0000664 0000000 0000000 00000013051 14650545052 0017317 0 ustar 00root root 0000000 0000000 import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gio, GLib, Gtk
import logging
import signal
from typing import Any, cast
from blueman.Functions import *
from blueman.bluez.Manager import Manager
from blueman.bluez.Adapter import AnyAdapter
from blueman.bluez.Device import AnyDevice
import blueman.plugins.applet
from blueman.main.PluginManager import PersistentPluginManager
from blueman.main.DbusService import DbusService
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.applet.DBusService import DBusService
from blueman.plugins.applet.Menu import Menu
from blueman.plugins.applet.PowerManager import PowerManager
from blueman.plugins.applet.RecentConns import RecentConns
from blueman.plugins.applet.StandardItems import StandardItems
from blueman.plugins.applet.StatusIcon import StatusIcon
class BluemanApplet(Gtk.Application):
def __init__(self) -> None:
super().__init__(application_id="org.blueman.Applet", flags=Gio.ApplicationFlags.FLAGS_NONE)
setup_icon_path()
def do_quit(_: object) -> bool:
self.quit()
return False
s = GLib.unix_signal_source_new(signal.SIGINT)
s.set_callback(do_quit)
s.attach()
self.plugin_run_state_changed = False
self.manager_state = False
self._active = False
self.Manager = Manager()
self.Manager.connect_signal('adapter-added', self.on_adapter_added)
self.Manager.connect_signal('adapter-removed', self.on_adapter_removed)
self.Manager.connect_signal('device-created', self.on_device_created)
self.Manager.connect_signal('device-removed', self.on_device_removed)
self.DbusSvc = DbusService("org.blueman.Applet", "org.blueman.Applet", "/org/blueman/Applet",
Gio.BusType.SESSION)
self.DbusSvc.register()
self.Plugins = Plugins(self)
self.Plugins.load_plugin()
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_plugins_loaded()
self.Manager.watch_name_owner(self._on_dbus_name_appeared, self._on_dbus_name_vanished)
self._any_adapter = AnyAdapter()
self._any_adapter.connect_signal('property-changed', self._on_adapter_property_changed)
self._any_device = AnyDevice()
self._any_device.connect_signal('property-changed', self._on_device_property_changed)
def do_startup(self) -> None:
Gtk.Application.do_startup(self)
self.set_accels_for_action("win.close", ["w", "Escape"])
def do_activate(self) -> None:
if not self._active:
self.hold()
self._active = True
def _on_dbus_name_appeared(self, _connection: Gio.DBusConnection, name: str, owner: str) -> None:
logging.info(f"{name} {owner}")
self.manager_state = True
self.plugin_run_state_changed = True
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_manager_state_changed(self.manager_state)
def _on_dbus_name_vanished(self, _connection: Gio.DBusConnection, name: str) -> None:
logging.info(name)
self.manager_state = False
self.plugin_run_state_changed = True
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_manager_state_changed(self.manager_state)
def _on_adapter_property_changed(self, _adapter: AnyAdapter, key: str, value: Any, path: str) -> None:
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_adapter_property_changed(path, key, value)
def _on_device_property_changed(self, _device: AnyDevice, key: str, value: Any, path: str) -> None:
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_device_property_changed(path, key, value)
def on_adapter_added(self, _manager: Manager, path: str) -> None:
logging.info(f"Adapter added {path}")
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_adapter_added(path)
def on_adapter_removed(self, _manager: Manager, path: str) -> None:
logging.info(f"Adapter removed {path}")
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_adapter_removed(path)
def on_device_created(self, _manager: Manager, path: str) -> None:
logging.info(f"Device created {path}")
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_device_created(path)
def on_device_removed(self, _manager: Manager, path: str) -> None:
logging.info(f"Device removed {path}")
for plugin in self.Plugins.get_loaded_plugins(AppletPlugin):
plugin.on_device_removed(path)
class Plugins(PersistentPluginManager[AppletPlugin]):
def __init__(self, applet: BluemanApplet):
super().__init__(AppletPlugin, blueman.plugins.applet, applet)
@property
def DBusService(self) -> DBusService:
return cast(DBusService, self._plugins["DBusService"])
@property
def Menu(self) -> Menu:
return cast(Menu, self._plugins["Menu"])
@property
def PowerManager(self) -> PowerManager:
return cast(PowerManager, self._plugins["PowerManager"])
@property
def RecentConns(self) -> RecentConns:
return cast(RecentConns, self._plugins["RecentConns"])
@property
def StandardItems(self) -> StandardItems:
return cast(StandardItems, self._plugins["StandardItems"])
@property
def StatusIcon(self) -> StatusIcon:
return cast(StatusIcon, self._plugins["StatusIcon"])
blueman-2.4.3/blueman/main/BatteryWatcher.py 0000664 0000000 0000000 00000001610 14650545052 0021020 0 ustar 00root root 0000000 0000000 import weakref
from typing import Callable
from blueman.bluez.Battery import Battery, AnyBattery
from blueman.bluez.Manager import Manager
class BatteryWatcher:
def __init__(self, callback: Callable[[str, int], None]) -> None:
super().__init__()
manager = Manager()
weakref.finalize(
self,
manager.disconnect_signal,
manager.connect_signal(
"battery-created",
lambda _manager, obj_path: callback(obj_path, Battery(obj_path=obj_path)["Percentage"])
)
)
any_battery = AnyBattery()
weakref.finalize(
self,
any_battery.disconnect_signal,
any_battery.connect_signal(
"property-changed",
lambda _any_battery, key, value, path: callback(path, value) if key == "Percentage" else None
)
)
blueman-2.4.3/blueman/main/Builder.py 0000664 0000000 0000000 00000001030 14650545052 0017452 0 ustar 00root root 0000000 0000000 from typing import TypeVar, Type
import gi
from blueman.Constants import UI_PATH
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class Builder(Gtk.Builder):
def __init__(self, filename: str):
super().__init__(translation_domain="blueman")
self.add_from_file(UI_PATH + "/" + filename)
T = TypeVar("T", bound=Gtk.Widget)
def get_widget(self, name: str, widget_type: Type[T]) -> T:
widget = self.get_object(name)
assert isinstance(widget, widget_type)
return widget
blueman-2.4.3/blueman/main/DBusProxies.py 0000664 0000000 0000000 00000006330 14650545052 0020303 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from gi.repository import Gio, GLib
from blueman.gobject import SingletonGObjectMeta
from blueman.gui.Notification import Notification
class DBusProxyFailed(Exception):
pass
class ProxyBase(Gio.DBusProxy, metaclass=SingletonGObjectMeta):
def __init__(self, name: str, interface_name: str, object_path: str = "/", systembus: bool = False,
flags: Gio.DBusProxyFlags = Gio.DBusProxyFlags.NONE) -> None:
if systembus:
bustype = Gio.BusType.SYSTEM
else:
bustype = Gio.BusType.SESSION
super().__init__(
g_name=name,
g_interface_name=interface_name,
g_object_path=object_path,
g_bus_type=bustype,
g_flags=flags
)
try:
self.init()
except GLib.Error as e:
raise DBusProxyFailed(e.message)
def call_method(self, name: str, params: GLib.Variant) -> None:
def call_finish(proxy: ProxyBase, response: Gio.AsyncResult) -> None:
try:
proxy.call_finish(response)
except GLib.Error:
logging.error(f"Failed to execute method {name}", exc_info=True)
raise
self.call(name, params, Gio.DBusCallFlags.NONE, -1, None, call_finish)
class Mechanism(ProxyBase):
def __init__(self) -> None:
super().__init__(name='org.blueman.Mechanism', interface_name='org.blueman.Mechanism',
object_path="/org/blueman/mechanism", systembus=True)
class AppletService(ProxyBase):
def __init__(self) -> None:
super().__init__(name='org.blueman.Applet', interface_name='org.blueman.Applet',
object_path="/org/blueman/Applet")
class ManagerService(ProxyBase):
def __init__(self) -> None:
super().__init__(name="org.blueman.Manager", interface_name="org.freedesktop.Application",
object_path="/org/blueman/Manager",
flags=Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION)
def activate(self) -> None:
try:
param = GLib.Variant('(a{sv})', ({},))
self.call_method("Activate", param)
except GLib.Error:
# This can different errors, depending on the system configuration, typically:
# * org.freedesktop.DBus.Error.Spawn.ChildExited if dbus-daemon tries to launch the service itself.
# * org.freedesktop.DBus.Error.NoReply if the systemd integration is used.
Notification(
_("Failed to reach blueman-manager"),
_("It seems like blueman-manager could no get activated via D-Bus. "
"A typical cause for this is a broken graphical setup in the D-Bus activation environment "
"that can get resolved with a call to dbus-update-activation-environment, "
"typically issued from xinitrc (respectively the Sway config or similar)."),
0,
).show()
def _call_action(self, name: str) -> None:
param = GLib.Variant('(sava{sv})', (name, [], {}))
self.call_method('ActivateAction', param)
def quit(self) -> None:
self._call_action("Quit")
blueman-2.4.3/blueman/main/DNSServerProvider.py 0000664 0000000 0000000 00000007570 14650545052 0021431 0 ustar 00root root 0000000 0000000 import re
import socket
from ipaddress import IPv4Address, ip_address
from typing import List, Generator
from gi.repository import GObject, Gio, GLib
from blueman.bluemantyping import GSignals
class DNSServerProvider(GObject.GObject):
RESOLVER_PATH = "/etc/resolv.conf"
_RESOLVED_NAME = "org.freedesktop.resolve1"
_RESOLVED_MANAGER_INTERFACE = "org.freedesktop.resolve1.Manager"
__gsignals__: GSignals = {"changed": (GObject.SignalFlags.NO_HOOKS, None, ())}
def __init__(self) -> None:
super().__init__()
self._subscribe_systemd_resolved()
self._subscribe_resolver()
@classmethod
def get_servers(cls) -> List[IPv4Address]:
return list(set(cls._get_servers_from_systemd_resolved()) or cls._get_servers_from_resolver())
@classmethod
def _get_servers_from_systemd_resolved(cls) -> Generator[IPv4Address, None, None]:
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM)
manager_proxy = Gio.DBusProxy.new_for_bus_sync(
Gio.BusType.SYSTEM,
Gio.DBusProxyFlags.DO_NOT_AUTO_START,
None,
cls._RESOLVED_NAME,
"/org/freedesktop/resolve1",
cls._RESOLVED_MANAGER_INTERFACE,
)
try:
data = manager_proxy.call_sync(
"org.freedesktop.DBus.Properties.Get",
GLib.Variant("(ss)", (cls._RESOLVED_MANAGER_INTERFACE, "DNS")),
Gio.DBusCallFlags.NONE,
-1,
None
).unpack()[0]
except GLib.Error:
return
for (interface, address_family, address) in data:
if address_family != socket.AF_INET.value:
continue
if interface != 0:
object_path = manager_proxy.call_sync(
"GetLink",
GLib.Variant("(i)", (interface,)),
Gio.DBusCallFlags.NONE,
-1,
None
).unpack()[0]
if not bus.call_sync(
cls._RESOLVED_NAME,
object_path,
"org.freedesktop.DBus.Properties",
"Get",
GLib.Variant("(ss)", ("org.freedesktop.resolve1.Link", "DefaultRoute")),
None,
Gio.DBusCallFlags.NONE,
-1,
None
).unpack()[0]:
continue
addr = ip_address('.'.join(str(p) for p in address))
assert isinstance(addr, IPv4Address)
yield addr
@classmethod
def _get_servers_from_resolver(cls) -> Generator[IPv4Address, None, None]:
with open(cls.RESOLVER_PATH) as f:
for line in f:
match = re.search(r"^nameserver\s+((?:\d{1,3}\.){3}\d{1,3}$)", line)
if match:
yield IPv4Address(match.group(1))
def _subscribe_systemd_resolved(self) -> None:
def on_signal(
_connection: Gio.DBusConnection,
_sender_name: str,
_object_path: str,
_interface_name: str,
_signal_name: str,
param: GLib.Variant,
) -> None:
interface_name, changed_properties, invalidated_propeties = param.unpack()
if interface_name == self._RESOLVED_MANAGER_INTERFACE and "DNS" in changed_properties:
self.emit("changed")
self._bus = Gio.bus_get_sync(Gio.BusType.SYSTEM)
self._bus.signal_subscribe(
self._RESOLVED_NAME, "org.freedesktop.DBus.Properties", "PropertiesChanged",
"/org/freedesktop/resolve1", None, Gio.DBusSignalFlags.NONE, on_signal)
def _subscribe_resolver(self) -> None:
self._monitor = Gio.File.new_for_path(self.RESOLVER_PATH).monitor_file(Gio.FileMonitorFlags.NONE)
self._monitor.connect("changed", lambda *args: self.emit("changed"))
blueman-2.4.3/blueman/main/DbusService.py 0000664 0000000 0000000 00000016567 14650545052 0020327 0 ustar 00root root 0000000 0000000 import logging
import sys
import traceback
from typing import Dict, Tuple, Callable, Set, Optional, Any, Collection, Mapping, Union, overload, TYPE_CHECKING
from gi.repository import Gio, GLib
if TYPE_CHECKING:
from typing_extensions import Literal
class DbusError(Exception):
_name = "org.blueman.Error"
def __init__(self, message: str) -> None:
self._message = message
@property
def name(self) -> str:
return self._name
@property
def message(self) -> str:
return self._message
class DbusService:
def __init__(self, bus_name: Optional[str], interface_name: str, path: str, bus_type: Gio.BusType,
properties: Optional[Mapping[str, str]] = None) -> None:
self._bus = Gio.bus_get_sync(bus_type)
if bus_name:
Gio.bus_own_name(bus_type, bus_name, Gio.BusNameOwnerFlags.NONE, None, None, None)
self._methods: Dict[str, Tuple[Tuple[str, ...], Tuple[str, ...], Callable[..., None], Set[str]]] = {}
self._signals: Dict[str, Tuple[str, ...]] = {}
self._properties = {} if properties is None else properties
self._interface_name = interface_name
self._path = path
self._regid: Optional[int] = None
@overload
def add_method(self, name: str, arguments: Tuple[str, ...], return_values: Union[str, Tuple[str, ...]],
method: Callable[..., None], pass_sender: bool = False, is_async: bool = False) -> None:
...
@overload
def add_method(self, name: str, arguments: Tuple[str, ...], return_values: Tuple[str, ...],
method: Callable[..., Any], pass_sender: bool = False,
is_async: "Literal[False]" = False) -> None:
...
def add_method(self, name: str, arguments: Tuple[str, ...], return_values: Union[str, Tuple[str, ...]],
method: Callable[..., Any], pass_sender: bool = False, is_async: bool = False) -> None:
if name in self._signals:
raise Exception(f"{name} already defined")
options = set()
if pass_sender:
options.add("sender")
if is_async:
options.add("async")
self._methods[name] = (arguments, self._handle_return_type(return_values), method, options)
self._reregister()
def remove_method(self, name: str) -> None:
del self._methods[name]
self._reregister()
def add_signal(self, name: str, types: Union[str, Tuple[str, ...]]) -> None:
if name in self._signals:
raise Exception(f"{name} already defined")
self._signals[name] = self._handle_return_type(types)
self._reregister()
def _handle_return_type(self, types: Union[str, Tuple[str, ...]]) -> Tuple[str, ...]:
if isinstance(types, str):
if types:
# A non-empty string is a single return type
return types,
else:
# An empty string is no return type
return ()
else:
return types
def remove_signal(self, name: str) -> None:
del self._signals[name]
self._reregister()
def emit_signal(self, name: str, *args: Any) -> None:
self._bus.emit_signal(None, self._path, self._interface_name, name,
self._prepare_arguments(self._signals[name], args))
def register(self) -> None:
node_xml = f""
for property_name, signature in self._properties.items():
node_xml += f""
for method_name, method_info in self._methods.items():
node_xml += f""
for argument in method_info[0]:
node_xml += f""
for result in method_info[1]:
node_xml += f""
node_xml += ""
for signal_name, signal_signature in self._signals.items():
node_xml += f""
for signature in signal_signature:
node_xml += f""
node_xml += ""
node_xml += ""
node_info = Gio.DBusNodeInfo.new_for_xml(node_xml)
regid = self._bus.register_object(
self._path,
node_info.interfaces[0],
self._handle_method_call,
self._get_property,
None)
if regid:
self._regid = regid
else:
raise GLib.Error(f"Failed to register object with path: {self._path}")
def unregister(self) -> None:
if self._regid is not None:
self._bus.unregister_object(self._regid)
self._regid = None
def _reregister(self) -> None:
if self._regid:
self.unregister()
self.register()
def _handle_method_call(self, _connection: Gio.DBusConnection, sender: str, _path: str, interface_name: str,
method_name: str, parameters: GLib.Variant, invocation: Gio.DBusMethodInvocation) -> None:
try:
try:
_arguments, result_signatures, method, options = self._methods[method_name]
except KeyError:
logging.warning(f"Unhandled method: {method_name}")
invocation.return_error_literal(Gio.dbus_error_quark(), Gio.DBusError.UNKNOWN_METHOD,
f"No such method on interface: {interface_name}.{method_name}")
def ok(*result: Any) -> None:
invocation.return_value(self._prepare_arguments(result_signatures,
result[0] if len(result_signatures) > 1 else result))
args = parameters.unpack()
if "sender" in options:
args += (sender,)
if "async" in options:
method(*(args + (ok, lambda exception: self._return_dbus_error(invocation, exception))))
else:
ok(method(*args))
except Exception as e:
self._return_dbus_error(invocation, e)
def _get_property(self, _connection: Gio.DBusConnection, _sender: str, path: str, interface_name: str,
property_name: str) -> GLib.Variant:
assert interface_name == self._interface_name and path == self._path
return GLib.Variant(self._properties[property_name], getattr(self, property_name))
@staticmethod
def _return_dbus_error(invocation: Gio.DBusMethodInvocation, data: object) -> None:
if isinstance(data, DbusError):
invocation.return_dbus_error(data.name, data.message)
else:
if isinstance(data, Exception):
et, ev, etb = sys.exc_info()
if ev is data:
message = "".join(traceback.format_exception(et, ev, etb))
else:
message = "".join(traceback.format_exception_only(data.__class__, data))
else:
message = str(data)
invocation.return_error_literal(Gio.dbus_error_quark(), Gio.DBusError.FAILED, message)
@staticmethod
def _prepare_arguments(types: Tuple[str, ...], args: Collection[Any]) -> Optional[GLib.Variant]:
return GLib.Variant(f"({''.join(types)})", args) if types else None
blueman-2.4.3/blueman/main/DhcpClient.py 0000664 0000000 0000000 00000005062 14650545052 0020112 0 ustar 00root root 0000000 0000000 from typing import List
from gi.repository import GObject
from gi.repository import GLib
import socket
import subprocess
import logging
from blueman.Functions import have, get_local_interfaces
from blueman.bluemantyping import GSignals
class DhcpClient(GObject.GObject):
__gsignals__: GSignals = {
# arg: interface name eg. ppp0
'connected': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'error-occurred': (GObject.SignalFlags.NO_HOOKS, None, (int,)),
}
COMMANDS = [
["dhclient", "-e", "IF_METRIC=100", "-1"],
["dhcpcd", "-m", "100"],
["udhcpc", "-t", "20", "-x", "hostname", socket.gethostname(), "-n", "-i"]
]
querying: List[str] = []
def __init__(self, interface: str, timeout: int = 30) -> None:
"""The interface name has to be trusted / sanitized!"""
super().__init__()
self._interface = interface
self._timeout = timeout
self._command = None
for command in self.COMMANDS:
path = have(command[0])
if path:
self._command = [path] + command[1:] + [self._interface]
break
def run(self) -> None:
if not self._command:
raise Exception("No DHCP client found, please install dhclient, dhcpcd, or udhcpc")
if self._interface in DhcpClient.querying:
raise Exception("DHCP already running on this interface")
else:
DhcpClient.querying.append(self._interface)
self._client = subprocess.Popen(self._command)
GLib.timeout_add(1000, self._check_client)
GLib.timeout_add(self._timeout * 1000, self._on_timeout)
def _on_timeout(self) -> bool:
if not self._client.poll():
logging.warning("Timeout reached, terminating DHCP client")
self._client.terminate()
return False
def _check_client(self) -> bool:
netifs = get_local_interfaces()
status = self._client.poll()
if status == 0:
def complete() -> bool:
ip = netifs[self._interface][0]
logging.info(f"bound to {ip}")
self.emit("connected", ip)
return False
GLib.timeout_add(1000, complete)
DhcpClient.querying.remove(self._interface)
return False
elif status:
logging.error(f"dhcp client failed with status code {status}")
self.emit("error-occurred", status)
DhcpClient.querying.remove(self._interface)
return False
else:
return True
blueman-2.4.3/blueman/main/Makefile.am 0000664 0000000 0000000 00000001107 14650545052 0017553 0 ustar 00root root 0000000 0000000 SUBDIRS = applet indicators
bluemandir = $(pythondir)/blueman/main
blueman_PYTHON = \
PPPConnection.py \
DhcpClient.py \
__init__.py \
NetConf.py \
SpeedCalc.py \
DbusService.py \
DNSServerProvider.py \
PluginManager.py \
Adapter.py \
Applet.py \
Builder.py \
Manager.py \
MechanismApplication.py \
Sendto.py \
Services.py \
Tray.py \
DBusProxies.py \
NetworkManager.py \
BatteryWatcher.py
if HAVE_PULSEAUDIO
blueman_PYTHON += PulseAudioUtils.py
endif
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/main/Makefile.in 0000664 0000000 0000000 00000060214 14650545052 0017570 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_PULSEAUDIO_TRUE@am__append_1 = PulseAudioUtils.py
subdir = blueman/main
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__blueman_PYTHON_DIST) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__blueman_PYTHON_DIST = PPPConnection.py DhcpClient.py __init__.py \
NetConf.py SpeedCalc.py DbusService.py DNSServerProvider.py \
PluginManager.py Adapter.py Applet.py Builder.py Manager.py \
MechanismApplication.py Sendto.py Services.py Tray.py \
DBusProxies.py NetworkManager.py BatteryWatcher.py \
PulseAudioUtils.py
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = applet indicators
bluemandir = $(pythondir)/blueman/main
blueman_PYTHON = PPPConnection.py DhcpClient.py __init__.py NetConf.py \
SpeedCalc.py DbusService.py DNSServerProvider.py \
PluginManager.py Adapter.py Applet.py Builder.py Manager.py \
MechanismApplication.py Sendto.py Services.py Tray.py \
DBusProxies.py NetworkManager.py BatteryWatcher.py \
$(am__append_1)
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/main/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/main/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/main/Manager.py 0000664 0000000 0000000 00000025710 14650545052 0017451 0 ustar 00root root 0000000 0000000 import logging
import signal
from gettext import gettext as _
from typing import Optional, Any, Tuple
from blueman.bluez.Adapter import Adapter
from blueman.bluez.Device import Device
from blueman.bluez.Manager import Manager
from blueman.Functions import *
from blueman.gui.manager.ManagerDeviceList import ManagerDeviceList
from blueman.gui.manager.ManagerToolbar import ManagerToolbar
from blueman.gui.manager.ManagerMenu import ManagerMenu
from blueman.gui.manager.ManagerStats import ManagerStats
from blueman.gui.manager.ManagerProgressbar import ManagerProgressbar
from blueman.main.Builder import Builder
from blueman.main.DBusProxies import AppletService, DBusProxyFailed
from blueman.gui.CommonUi import ErrorDialog
from blueman.gui.Notification import Notification
from blueman.main.PluginManager import PluginManager
import blueman.plugins.manager
from blueman.plugins.ManagerPlugin import ManagerPlugin
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gio, Gdk, GLib
class Blueman(Gtk.Application):
def __init__(self) -> None:
super().__init__(application_id="org.blueman.Manager")
def do_quit(_: object) -> bool:
self.quit()
return False
s = GLib.unix_signal_source_new(signal.SIGINT)
s.set_callback(do_quit)
s.attach()
window: Optional[Gtk.ApplicationWindow]
def do_startup(self) -> None:
def doquit(_a: Gio.SimpleAction, _param: None) -> None:
self.quit()
Gtk.Application.do_startup(self)
self.window = None
self.Config = Gio.Settings(schema_id="org.blueman.general")
self.builder = Builder("manager-main.ui")
quit_action = Gio.SimpleAction.new("Quit", None)
quit_action.connect("activate", doquit)
self.set_accels_for_action("app.Quit", ["q", "w"])
self.add_action(quit_action)
bt_status_action = Gio.SimpleAction.new_stateful("bluetooth_status", None, GLib.Variant.new_boolean(False))
bt_status_action.connect("change-state", self._on_bt_state_changed)
self.add_action(bt_status_action)
def do_activate(self) -> None:
if not self.window:
self.window = self.builder.get_widget("manager_window", Gtk.ApplicationWindow)
self.window.set_application(self)
w, h, x, y = self.Config["window-properties"]
if w and h:
self.window.resize(w, h)
if x and y:
self.window.move(x, y)
# Connect to configure event to store new window position and size
self.window.connect("configure-event", self._on_configure)
toolbar = self.builder.get_widget("toolbar", Gtk.Toolbar)
statusbar = self.builder.get_widget("statusbar", Gtk.Box)
self._infobar = self.builder.get_widget("message_area", Gtk.InfoBar)
self._infobar.connect("response", self._infobar_response)
self._infobar_bt: str = ""
self.Plugins = PluginManager(ManagerPlugin, blueman.plugins.manager, self)
self.Plugins.load_plugin()
# Add margin for resize grip or it will overlap
if self.window.get_has_resize_grip():
margin_right = statusbar.get_margin_right()
statusbar.set_margin_right(margin_right + 10)
def on_applet_signal(_proxy: AppletService, _sender: str, signal_name: str, params: GLib.Variant) -> None:
if signal_name == 'BluetoothStatusChanged':
status = params.unpack()[0]
action = self.lookup_action("bluetooth_status")
action.change_state(GLib.Variant.new_boolean(status))
def on_dbus_name_vanished(_connection: Gio.DBusConnection, name: str) -> None:
logging.info(name)
if self.window is not None:
self.window.hide()
d = ErrorDialog(
_("Connection to BlueZ failed"),
_("Bluez daemon is not running, blueman-manager cannot continue.\n"
"This probably means that there were no Bluetooth adapters detected "
"or Bluetooth daemon was not started."),
icon_name="blueman")
d.run()
d.destroy()
# FIXME ui can handle BlueZ start/stop but we should inform user
self.quit()
def on_dbus_name_appeared(_connection: Gio.DBusConnection, name: str, owner: str) -> None:
logging.info(f"{name} {owner}")
setup_icon_path()
try:
self.Applet = AppletService()
self.Applet.connect('g-signal', on_applet_signal)
except DBusProxyFailed:
print("Blueman applet needs to be running")
bmexit()
sw = self.builder.get_widget("scrollview", Gtk.ScrolledWindow)
# Disable overlay scrolling
if Gtk.get_minor_version() >= 16:
sw.props.overlay_scrolling = False
self.List = ManagerDeviceList(adapter=self.Config["last-adapter"], inst=self)
self.List.show()
sw.add(self.List)
self.Toolbar = ManagerToolbar(self)
self.Menu = ManagerMenu(self)
self.Stats = ManagerStats(self)
if self.List.is_valid_adapter():
self.List.populate_devices()
self.List.connect("adapter-changed", self.on_adapter_changed)
self.Config.bind("show-toolbar", toolbar, "visible", Gio.SettingsBindFlags.DEFAULT)
self.Config.bind("show-statusbar", statusbar, "visible", Gio.SettingsBindFlags.DEFAULT)
bt_status_action = self.lookup_action("bluetooth_status")
bt_status_action.change_state(GLib.Variant.new_boolean(self.Applet.GetBluetoothStatus()))
Manager.watch_name_owner(on_dbus_name_appeared, on_dbus_name_vanished)
self.window.present_with_time(Gtk.get_current_event_time())
def _on_bt_state_changed(self, action: Gio.SimpleAction, state_variant: GLib.Variant) -> None:
action.set_state(state_variant)
state = state_variant.unpack()
self.Applet.SetBluetoothStatus("(b)", state)
if state:
icon_name = "bluetooth"
tooltip_text = _("Click to disable.")
else:
icon_name = "bluetooth-disabled"
tooltip_text = _("Click to enable.")
box = self.builder.get_widget("bt_status_box", Gtk.Box)
image = self.builder.get_widget("im_bluetooth_status", Gtk.Image)
box.set_tooltip_text(tooltip_text)
image.props.icon_name = icon_name
def _on_configure(self, _window: Gtk.ApplicationWindow, event: Gdk.EventConfigure) -> bool:
width, height, x, y = self.Config["window-properties"]
if event.x != x or event.y != y or event.width != width or event.height != height:
self.Config["window-properties"] = [event.width, event.height, event.x, event.y]
return False
def on_adapter_changed(self, lst: ManagerDeviceList, adapter: str) -> None:
if adapter is not None:
self.List.populate_devices()
def inquiry(self) -> None:
def prop_changed(_lst: ManagerDeviceList, _adapter: Adapter, key_value: Tuple[str, Any]) -> None:
key, value = key_value
if key == "Discovering" and not value:
prog.finalize()
self.List.disconnect(s1)
self.List.disconnect(s2)
def on_progress(_lst: ManagerDeviceList, frac: float) -> None:
if abs(1.0 - frac) <= 0.00001:
if not prog.started():
prog.start()
else:
prog.fraction(frac)
prog = ManagerProgressbar(self, text=_("Searching"))
prog.connect("cancelled", lambda x: self.List.stop_discovery())
def on_error(e: Exception) -> None:
prog.finalize()
self.infobar_update(*e_(e))
self.List.discover_devices(error_handler=on_error)
s1 = self.List.connect("discovery-progress", on_progress)
s2 = self.List.connect("adapter-property-changed", prop_changed)
def infobar_update(self, message: str, bt: Optional[str] = None, icon_name: str = "dialog-warning") -> None:
if icon_name == "dialog-warning":
self._infobar.set_message_type(Gtk.MessageType.WARNING)
else:
self._infobar.set_message_type(Gtk.MessageType.INFO)
more_button = self.builder.get_widget("ib_more_button", Gtk.Button)
image = self.builder.get_widget("ib_icon", Gtk.Image)
msg_lbl = self.builder.get_widget("ib_message", Gtk.Label)
image.set_from_icon_name(icon_name, 16)
if bt is not None:
msg_lbl.set_text(f"{message}…")
self._infobar_bt = f"{message}\n{bt}"
more_button.show()
else:
more_button.hide()
msg_lbl.set_text(f"{message}")
self._infobar.set_visible(True)
self._infobar.set_revealed(True)
def _infobar_response(self, info_bar: Gtk.InfoBar, response_id: int) -> None:
def hide() -> bool:
self._infobar.set_visible(False)
return False
logging.debug(f"Response: {response_id}")
if response_id == Gtk.ResponseType.CLOSE:
self._infobar_bt = ""
info_bar.set_revealed(False)
GLib.timeout_add(250, hide) # transition is 250.
elif response_id == 0:
dialog = Gtk.MessageDialog(parent=self.window, type=Gtk.MessageType.INFO, modal=True,
buttons=Gtk.ButtonsType.CLOSE, text=self._infobar_bt)
dialog.connect("response", lambda d, _i: d.destroy())
dialog.connect("close", lambda d: d.destroy())
dialog.show()
@staticmethod
def bond(device: Device) -> None:
def error_handler(e: Exception) -> None:
logging.exception(e)
message = f"Pairing failed for:\n{device.display_name} ({device['Address']})"
Notification('Bluetooth', message, icon_name="blueman").show()
device.pair(error_handler=error_handler)
@staticmethod
def adapter_properties() -> None:
launch("blueman-adapters", name=_("Adapter Preferences"))
@staticmethod
def toggle_trust(device: Device) -> None:
device['Trusted'] = not device['Trusted']
@staticmethod
def toggle_blocked(device: Device) -> None:
device['Blocked'] = not device['Blocked']
def send(self, device: Device) -> None:
adapter = self.List.Adapter
assert adapter
command = f"blueman-sendto --source={adapter['Address']} --device={device['Address']}"
launch(command, name=_("File Sender"))
def remove(self, device: Device) -> None:
assert self.List.Adapter
self.List.Adapter.remove_device(device)
blueman-2.4.3/blueman/main/MechanismApplication.py 0000664 0000000 0000000 00000006261 14650545052 0022167 0 ustar 00root root 0000000 0000000 import importlib
import logging
import os
from typing import Optional
import blueman.plugins.mechanism
from blueman.Constants import POLKIT
from gi.repository import GLib, Gio
from blueman.main.DbusService import DbusService, DbusError
from blueman.plugins.MechanismPlugin import MechanismPlugin
class Timer:
def __init__(self, loop: GLib.MainLoop):
self.time = 0
self.stopped = False
self._loop = loop
GLib.timeout_add(1000, self.tick)
def tick(self) -> bool:
if not self.stopped:
self.time += 1
if self.time == (9999 if 'BLUEMAN_SOURCE' in os.environ else 30):
logging.info("Exiting")
self._loop.quit()
return True
def reset(self) -> None:
self.time = 0
def stop(self) -> None:
self.stopped = True
def resume(self) -> None:
self.stopped = False
self.reset()
class MechanismApplication(DbusService):
def __init__(self, stoptimer: bool):
super().__init__("org.blueman.Mechanism", "org.blueman.Mechanism", "/org/blueman/mechanism", Gio.BusType.SYSTEM)
self._loop = GLib.MainLoop()
self.timer = Timer(self._loop)
if stoptimer:
self.timer.stop()
if POLKIT:
try:
self.pk: Optional[Gio.DBusProxy] = Gio.DBusProxy.new_for_bus_sync(
Gio.BusType.SYSTEM,
Gio.DBusProxyFlags.NONE,
None,
'org.freedesktop.PolicyKit1',
'/org/freedesktop/PolicyKit1/Authority',
'org.freedesktop.PolicyKit1.Authority')
except Exception as e:
logging.exception(e)
self.pk = None
else:
self.pk = None
path = os.path.dirname(blueman.plugins.mechanism.__file__)
plugins = []
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith(".py") and not (f.endswith(".pyc") or f.endswith("_.py")):
plugins.append(f[0:-3])
for plugin in plugins:
try:
importlib.import_module(f"blueman.plugins.mechanism.{plugin}")
except ImportError:
logging.error(f"Skipping plugin {plugin}", exc_info=True)
classes = MechanismPlugin.__subclasses__()
for cls in classes:
logging.info(f"loading {cls.__name__}")
cls(self)
self.register()
def run(self) -> None:
self._loop.run()
def confirm_authorization(self, subject: str, action_id: str) -> None:
self.timer.reset()
if not POLKIT:
return
else:
if not self.pk:
raise DbusError("Blueman was built with PolicyKit-1 support, but it's not available on the system")
v_subject = GLib.Variant('s', subject)
res = self.pk.CheckAuthorization('((sa{sv})sa{ss}us)', ("system-bus-name", {"name": v_subject}),
action_id, {}, 1, "")
logging.debug(str(res))
(is_authorized, is_challenge, details) = res
if not is_authorized:
raise DbusError("Not authorized")
blueman-2.4.3/blueman/main/NetConf.py 0000664 0000000 0000000 00000027707 14650545052 0017443 0 ustar 00root root 0000000 0000000 import errno
import os
import ipaddress
import socket
from tempfile import mkstemp
from time import sleep
import logging
import signal
from typing import List, Tuple, Optional, Type
from blueman.Constants import DHCP_CONFIG_FILE
from blueman.Functions import have
from _blueman import create_bridge, destroy_bridge, BridgeException
from subprocess import call, Popen, PIPE
from blueman.main.DNSServerProvider import DNSServerProvider
class NetworkSetupError(Exception):
pass
def _is_running(name: str, pid: int) -> bool:
if not os.path.exists(f"/proc/{pid}"):
return False
with open(f"/proc/{pid}/cmdline") as f:
return name in f.readline().replace("\0", " ")
def _read_pid_file(fname: str) -> Optional[int]:
try:
with open(fname) as f:
return int(f.read())
except (OSError, ValueError):
return None
def _get_binary(*names: str) -> str:
for name in names:
path = have(name)
if path:
return path
raise FileNotFoundError(f"{' '.join(names)} not found")
class DHCPHandler:
_BINARIES: List[str]
@property
def _key(self) -> str:
return self._BINARIES[-1]
def __init__(self) -> None:
self._pid: Optional[int] = None
@staticmethod
def _get_arguments(ip4_address: str) -> List[str]:
return []
@property
def _pid_path(self) -> str:
return f"/var/run/{self._key}.pan1.pid"
def apply(self, ip4_address: str, ip4_mask: str) -> None:
error = self._start(_get_binary(*self._BINARIES), ip4_address, ip4_mask,
[ip4_address if addr.is_loopback else str(addr)
for addr in DNSServerProvider.get_servers()])
if error is None:
logging.info(f"{self._key} started correctly")
with open(self._pid_path) as f:
self._pid = int(f.read())
logging.info(f"pid {self._pid}")
NetConf.lock("dhcp")
else:
error_msg = error.decode("UTF-8").strip()
logging.info(error_msg)
raise NetworkSetupError(f"{self._key} failed to start: {error_msg}")
def _start(self, binary: str, ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> Optional[bytes]:
...
def clean_up(self) -> None:
self._clean_up_configuration()
if NetConf.locked("dhcp"):
if not self._pid:
pid = _read_pid_file(self._pid_path)
else:
pid = self._pid
if pid is not None:
running_binary: Optional[str] = next(binary for binary in self._BINARIES if _is_running(binary, pid))
if running_binary is not None:
print('Terminating ' + running_binary)
os.kill(pid, signal.SIGTERM)
else:
running_binary = None
if pid is None or running_binary is None:
logging.info("Stale dhcp lockfile found")
NetConf.unlock("dhcp")
def _clean_up_configuration(self) -> None:
...
class DnsMasqHandler(DHCPHandler):
_BINARIES = ["dnsmasq"]
def _start(self, binary: str, ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> Optional[bytes]:
ipiface = ipaddress.ip_interface('/'.join((ip4_address, ip4_mask)))
cmd = [binary, f"--pid-file={self._pid_path}", "--except-interface=lo",
"--interface=pan1", "--bind-interfaces",
f"--dhcp-range={ipiface.network[2]},{ipiface.network[-2]},60m",
f"--dhcp-option=option:router,{ip4_address}"]
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
if s.connect_ex(("localhost", 53)) == 0:
cmd += ["--port=0", f"--dhcp-option=option:dns-server,{', '.join(dns_servers)}"]
logging.info(cmd)
p = Popen(cmd, stderr=PIPE)
error = p.communicate()[1]
return error if error else None
DHCPDSUBNET = '''#### BLUEMAN AUTOMAGIC SUBNET ####
# Everything inside this section is destroyed after config change
subnet %(ip_mask)s netmask %(netmask)s {
option domain-name-servers %(dns)s;
option subnet-mask %(netmask)s;
option routers %(rtr)s;
range %(start)s %(end)s;
}
#### END BLUEMAN AUTOMAGIC SUBNET ####'''
class DhcpdHandler(DHCPHandler):
_BINARIES = ["dhcpd3", "dhcpd"]
@staticmethod
def _read_dhcp_config() -> Tuple[str, str]:
dhcp_config = ''
existing_subnet = ''
start = end = False
with open(DHCP_CONFIG_FILE) as f:
for line in f:
if line == '#### BLUEMAN AUTOMAGIC SUBNET ####\n':
start = True
elif line == '#### END BLUEMAN AUTOMAGIC SUBNET ####\n':
if not start:
# Because of bug end string got left upon removal
continue
end = True
if start and not end:
existing_subnet += line
elif start and end:
existing_subnet += line
start = end = False
else:
dhcp_config += line
return dhcp_config, existing_subnet
@staticmethod
def _generate_subnet_config(ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> str:
ipiface = ipaddress.ip_interface('/'.join((ip4_address, ip4_mask)))
return DHCPDSUBNET % {"ip_mask": ipiface.network.network_address,
"netmask": ipiface.netmask,
"dns": ', '.join(dns_servers),
"rtr": ipiface.ip,
"start": ipiface.network[2],
"end": ipiface.network[-2]}
def _start(self, binary: str, ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> Optional[bytes]:
dhcp_config, existing_subnet = self._read_dhcp_config()
subnet = self._generate_subnet_config(ip4_address, ip4_mask, dns_servers)
with open(DHCP_CONFIG_FILE, "w") as f:
f.write(dhcp_config)
f.write(subnet)
cmd = [binary, "-pf", self._pid_path, "pan1"]
p = Popen(cmd, stderr=PIPE)
error = p.communicate()[1]
return None if p.returncode == 0 else error
def _clean_up_configuration(self) -> None:
dhcp_config, existing_subnet = self._read_dhcp_config()
with open(DHCP_CONFIG_FILE, "w") as f:
f.write(dhcp_config)
UDHCP_CONF_TEMPLATE = """start %(start)s
end %(end)s
interface pan1
pidfile %(pid_path)s
option subnet %(ip_mask)s
option dns %(dns)s
option router %(rtr)s
"""
class UdhcpdHandler(DHCPHandler):
_BINARIES = ["udhcpd"]
def _generate_config(self, ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> str:
ipiface = ipaddress.ip_interface('/'.join((ip4_address, ip4_mask)))
return UDHCP_CONF_TEMPLATE % {"ip_mask": ipiface.network.network_address,
"dns": ', '.join(dns_servers),
"rtr": ipiface.ip,
"start": ipiface.network[2],
"end": ipiface.network[-2],
"pid_path": self._pid_path}
def _start(self, binary: str, ip4_address: str, ip4_mask: str, dns_servers: List[str]) -> Optional[bytes]:
config_file, self._config_path = mkstemp(prefix="udhcpd-")
with open(config_file, "w", encoding="utf8") as f:
f.write(self._generate_config(ip4_address, ip4_mask, dns_servers))
logging.info(f"Running udhcpd with config file {self._config_path}")
cmd = [binary, "-S", self._config_path]
p = Popen(cmd, stderr=PIPE)
error = p.communicate()[1]
# udhcpd takes time to create pid file
sleep(0.1)
pid = _read_pid_file(self._pid_path)
return None if p.pid and pid is not None and _is_running("udhcpd", pid) else error
def _clean_up_configuration(self) -> None:
if os.path.exists(self._config_path):
os.remove(self._config_path)
class NetConf:
_dhcp_handler: Optional[DHCPHandler] = None
_ipt_rules: List[Tuple[str, str, str]] = []
_IPV4_SYS_PATH = "/proc/sys/net/ipv4"
_RUN_PATH = "/var/run"
@classmethod
def _enable_ip4_forwarding(cls) -> None:
with open(f"{cls._IPV4_SYS_PATH}/ip_forward", "w") as f:
f.write("1")
for d in os.listdir(f"{cls._IPV4_SYS_PATH}/conf"):
with open(f"{cls._IPV4_SYS_PATH}/conf/{d}/forwarding", "w") as f:
f.write("1")
@classmethod
def _add_ipt_rule(cls, table: str, chain: str, rule: str) -> None:
cls._ipt_rules.append((table, chain, rule))
args = ["/sbin/iptables", "-t", table, "-A", chain] + rule.split(" ")
logging.debug(" ".join(args))
ret = call(args)
logging.info(f"Return code {ret}")
@classmethod
def _del_ipt_rules(cls) -> None:
for table, chain, rule in cls._ipt_rules:
call(["/sbin/iptables", "-t", table, "-D", chain] + rule.split(" "))
cls._ipt_rules = []
cls.unlock("iptables")
@classmethod
def apply_settings(cls, ip4_address: str, ip4_mask: str, handler: Type["DHCPHandler"],
address_changed: bool) -> None:
if not isinstance(cls._dhcp_handler, handler):
if cls._dhcp_handler is not None:
cls._dhcp_handler.clean_up()
cls._dhcp_handler = handler()
try:
create_bridge("pan1")
except BridgeException as e:
if e.errno != errno.EEXIST:
raise
if address_changed or not cls.locked("netconfig"):
cls._enable_ip4_forwarding()
if have("ip"):
ret = call(["ip", "link", "set", "dev", "pan1", "up"])
if ret != 0:
raise NetworkSetupError("Failed to bring up interface pan1")
ret = call(["ip", "address", "add", "/".join((ip4_address, ip4_mask)), "dev", "pan1"])
if ret != 0:
raise NetworkSetupError(f"Failed to add ip address {ip4_address}"
f"with netmask {ip4_mask}")
elif have('ifconfig'):
ret = call(["ifconfig", "pan1", ip4_address, "netmask", ip4_mask, "up"])
if ret != 0:
raise NetworkSetupError(f"Failed to add ip address {ip4_address}"
f"with netmask {ip4_mask}")
else:
raise NetworkSetupError(
"Neither ifconfig or ip commands are found. Please install net-tools or iproute2")
cls.lock("netconfig")
if address_changed or not cls.locked("iptables"):
cls._del_ipt_rules()
cls._add_ipt_rule("nat", "POSTROUTING", f"-s {ip4_address}/{ip4_mask} -j MASQUERADE")
cls._add_ipt_rule("filter", "FORWARD", "-i pan1 -j ACCEPT")
cls._add_ipt_rule("filter", "FORWARD", "-o pan1 -j ACCEPT")
cls._add_ipt_rule("filter", "FORWARD", "-i pan1 -j ACCEPT")
cls.lock("iptables")
if address_changed or not NetConf.locked("dhcp"):
cls._dhcp_handler.clean_up()
cls._dhcp_handler.apply(ip4_address, ip4_mask)
@classmethod
def clean_up(cls) -> None:
logging.info(cls)
if cls._dhcp_handler:
cls._dhcp_handler.clean_up()
try:
destroy_bridge("pan1")
except BridgeException:
pass
cls.unlock("netconfig")
cls._del_ipt_rules()
@classmethod
def lock(cls, key: str) -> None:
with open(f"{cls._RUN_PATH}/blueman-{key}", "w"):
pass
@classmethod
def unlock(cls, key: str) -> None:
try:
os.unlink(f"{cls._RUN_PATH}/blueman-{key}")
except OSError:
pass
@classmethod
def locked(cls, key: str) -> bool:
return os.path.exists(f"{cls._RUN_PATH}/blueman-{key}")
blueman-2.4.3/blueman/main/NetworkManager.py 0000664 0000000 0000000 00000020303 14650545052 0021014 0 ustar 00root root 0000000 0000000 import gi
import logging
import uuid
from typing import Optional, Callable, Union
from blueman.Service import Service
try:
gi.require_version('NM', '1.0')
except ValueError:
raise ImportError('NM python bindings not found.')
from gi.repository import GLib, GObject, NM, Gio
class NMConnectionError(Exception):
pass
class NMConnectionBase:
conntype: str
def __init__(self, service: Service, reply_handler: Callable[[], None],
error_handler: Callable[[Union[NMConnectionError, GLib.Error]], None]):
if self.conntype not in ('dun', 'panu'):
error_handler(
NMConnectionError(f"Invalid connection type {self.conntype}, should be panu or dun")
)
self.device = service.device
self.bdaddr = self.device['Address']
self.error_handler = error_handler
self.reply_handler = reply_handler
self.connection = None
self.active_connection = None
self.client = NM.Client.new()
self.Config = Gio.Settings(schema_id="org.blueman.gsmsetting", path=f"/org/blueman/gsmsettings/{self.bdaddr}/")
self._statehandler: Optional[int] = None
self.find_or_create_connection()
def _on_connection_added(self, client: NM.Client, result: Gio.AsyncResult, conn_uuid: str) -> None:
try:
self.connection = client.add_connection_finish(result)
except GLib.Error as e:
self.error_handler(e)
self.store_uuid(conn_uuid)
def _on_device_state_changed(self, device: NM.Device, new_state: int, old_state: int, reason: int) -> None:
new = NM.DeviceState(new_state)
old = NM.DeviceState(old_state)
state_reason = NM.DeviceStateReason(reason)
logging.debug(f"New: {new.value_nick} Old: {old.value_nick} Reason: {state_reason.value_nick}")
error_msg = None
if new == NM.DeviceState.FAILED:
error_msg = f"Connection failed with reason: {state_reason.value_nick}"
elif new == NM.DeviceState.ACTIVATED:
logging.debug("Connection successfully activated")
elif (new <= NM.DeviceState.DISCONNECTED or new == NM.DeviceState.DEACTIVATING) and \
(NM.DeviceState.DISCONNECTED < old <= NM.DeviceState.ACTIVATED):
error_msg = f"Connection disconnected with reason {state_reason.value_nick}"
else:
return # Keep checking the state changes
# We are done with state changes
assert self._statehandler is not None
GObject.signal_handler_disconnect(device, self._statehandler)
if error_msg is None:
self.reply_handler()
else:
logging.debug(error_msg)
self.error_handler(NMConnectionError(error_msg))
def activate(self) -> None:
def on_connection_activate(client: NM.Client, result: Gio.AsyncResult) -> None:
try:
self.active_connection = client.activate_connection_finish(result)
except GLib.Error as e:
self.error_handler(e)
device = self.client.get_device_by_iface(self.bdaddr)
if not device:
self.error_handler(NMConnectionError(f"Could not find device {self.bdaddr}"))
elif device.get_state() == NM.DeviceState.ACTIVATED:
self.error_handler(NMConnectionError(f"Device {self.bdaddr} already activated"))
else:
self._statehandler = device.connect('state-changed', self._on_device_state_changed)
self.client.activate_connection_async(self.connection, device, None, None, on_connection_activate)
def deactivate(self) -> None:
def on_connection_deactivate(client: NM.Client, result: Gio.AsyncResult) -> None:
try:
client.deactivate_connection_finish(result)
logging.debug(f"Device {self.bdaddr} deactivated successfully")
self.reply_handler()
self.active_connection = None
except GLib.Error as e:
self.error_handler(e)
self.client.deactivate_connection_async(self.active_connection, None, on_connection_deactivate)
def find_or_create_connection(self) -> None:
if not self.connection_uuid:
self.create_connection()
else:
conn = self.client.get_connection_by_uuid(self.connection_uuid)
if conn is None:
self.create_connection()
else:
logging.debug(f"Found existing connection with uuid {self.connection_uuid}")
self.connection = conn
if self.conntype == 'dun':
settings_gsm = conn.get_setting_gsm()
if settings_gsm.props.apn != self.Config['apn']:
logging.debug(f"Updating apn on connection to {self.Config['apn']}")
settings_gsm.props.apn = self.Config['apn']
if settings_gsm.props.number != self.Config['number']:
logging.debug(f"Updating number on connection to {self.Config['number']}")
settings_gsm.props.number = self.Config['number']
conn.commit_changes(True, None)
# Try to find active connection
for active_conn in self.client.get_active_connections():
conn = active_conn.get_connection()
if conn == self.connection:
self.active_connection = active_conn
@property
def connected(self) -> bool:
if self.active_connection is None:
return False
state = self.active_connection.get_state()
if state == NM.ActiveConnectionState.CONNECTED:
return True
else:
return False
def create_connection(self) -> None:
raise NotImplementedError
def store_uuid(self, conn_uuid: str) -> None:
raise NotImplementedError
@property
def connection_uuid(self) -> str:
raise NotImplementedError
class NMPANConnection(NMConnectionBase):
conntype = 'panu'
def store_uuid(self, conn_uuid: str) -> None:
self.Config['nmpanuuid'] = conn_uuid
@property
def connection_uuid(self) -> str:
# PANU connections are automatically created so attempt to find it
res: str
for conn in self.client.get_connections():
bluetooth_setting = conn.get_setting_bluetooth()
if bluetooth_setting is not None and bluetooth_setting.get_bdaddr() == self.bdaddr:
conn_settings = conn.get_setting_connection()
res = conn_settings.get_uuid()
break
else:
res = self.Config['nmpanuuid']
return res
def create_connection(self) -> None:
conn = NM.SimpleConnection()
conn_id = f"{self.device['Name']} Network"
conn_uuid = str(uuid.uuid4())
conn_sett = NM.SettingConnection(type='bluetooth', id=conn_id, uuid=conn_uuid, autoconnect=False)
conn_sett_bt = NM.SettingBluetooth(type=self.conntype, bdaddr=self.bdaddr)
conn.add_setting(conn_sett)
conn.add_setting(conn_sett_bt)
self.client.add_connection_async(conn, True, None, self._on_connection_added, conn_uuid)
class NMDUNConnection(NMConnectionBase):
conntype = 'dun'
def store_uuid(self, conn_uuid: str) -> None:
self.Config['nmdunuuid'] = conn_uuid
@property
def connection_uuid(self) -> str:
res: str = self.Config['nmdunuuid']
return res
def create_connection(self) -> None:
if not self.Config['apn']:
self.error_handler(NMConnectionError('No apn configured, make sure to configure dialup settings'))
return
conn = NM.SimpleConnection()
conn_id = f"blueman dun for {self.device.display_name}"
conn_uuid = str(uuid.uuid4())
conn_sett = NM.SettingConnection(type='bluetooth', id=conn_id, uuid=conn_uuid, autoconnect=False)
conn_sett_bt = NM.SettingBluetooth(type=self.conntype, bdaddr=self.bdaddr)
conn_sett_gsm = NM.SettingGsm(apn=self.Config['apn'], number=self.Config['number'])
conn.add_setting(conn_sett)
conn.add_setting(conn_sett_bt)
conn.add_setting(conn_sett_gsm)
self.client.add_connection_async(conn, True, None, self._on_connection_added, conn_uuid)
blueman-2.4.3/blueman/main/PPPConnection.py 0000664 0000000 0000000 00000020770 14650545052 0020557 0 ustar 00root root 0000000 0000000 import errno
import logging
import os
import re
import subprocess
import termios
import tty
from typing import Any, List, Iterable, Callable, Optional, Tuple, Union, MutableSequence, IO
from gi.repository import GObject
from gi.repository import GLib
from blueman.Functions import open_rfcomm
from blueman.bluemantyping import GSignals
pppd_errors = {
1: "An immediately fatal error of some kind occurred, such as an essential system call failing, "
"or running out of virtual memory.",
2: "An error was detected in processing the options given, such as two mutually exclusive options being used.",
3: "Pppd is not setuid-root and the invoking user is not root.",
4: "The kernel does not support PPP, for example, the PPP kernel driver is not included or cannot be loaded.",
5: "Pppd terminated because it was sent a SIGINT, SIGTERM or SIGHUP signal.",
6: "The serial port could not be locked.",
7: "The serial port could not be opened.",
8: "The connect script failed (returned a non-zero exit status).",
9: "The command specified as the argument to the pty option could not be run.",
10: "The PPP negotiation failed, that is, it didn't reach the point where at least one network protocol "
"(e.g. IP) was running.",
11: "The peer system failed (or refused) to authenticate itself.",
12: "The link was established successfully and terminated because it was idle.",
13: "The link was established successfully and terminated because the connect time limit was reached.",
14: "Callback was negotiated and an incoming call should arrive shortly.",
15: "The link was terminated because the peer is not responding to echo requests.",
16: "The link was terminated by the modem hanging up.",
17: "The PPP negotiation failed because serial loopback was detected.",
18: "The init script failed (returned a non-zero exit status).",
19: "We failed to authenticate ourselves to the peer."
}
class PPPException(Exception):
pass
class PPPConnection(GObject.GObject):
__gsignals__: GSignals = { # arg: interface name eg. ppp0
'connected': (GObject.SignalFlags.NO_HOOKS, None, (str,)),
'error-occurred': (GObject.SignalFlags.NO_HOOKS, None, (str,))
}
def __init__(self, port: str, number: str = "*99#", apn: str = "", user: str = "", pwd: str = "") -> None:
super().__init__()
self.apn = apn
self.number = number
self.user = user
self.pwd = pwd
self.port = port
self.interface: Optional[str] = None
self.commands: MutableSequence[Union[str, Tuple[str, Callable[[List[str]], None], Iterable[str]]]] = [
"ATZ E0 V1 X4 &C1 +FCLASS=0",
"ATE0",
"AT+GCAP",
(
f"ATD{self.number}",
self.connect_callback,
["CONNECT", "NO CARRIER", "BUSY", "NO ANSWER", "NO DIALTONE", "OK", "ERROR"]
)
]
if self.apn != "":
self.commands.insert(-1, f'AT+CGDCONT=1,"IP","{self.apn}"')
def cleanup(self) -> None:
os.close(self.file)
def connect_callback(self, response: List[str]) -> None:
if "CONNECT" in response:
logging.info("Starting pppd")
self.pppd = subprocess.Popen(
["/usr/sbin/pppd", f"{self.port}", "115200", "defaultroute", "updetach", "usepeerdns"], bufsize=1,
stdout=subprocess.PIPE)
assert self.pppd.stdout is not None
GLib.io_add_watch(self.pppd.stdout, GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP, self.on_pppd_stdout)
GLib.timeout_add(1000, self.check_pppd)
self.cleanup()
else:
self.cleanup()
raise PPPException(f"Bad modem response {response[0]}, expected CONNECT")
def __cmd_response_cb(self, response: Optional[List[str]], exception: Optional[PPPException],
command_id: int) -> None:
if exception:
self.emit("error-occurred", str(exception))
else:
command = self.commands[command_id]
if isinstance(command, tuple):
assert response is not None
try:
command[1](response)
except PPPException as e:
self.emit("error-occurred", str(e))
return
self.send_commands(command_id + 1)
def send_commands(self, start: int = 0) -> None:
try:
item = self.commands[start]
except IndexError:
return
self.send_command(item[0] if isinstance(item, tuple) else item)
self.wait_for_reply(start)
def connect_rfcomm(self) -> None:
self.file = open_rfcomm(self.port, os.O_RDWR)
tty.setraw(self.file)
attrs: List[Any] = termios.tcgetattr(self.file)
attrs[0] &= ~(termios.IGNCR | termios.ICRNL | termios.IUCLC | termios.INPCK | termios.IXON | termios.IXANY |
termios.IGNPAR)
attrs[1] &= ~(termios.OPOST | termios.OLCUC | termios.OCRNL | termios.ONLCR | termios.ONLRET)
attrs[3] &= ~(termios.ICANON | getattr(termios, 'XCASE', 4) | termios.ECHO | termios.ECHOE | termios.ECHONL)
attrs[3] &= ~(termios.ECHO | termios.ECHOE)
attrs[6][termios.VMIN] = 1
attrs[6][termios.VTIME] = 0
attrs[6][termios.VEOF] = 1
attrs[2] &= ~(termios.CBAUD | termios.CSIZE | termios.CSTOPB | termios.CLOCAL | termios.PARENB)
attrs[2] |= (termios.B9600 | termios.CS8 | termios.CREAD | termios.PARENB)
termios.tcsetattr(self.file, termios.TCSANOW, attrs)
termios.tcflush(self.file, termios.TCIOFLUSH)
self.send_commands()
def on_pppd_stdout(self, source: IO[bytes], cond: GLib.IOCondition) -> bool:
if cond & GLib.IO_ERR or cond & GLib.IO_HUP:
return False
line = source.readline().decode('utf-8')
m = re.match(r'Using interface (ppp[0-9]*)', line)
if m:
self.interface = m.groups()[0]
logging.info(line)
return True
def check_pppd(self) -> bool:
status = self.pppd.poll()
if status is not None:
if status == 0:
self.emit("connected", self.interface)
else:
try:
msg = "pppd exited: " + pppd_errors[int(status)]
except KeyError:
msg = "pppd exited with unknown error"
self.emit("error-occurred", msg)
logging.warning(f"pppd exited with status {status:d}")
return False
return True
def send_command(self, command: str) -> None:
logging.info(f"--> {command}")
out = f"{command}\r\n"
os.write(self.file, out.encode("UTF-8"))
termios.tcdrain(self.file)
def on_data_ready(self, _source: int, condition: GLib.IOCondition, command_id: int) -> bool:
if condition & GLib.IO_ERR or condition & GLib.IO_HUP:
GLib.source_remove(self.timeout)
self.__cmd_response_cb(None, PPPException("Socket error"), command_id)
self.cleanup()
return False
try:
self.buffer += os.read(self.file, 1).decode('utf-8')
except OSError as e:
if e.errno == errno.EAGAIN:
logging.error("Got EAGAIN")
return True
else:
self.__cmd_response_cb(None, PPPException("Socket error"), command_id)
logging.exception(e)
self.cleanup()
return False
terminators = self.commands[command_id][2] if isinstance(self.commands[command_id], tuple) else ["OK", "ERROR"]
lines = self.buffer.split("\r\n")
if any(terminator in line for line in lines for terminator in terminators):
lines = [x.strip("\r\n") for x in lines if x != ""]
logging.info(f"<-- {lines}")
self.__cmd_response_cb(lines, None, command_id)
return False
return True
def wait_for_reply(self, command_id: int) -> None:
def on_timeout() -> bool:
GLib.source_remove(self.io_watch)
self.__cmd_response_cb(None, PPPException("Modem initialization timed out"), command_id)
self.cleanup()
return False
self.buffer = ""
self.term_found = False
self.io_watch = GLib.io_add_watch(self.file, GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP, self.on_data_ready,
command_id)
self.timeout = GLib.timeout_add(15000, on_timeout)
blueman-2.4.3/blueman/main/PluginManager.py 0000664 0000000 0000000 00000022664 14650545052 0020635 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import os
import logging
import traceback
import importlib
from types import ModuleType
from typing import Dict, List, Type, TypeVar, Iterable, Optional, Generic
from gi.repository import GObject, Gio
from blueman.Functions import bmexit
from blueman.gui.CommonUi import ErrorDialog
from blueman.plugins.BasePlugin import BasePlugin
from blueman.bluemantyping import GSignals
from blueman.plugins.errors import PluginException
class LoadException(Exception):
pass
_T = TypeVar("_T", bound=BasePlugin)
class PluginManager(GObject.GObject, Generic[_T]):
__gsignals__: GSignals = {
'plugin-loaded': (GObject.SignalFlags.NO_HOOKS, None, (GObject.TYPE_STRING,)),
'plugin-unloaded': (GObject.SignalFlags.NO_HOOKS, None, (GObject.TYPE_STRING,)),
}
def __init__(self, plugin_class: Type[_T], module_path: ModuleType, parent: object) -> None:
super().__init__()
self.__deps: Dict[str, List[str]] = {}
self.__cfls: Dict[str, List[str]] = {}
self._plugins: Dict[str, _T] = {}
self.__classes: Dict[str, Type[_T]] = {}
self.__loaded: List[str] = []
self.parent = parent
self.module_path = module_path
self.plugin_class = plugin_class
@property
def config_list(self) -> List[str]:
return []
def get_classes(self) -> Dict[str, Type[_T]]:
return self.__classes
def get_loaded(self) -> List[str]:
return self.__loaded
def get_dependencies(self) -> Dict[str, List[str]]:
return self.__deps
def get_conflicts(self) -> Dict[str, List[str]]:
return self.__cfls
def load_plugin(self, name: Optional[str] = None, user_action: bool = False) -> None:
if name:
try:
self.__load_plugin(self.__classes[name])
except LoadException:
pass
except Exception:
if user_action:
d = ErrorDialog(_("An error has occurred while loading "
"a plugin. Please notify the developers "
"with the content of this message to our \n"
"website."),
excp=traceback.format_exc())
d.run()
d.destroy()
raise
return
assert self.module_path.__file__ is not None
path = os.path.dirname(self.module_path.__file__)
plugins = []
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith(".py") and not (f.endswith(".pyc") or f.endswith("_.py")):
plugins.append(f[0:-3])
logging.info(plugins)
for plugin in plugins:
try:
importlib.import_module(self.module_path.__name__ + f".{plugin}")
except ImportError:
logging.error(f"Unable to load plugin module {plugin}", exc_info=True)
except PluginException as err:
logging.warning(f"Failed to start plugin {plugin}: {err}")
for cls in self.plugin_class.__subclasses__():
self.__classes[cls.__name__] = cls
if cls.__name__ not in self.__deps:
self.__deps[cls.__name__] = []
if cls.__name__ not in self.__cfls:
self.__cfls[cls.__name__] = []
for c in cls.__depends__:
if c not in self.__deps:
self.__deps[c] = []
self.__deps[c].append(cls.__name__)
for c in cls.__conflicts__:
if c not in self.__cfls:
self.__cfls[c] = []
self.__cfls[c].append(cls.__name__)
if c not in self.__cfls[cls.__name__]:
self.__cfls[cls.__name__].append(c)
cl = self.config_list
for name, cls in self.__classes.items():
for dep in self.__deps[name]:
# plugins that are required by not unloadable plugins are not unloadable too
if not self.__classes[dep].__unloadable__:
cls.__unloadable__ = False
if (cls.__autoload__ or (cl and cls.__name__ in cl)) and \
not (cls.__unloadable__ and cl and "!" + cls.__name__ in cl):
self.__load_plugin(cls)
def disable_plugin(self, plugin: str) -> bool:
return False
def enable_plugin(self, plugin: str) -> bool:
return True
def __load_plugin(self, cls: Type[_T]) -> None:
if cls.__name__ in self.__loaded:
return
for dep in cls.__depends__:
if dep not in self.__loaded:
if dep not in self.__classes:
raise Exception(f"Could not satisfy dependency {cls.__name__} -> {dep}")
try:
self.__load_plugin(self.__classes[dep])
except Exception as e:
logging.exception(e)
raise
for cfl in self.__cfls[cls.__name__]:
if cfl in self.__classes:
if self.__classes[cfl].__priority__ > cls.__priority__ and not self.disable_plugin(cfl) \
and not self.enable_plugin(cls.__name__):
logging.warning(f"Not loading {cls.__name__} because its conflict has higher priority")
return
if cfl in self.__loaded:
if cls.__priority__ > self.__classes[cfl].__priority__ and not self.enable_plugin(cfl):
self.unload_plugin(cfl)
else:
raise LoadException(f"Not loading conflicting plugin {cls.__name__} due to lower priority")
logging.info(f"loading {cls}")
inst = cls(self.parent)
try:
inst._load()
except Exception:
logging.error(f"Failed to load {cls.__name__}", exc_info=True)
if not cls.__unloadable__:
bmexit()
raise # NOTE TO SELF: might cause bugs
else:
self._plugins[cls.__name__] = inst
self.__loaded.append(cls.__name__)
self.emit("plugin-loaded", cls.__name__)
def __getattr__(self, key: str) -> object:
try:
return self._plugins[key]
except KeyError:
return self.__dict__[key]
def unload_plugin(self, name: str) -> None:
if self.__classes[name].__unloadable__:
for d in self.__deps[name]:
self.unload_plugin(d)
if name in self.__loaded:
logging.info(f"Unloading {name}")
try:
inst = self._plugins[name]
inst._unload()
except NotImplementedError:
logging.warning("Plugin cannot be unloaded")
else:
self.__loaded.remove(name)
del self._plugins[name]
self.emit("plugin-unloaded", name)
else:
raise Exception(f"Plugin {name} is not unloadable")
def get_plugins(self) -> Dict[str, _T]:
return self._plugins
_U = TypeVar("_U")
def get_loaded_plugins(self, protocol: Type[_U]) -> Iterable[_U]:
for name in self.__loaded:
plugin = self._plugins[name]
if isinstance(plugin, protocol):
yield plugin
class PersistentPluginManager(PluginManager[_T]):
def __init__(self, plugin_class: Type[_T], module_path: ModuleType, parent: object) -> None:
super().__init__(plugin_class, module_path, parent)
self.__config = Gio.Settings(schema_id="org.blueman.general")
self.__config.connect("changed::plugin-list", self.on_property_changed)
def disable_plugin(self, plugin: str) -> bool:
plugins = self.__config["plugin-list"]
return "!" + plugin in plugins
def enable_plugin(self, plugin: str) -> bool:
plugins = self.__config["plugin-list"]
return plugin in plugins
def set_config(self, plugin: str, state: bool) -> None:
plugins = self.__config["plugin-list"]
if plugin in plugins:
plugins.remove(plugin)
elif "!" + plugin in plugins:
plugins.remove("!" + plugin)
plugins.append(str("!" + plugin) if not state else str(plugin))
self.__config["plugin-list"] = plugins
@property
def config_list(self) -> List[str]:
list: List[str] = self.__config["plugin-list"]
return list
def on_property_changed(self, config: Gio.Settings, key: str) -> None:
for item in config[key]:
disable = item.startswith("!")
if disable:
item = item.lstrip("!")
try:
cls: Type[BasePlugin] = self.get_classes()[item]
if not cls.__unloadable__ and disable:
logging.warning(f"warning: {item} is not unloadable")
elif item in self.get_loaded() and disable:
self.unload_plugin(item)
elif item not in self.get_loaded() and not disable:
try:
self.load_plugin(item, user_action=True)
except Exception as e:
logging.exception(e)
self.set_config(item, False)
except KeyError:
logging.warning(f"warning: Plugin {item} not found")
continue
blueman-2.4.3/blueman/main/PulseAudioUtils.py 0000664 0000000 0000000 00000031472 14650545052 0021174 0 ustar 00root root 0000000 0000000 from ctypes import *
from enum import IntEnum
from typing import Dict, TYPE_CHECKING, List, Callable, Mapping, Optional, Any
from gi.repository import GObject
from gi.repository import GLib
import weakref
import logging
from blueman.gobject import SingletonGObjectMeta
from blueman.bluemantyping import GSignals
try:
libpulse = CDLL("libpulse.so.0")
libpulse_glib = CDLL("libpulse-mainloop-glib.so.0")
except OSError:
raise ImportError("Could not load pulseaudio shared library")
if TYPE_CHECKING:
from ctypes import _FuncPointer, _NamedFuncPointer, _Pointer
from typing_extensions import TypedDict
class CardProfileInfo(TypedDict):
name: str
description: str
n_sinks: int
n_sources: int
priority: int
class CardInfo(TypedDict):
name: str
proplist: Dict[str, str]
owner_module: int
driver: str
index: int
profiles: List[CardProfileInfo]
active_profile: str
pa_glib_mainloop_new = libpulse_glib.pa_glib_mainloop_new
pa_glib_mainloop_new.argtypes = [c_void_p]
pa_glib_mainloop_new.restype = c_void_p
pa_glib_mainloop_get_api = libpulse_glib.pa_glib_mainloop_get_api
pa_glib_mainloop_get_api.restype = c_void_p
pa_glib_mainloop_get_api.argtypes = [c_void_p]
class ContextState(IntEnum):
UNCONNECTED = 0
CONNECTING = 1
AUTHORIZING = 2
SETTING_NAME = 3
READY = 4
FAILED = 5
TERMINATED = 6
class EventType(IntEnum):
SINK = 0x0000
SOURCE = 0x0001
SINK_INPUT = 0x0002
SOURCE_OUTPUT = 0x0003
MODULE = 0x0004
CLIENT = 0x0005
SAMPLE_CACHE = 0x0006
SERVER = 0x0007
CARD = 0x0009
FACILITY_MASK = 0x000F
NEW = 0x0000
CHANGE = 0x0010
REMOVE = 0x0020
TYPE_MASK = 0x0030
# from enum pa_subscription_mask
class SubscriptionMask(IntEnum):
NULL = 0x0000,
SINK = 0x0001,
SOURCE = 0x0002,
INPUT = 0x0004,
SOURCE_OUTPUT = 0x0008,
MODULE = 0x0010,
CLIENT = 0x0020,
SAMPLE_CACHE = 0x0040,
SERVER = 0x0080,
CARD = 0x0200,
ALL = 0x02ff
class NullError(Exception):
pass
class PANotConnected(Exception):
pass
class PaCardProfileInfo(Structure):
_fields_ = [
('name', c_char_p),
('description', c_char_p),
('n_sinks', c_uint32),
('n_sources', c_uint32),
('priority', c_uint32),
]
class PaCardInfo(Structure):
_fields_ = [
('index', c_uint32),
('name', c_char_p),
('owner_module', c_uint32),
('driver', c_char_p),
('n_profiles', c_uint32),
('profiles', POINTER(PaCardProfileInfo)),
('active_profile', POINTER(PaCardProfileInfo)),
('proplist', c_void_p),
]
pa_context_notify_cb_t = CFUNCTYPE(None, c_void_p, py_object)
pa_context_index_cb_t = CFUNCTYPE(None, c_void_p, c_int, py_object)
pa_context_success_cb_t = pa_context_index_cb_t
pa_card_info_cb_t = CFUNCTYPE(None, c_void_p, POINTER(PaCardInfo), c_int, py_object)
pa_context_subscribe_cb_t = CFUNCTYPE(None, c_void_p, c_uint32, c_uint32, c_void_p)
pa_context_set_card_profile_by_name = libpulse.pa_context_set_card_profile_by_name
pa_context_set_card_profile_by_name.restype = c_void_p
pa_context_set_card_profile_by_name.argtypes = [c_void_p, c_char_p, c_char_p, pa_context_success_cb_t, py_object]
pa_context_set_card_profile_by_index = libpulse.pa_context_set_card_profile_by_index
pa_context_set_card_profile_by_index.restype = c_void_p
pa_context_set_card_profile_by_index.argtypes = [c_void_p, c_uint32, c_char_p, pa_context_success_cb_t, py_object]
pa_context_get_card_info_by_index = libpulse.pa_context_get_card_info_by_index
pa_context_get_card_info_by_index.restype = c_void_p
pa_context_get_card_info_by_index.argtypes = [c_void_p, c_uint32, pa_card_info_cb_t, py_object]
pa_context_get_card_info_list = libpulse.pa_context_get_card_info_list
pa_context_get_card_info_list.restype = c_void_p
pa_context_get_card_info_list.argtypes = [c_void_p, pa_card_info_cb_t, py_object]
pa_proplist_to_string_sep = libpulse.pa_proplist_to_string_sep
pa_proplist_to_string_sep.restype = POINTER(c_char)
pa_proplist_to_string_sep.argtypes = [c_void_p, c_char_p]
pa_context_subscribe = libpulse.pa_context_subscribe
pa_context_subscribe.restype = c_void_p
pa_context_subscribe.argtypes = [c_void_p, c_int, pa_context_success_cb_t, py_object]
pa_context_get_state = libpulse.pa_context_get_state
pa_context_get_state.restype = c_int
pa_context_get_state.argtypes = [c_void_p]
pa_xfree = libpulse.pa_xfree
pa_xfree.restype = None
pa_xfree.argtypes = [c_void_p]
pa_context_disconnect = libpulse.pa_context_disconnect
pa_context_disconnect.restype = None
pa_context_disconnect.argtypes = [c_void_p]
pa_context_unref = libpulse.pa_context_unref
pa_context_unref.restype = None
pa_context_unref.argtypes = [c_void_p]
pa_operation_unref = libpulse.pa_operation_unref
pa_operation_unref.restype = None
pa_operation_unref.argtypes = [c_void_p]
pa_context_set_state_callback = libpulse.pa_context_set_state_callback
pa_context_set_state_callback.restype = None
pa_context_set_state_callback.argtypes = [c_void_p, pa_context_notify_cb_t, py_object]
pa_context_connect = libpulse.pa_context_connect
pa_context_connect.restype = c_int
pa_context_connect.argtypes = [c_void_p, c_char_p, c_int, c_void_p]
pa_context_set_subscribe_callback = libpulse.pa_context_set_subscribe_callback
pa_context_set_subscribe_callback.restype = None
pa_context_set_subscribe_callback.argtypes = [c_void_p, pa_context_subscribe_cb_t, c_void_p]
pa_context_new = libpulse.pa_context_new
pa_context_new.restype = c_void_p
pa_context_new.argtypes = [c_void_p, c_char_p]
class PulseAudioUtils(GObject.GObject, metaclass=SingletonGObjectMeta):
__gsignals__: GSignals = {
'connected': (GObject.SignalFlags.NO_HOOKS, None, ()),
'disconnected': (GObject.SignalFlags.NO_HOOKS, None, ()),
'event': (GObject.SignalFlags.NO_HOOKS, None, (int, int)),
}
def check_connected(self) -> None:
if not self.connected:
raise PANotConnected("Connection to PulseAudio daemon is not established")
@staticmethod
def pa_context_event(pa_context: c_void_p, self: "PulseAudioUtils") -> None:
if not self:
return
state = pa_context_get_state(pa_context)
logging.info(state)
if state == ContextState.READY:
self.connected = True
self.emit("connected")
mask = SubscriptionMask.CARD | SubscriptionMask.MODULE
self.simple_callback(lambda x: logging.info(x),
pa_context_subscribe,
mask)
else:
if self.connected:
self.emit("disconnected")
self.connected = False
if self.prev_state == ContextState.READY and state == ContextState.FAILED:
logging.info("Pulseaudio probably crashed, restarting in 5s")
GLib.timeout_add(5000, self.connect_pulseaudio)
self.prev_state = state
def __get_proplist(self, proplist: c_void_p) -> Dict[str, str]:
if proplist:
pla = pa_proplist_to_string_sep(proplist, b"|")
pl = cast(pla, c_char_p)
ls = [prop.decode("UTF-8") for prop in pl.value.split(b"|")] if pl.value else []
del pl
pa_xfree(pla)
else:
ls = []
result = {}
for item in ls:
spl = [x.strip(" \"") for x in item.split("=")]
if len(spl) == 2:
result[spl[0]] = spl[1]
return result
if TYPE_CHECKING:
class _ListCallbackInfo(TypedDict):
cb_info: "_FuncPointer"
handler: Callable[[Optional["_Pointer[PaCardInfo]"], bool], None]
def __list_callback(self, _context: c_void_p, entry_info: "_Pointer[PaCardInfo]", eol: c_int,
info: "_ListCallbackInfo") -> None:
if entry_info:
info["handler"](entry_info, False)
if eol:
info["handler"](None, True)
pythonapi.Py_DecRef(py_object(info))
def __init_list_callback(self, func: Callable[..., c_void_p], cb_type: Callable[[Callable[[c_void_p,
"_Pointer[PaCardInfo]", c_int, "_ListCallbackInfo"], None]], "_FuncPointer"],
handler: Callable[[Optional["_Pointer[PaCardInfo]"], bool], None], *args: Any) -> None:
info = {"cb_info": cb_type(self.__list_callback), "handler": handler}
pythonapi.Py_IncRef(py_object(info))
args += (info["cb_info"], py_object(info))
op = func(self.pa_context, *args)
pa_operation_unref(op)
def simple_callback(self, handler: Callable[[int], None], func: "_NamedFuncPointer", *args: Any) -> None:
def wrapper(_context: c_void_p, res: int, data: "_FuncPointer") -> None:
handler(res)
pythonapi.Py_DecRef(py_object(data))
cb = pa_context_index_cb_t(wrapper)
pythonapi.Py_IncRef(py_object(cb))
args += (cb, py_object(cb))
op = func(self.pa_context, *args)
if not op:
logging.info("Operation failed")
logging.error(func.__name__)
pa_operation_unref(op)
def __card_info(self, card_info: "_Pointer[PaCardInfo]") -> "CardInfo":
return {
"name": card_info[0].name.decode("UTF-8"),
"proplist": self.__get_proplist(card_info[0].proplist),
"owner_module": card_info[0].owner_module,
"driver": card_info[0].driver.decode("UTF-8"),
"index": card_info[0].index,
"profiles": [{
"name": card_info[0].profiles[i].name.decode("UTF-8"),
"description": card_info[0].profiles[i].description.decode("UTF-8"),
"n_sinks": card_info[0].profiles[i].n_sinks,
"n_sources": card_info[0].profiles[i].n_sources,
"priority": card_info[0].profiles[i].priority,
} for i in range(0, card_info[0].n_profiles)],
"active_profile": card_info[0].active_profile[0].name.decode("UTF-8")
}
def list_cards(self, callback: Callable[[Mapping[str, "CardInfo"]], None]) -> None:
self.check_connected()
data: Dict[str, "CardInfo"] = {}
def handler(entry_info: Optional["_Pointer[PaCardInfo]"], end: bool) -> None:
if end:
callback(data)
return
assert entry_info is not None
entry = self.__card_info(entry_info)
data[entry["name"]] = entry
self.__init_list_callback(pa_context_get_card_info_list,
pa_card_info_cb_t, handler)
def get_card(self, card: int, callback: Callable[["CardInfo"], None]) -> None:
self.check_connected()
def handler(entry_info: Optional["_Pointer[PaCardInfo]"], end: bool) -> None:
if end:
return
assert entry_info is not None
callback(self.__card_info(entry_info))
self.__init_list_callback(pa_context_get_card_info_by_index, pa_card_info_cb_t, handler, card)
def set_card_profile(self, card: int, profile: str, callback: Callable[[int], None]) -> None:
self.simple_callback(callback, pa_context_set_card_profile_by_index, card, profile.encode("UTF-8"))
def __event_callback(self, _context: c_void_p, event_type: int, idx: int, _userdata: c_void_p) -> None:
logging.info(f"{event_type} {idx}")
self.emit("event", event_type, idx)
def __init__(self) -> None:
super().__init__()
self.event_cb = pa_context_subscribe_cb_t(self.__event_callback)
self.connected = False
self.ctx_cb = pa_context_notify_cb_t(PulseAudioUtils.pa_context_event)
mainloop = pa_glib_mainloop_new(None)
self.pa_mainloop_api = pa_glib_mainloop_get_api(mainloop)
self.pa_context = None
self.prev_state = 0
self.connect_pulseaudio()
weakref.finalize(self, self._on_delete)
def connect_pulseaudio(self) -> bool:
if not self.connected:
if self.pa_context:
pa_context_unref(self.pa_context)
self.pa_context = pa_context_new(self.pa_mainloop_api, b"Blueman")
if not self.pa_context:
raise NullError("PA Context returned NULL")
self.weak = weakref.proxy(self)
pa_context_set_state_callback(self.pa_context, self.ctx_cb, self.weak)
pa_context_connect(self.pa_context, None, 0, None)
pa_context_set_subscribe_callback(self.pa_context,
self.event_cb,
None)
return False
def _on_delete(self) -> None:
logging.info("Destroying PulseAudioUtils instance")
pa_context_disconnect(self.pa_context)
pa_context_unref(self.pa_context)
self.pa_context = None
del self.ctx_cb
del self.pa_mainloop_api
blueman-2.4.3/blueman/main/Sendto.py 0000664 0000000 0000000 00000025251 14650545052 0017333 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import time
import logging
from gettext import ngettext
from typing import List, Iterable, Optional
from blueman.bluez.Device import Device
from blueman.bluez.errors import BluezDBusException
from blueman.main.Builder import Builder
from blueman.bluemantyping import GSignals
from blueman.bluez.Adapter import Adapter
from blueman.bluez.obex.ObjectPush import ObjectPush
from blueman.bluez.obex.Manager import Manager
from blueman.bluez.obex.Client import Client
from blueman.bluez.obex.Transfer import Transfer
from blueman.Functions import format_bytes
from blueman.main.SpeedCalc import SpeedCalc
from blueman.gui.CommonUi import ErrorDialog
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gdk, Gtk, GObject, GLib, Gio
class Sender(Gtk.Dialog):
__gsignals__: GSignals = {
'result': (GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_BOOLEAN,)),
}
def __init__(self, device: Device, adapter_path: str, files: Iterable[str]) -> None:
super().__init__(
title=_("Bluetooth File Transfer"),
name="BluemanSendTo",
icon_name="blueman",
border_width=5,
default_width=400,
window_position=Gtk.WindowPosition.CENTER,
type_hint=Gdk.WindowTypeHint.DIALOG
)
self.b_cancel = self.add_button(_("_Stop"), Gtk.ResponseType.CLOSE)
self.b_cancel.props.receives_default = True
self.b_cancel.props.use_underline = True
self.b_cancel.connect("clicked", self.on_cancel)
builder = Builder("send-dialog.ui")
grid = builder.get_widget("sendto", Gtk.Grid)
content_area = self.get_content_area()
content_area.add(grid)
self.l_dest = builder.get_widget("l_dest", Gtk.Label)
self.l_file = builder.get_widget("l_file", Gtk.Label)
self.pb = builder.get_widget("pb", Gtk.ProgressBar)
self.pb.props.text = _("Connecting")
self.device = device
self.adapter = Adapter(obj_path=adapter_path)
self.manager = Manager()
self.files: List[Gio.File] = []
self.num_files = 0
self.object_push: Optional[ObjectPush] = None
self.object_push_handlers: List[int] = []
self.transfer: Optional[Transfer] = None
self.total_bytes = 0
self.total_transferred = 0
self._last_bytes = 0
self._last_update = 0.0
self.error_dialog: Optional[ErrorDialog] = None
self.cancelling = False
# bytes transferred on a current transfer
self.transferred = 0
self.speed = SpeedCalc(6)
for file_name in files:
parsed_file = Gio.File.parse_name(file_name)
if not parsed_file.query_exists():
logging.info(f"Skipping non existing file {parsed_file.get_path()}")
continue
file_info = parsed_file.query_info("standard::*", Gio.FileQueryInfoFlags.NONE)
if file_info.get_file_type() == Gio.FileType.DIRECTORY:
logging.info(f"Skipping directory {parsed_file.get_path()}")
continue
self.files.append(parsed_file)
self.num_files += 1
self.total_bytes += file_info.get_size()
if len(self.files) == 0:
self.emit("result", False)
try:
self.client = Client()
self.manager.connect_signal('session-added', self.on_session_added)
self.manager.connect_signal('session-removed', self.on_session_removed)
except GLib.Error as e:
if 'StartServiceByName' in e.message:
logging.debug(e.message)
parent = self.get_toplevel()
assert isinstance(parent, Gtk.Container)
d = ErrorDialog(_("obexd not available"), _("Failed to autostart obex service. Make sure the obex "
"daemon is running"), parent=parent)
d.run()
d.destroy()
self.emit("result", False)
else:
# Fail on anything else
raise
basename = self.files[-1].get_basename()
assert basename is not None
self.l_file.props.label = basename
self.client.connect('session-failed', self.on_session_failed)
logging.info(f"Sending to {device['Address']}")
self.l_dest.props.label = device.display_name
# Stop discovery if discovering and let adapter settle for a second
if self.adapter["Discovering"]:
self.adapter.stop_discovery()
time.sleep(1)
self.create_session()
self.show()
def create_session(self) -> None:
self.client.create_session(self.device['Address'], self.adapter["Address"])
def on_cancel(self, button: Optional[Gtk.Button]) -> None:
self.pb.props.text = _("Cancelling")
if button:
button.props.sensitive = False
if self.object_push:
self.client.remove_session(self.object_push.get_session_path())
self.emit("result", False)
def _update_pb_text(self, speed: float = 0.0, unit: str = "B", eta: Optional[str] = None) -> None:
num = self.num_files - len(self.files) + 1
eta = "∞" if eta is None else eta
text = "%s %d/%d %.2f (%s/s) %s %s" % (_("Sending File"), num, self.num_files, speed, unit, _("ETA:"), eta)
self.pb.set_text(text)
def on_transfer_started(self, _object_push: ObjectPush, transfer_path: str, filename: str) -> None:
if self.total_transferred == 0:
self._update_pb_text(0.0, "B")
self.l_file.props.label = filename
self._last_bytes = 0
self.transferred = 0
self.transfer = Transfer(obj_path=transfer_path)
self.transfer.connect("error", self.on_transfer_error)
self.transfer.connect("progress", self.on_transfer_progress)
self.transfer.connect("completed", self.on_transfer_completed)
def on_transfer_failed(self, _object_push: ObjectPush, error: str) -> None:
self.on_transfer_error(None, str(error))
def on_transfer_progress(self, _transfer: Transfer, progress: int) -> None:
self.transferred = progress
if self._last_bytes == 0:
self.total_transferred += progress
else:
self.total_transferred += (progress - self._last_bytes)
self._last_bytes = progress
tm = time.time()
if tm - self._last_update > 0.5:
spd = self.speed.calc(self.total_transferred)
(size, units) = format_bytes(spd)
try:
x = ((self.total_bytes - self.total_transferred) / spd) + 1
if x > 60:
x /= 60
eta = ngettext("%(minutes)d Minute", "%(minutes)d Minutes", round(x)) % {"minutes": round(x)}
else:
eta = ngettext("%(seconds)d Second", "%(seconds)d Seconds", round(x)) % {"seconds": round(x)}
except ZeroDivisionError:
eta = None
self._update_pb_text(size, units, eta)
self._last_update = tm
self.pb.props.fraction = float(self.total_transferred) / self.total_bytes
def on_transfer_completed(self, _transfer: Transfer) -> None:
del self.files[-1]
self.transfer = None
self.process_queue()
def process_queue(self) -> None:
if len(self.files) > 0:
path = self.files[-1].get_path()
assert path is not None
self.send_file(path)
else:
self.emit("result", True)
def send_file(self, file_path: str) -> None:
logging.info(file_path)
if self.object_push:
self.object_push.send_file(file_path)
def on_transfer_error(self, _transfer: Optional[Transfer], msg: str = "") -> None:
if not self.error_dialog:
self.speed.reset()
parent = self.get_toplevel()
assert isinstance(parent, Gtk.Container)
d = ErrorDialog(msg, _("Error occurred while sending file %s") % self.files[-1].get_basename(),
modal=True, icon_name="blueman", parent=parent, buttons=Gtk.ButtonsType.NONE)
if len(self.files) > 1:
d.add_button(_("Skip"), Gtk.ResponseType.NO)
d.add_button(_("Retry"), Gtk.ResponseType.YES)
d.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
if self.object_push:
self.client.remove_session(self.object_push.get_object_path())
def on_response(dialog: Gtk.Dialog, resp: int) -> None:
dialog.destroy()
self.error_dialog = None
if resp == Gtk.ResponseType.CANCEL:
self.on_cancel(None)
elif resp == Gtk.ResponseType.NO:
finfo = self.files[-1].query_info('standard::*', Gio.FileQueryInfoFlags.NONE)
self.total_bytes -= finfo.get_size()
self.total_transferred -= self.transferred
self.transferred = 0
del self.files[-1]
if not self.object_push:
self.create_session()
self.process_queue()
elif resp == Gtk.ResponseType.YES:
self.total_transferred -= self.transferred
self.transferred = 0
if not self.object_push:
self.create_session()
self.process_queue()
else:
self.on_cancel(None)
d.connect("response", on_response)
d.show()
self.error_dialog = d
def on_session_added(self, _manager: Manager, session_path: str) -> None:
self.object_push = ObjectPush(obj_path=session_path)
self.object_push_handlers.append(self.object_push.connect("transfer-started", self.on_transfer_started))
self.object_push_handlers.append(self.object_push.connect("transfer-failed", self.on_transfer_failed))
self.process_queue()
def on_session_removed(self, _manager: Manager, session_path: str) -> None:
logging.debug(f"Session removed: {session_path}")
if self.object_push:
for handlerid in self.object_push_handlers:
self.object_push.disconnect(handlerid)
self.object_push = None
def on_session_failed(self, _client: Client, msg: BluezDBusException) -> None:
parent = self.get_toplevel()
assert isinstance(parent, Gtk.Container)
d = ErrorDialog(_("Error occurred"), msg.reason.split(None, 1)[1], icon_name="blueman", parent=parent)
d.run()
d.destroy()
self.emit("result", False)
blueman-2.4.3/blueman/main/Services.py 0000664 0000000 0000000 00000007502 14650545052 0017661 0 ustar 00root root 0000000 0000000 import os
import logging
import importlib
import signal
from typing import Optional
from blueman.main.Builder import Builder
import blueman.plugins.services
from blueman.plugins.ServicePlugin import ServicePlugin
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import Gio
class BluemanServices(Gtk.Application):
def __init__(self) -> None:
super().__init__(application_id="org.blueman.Services")
self.window: Optional[Gtk.Window] = None
self.builder = Builder("services-window.ui")
self.Config = Gio.Settings(schema_id="org.blueman.general")
def do_quit(_: object) -> bool:
self.quit()
return False
s = GLib.unix_signal_source_new(signal.SIGINT)
s.set_callback(do_quit)
s.attach()
close_action = Gio.SimpleAction.new("quit", None)
close_action.connect("activate", lambda x, y: self.quit())
self.add_action(close_action)
def do_activate(self) -> None:
if not self.window:
self.window = self.builder.get_widget("window", Gtk.ApplicationWindow)
self.window.set_application(self)
self.notebook = self.builder.get_widget("notebook", Gtk.Notebook)
self.b_apply = self.builder.get_widget("apply", Gtk.Button)
self.b_apply.connect("clicked", self.on_apply_clicked)
self.load_plugins()
self.Config.bind("services-last-item", self.notebook, "page", Gio.SettingsBindFlags.DEFAULT)
self.window.present_with_time(Gtk.get_current_event_time())
def do_startup(self) -> None:
Gtk.Application.do_startup(self)
self.set_accels_for_action("app.quit", ["w", "q", "Escape"])
def option_changed(self) -> None:
rets = [plugin.on_query_apply_state() for plugin in ServicePlugin.instances]
show_apply = False
for ret in rets:
if ret == -1:
show_apply = False
break
assert isinstance(ret, bool)
show_apply = show_apply or ret
self.b_apply.props.sensitive = show_apply
def load_plugins(self) -> None:
path = os.path.dirname(blueman.plugins.services.__file__)
plugins = []
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith(".py") and not (f.endswith(".pyc") or f.endswith("_.py")):
plugins.append(f[0:-3])
plugins.sort()
logging.info(plugins)
for plugin in plugins:
try:
importlib.import_module(f"blueman.plugins.services.{plugin}")
except ImportError:
logging.error(f"Unable to load {plugin} plugin", exc_info=True)
for cls in ServicePlugin.__subclasses__():
# FIXME this should not fail, if it does its a bug in the plugin
try:
inst = cls(self)
except: # noqa: E722
logging.error(f"Failed to create instance of {cls}", exc_info=True)
continue
if not cls.__plugin_info__:
logging.warning(f"Invalid plugin info in {cls}")
else:
(name, icon) = cls.__plugin_info__
inst.on_load()
self.add_page(inst, name, icon)
def add_page(self, inst: ServicePlugin, name: str, icon_name: str) -> None:
box = Gtk.Box(vexpand=True, visible=True, spacing=6)
label = Gtk.Label(label=name, visible=True)
icon = Gtk.Image(icon_name=icon_name, visible=True)
box.add(icon)
box.add(label)
self.notebook.append_page(inst.widget, box)
def on_apply_clicked(self, _button: Gtk.Button) -> None:
for plugin in ServicePlugin.instances:
plugin.on_apply()
self.option_changed()
blueman-2.4.3/blueman/main/SpeedCalc.py 0000664 0000000 0000000 00000002051 14650545052 0017713 0 ustar 00root root 0000000 0000000 import time
from typing import List, Tuple
class SpeedCalc:
def __init__(self, moving_avg: float = 3.0) -> None:
self.moving_avg = moving_avg
self.log: List[Tuple[float, float]] = []
self.reference: float = 0
def calc(self, amount: float) -> float:
if not self.log:
self.reference = amount
amount -= self.reference
curtime = round(time.time(), 2)
self.log.append((curtime, amount))
if len(self.log) >= 2:
total_time = self.log[-1][0] - self.log[0][0]
# print "tt "+str(total_time)
if total_time >= self.moving_avg:
total_amount = self.log[-1][1] - self.log[0][1]
speed = total_amount / total_time
del self.log[0]
return speed
else:
total_amount = self.log[-1][1] - self.log[0][1]
speed = total_amount / total_time
return speed
else:
return 0
def reset(self) -> None:
self.log = []
blueman-2.4.3/blueman/main/Tray.py 0000664 0000000 0000000 00000005770 14650545052 0017022 0 ustar 00root root 0000000 0000000 from importlib import import_module
import logging
import os
import signal
import sys
from blueman.main.DBusProxies import AppletService
from gi.repository import Gio, GLib
from blueman.main.indicators.IndicatorInterface import IndicatorNotAvailable
class BluemanTray(Gio.Application):
def __init__(self) -> None:
super().__init__(application_id="org.blueman.Tray", flags=Gio.ApplicationFlags.FLAGS_NONE)
self._active = False
def do_quit(_: object) -> bool:
self.quit()
return False
s = GLib.unix_signal_source_new(signal.SIGINT)
s.set_callback(do_quit)
s.attach()
def do_activate(self) -> None:
if self._active:
GLib.timeout_add_seconds(1, lambda: os.execv(sys.argv[0], sys.argv))
logging.info("Already running, restarting instance")
return
Gio.bus_watch_name(Gio.BusType.SESSION, 'org.blueman.Applet', Gio.BusNameWatcherFlags.NONE,
self._on_name_appeared, self._on_name_vanished)
self.hold()
def _on_name_appeared(self, _connection: Gio.DBusConnection, name: str, _owner: str) -> None:
logging.debug(f"Applet started on name {name}, showing indicator")
applet = AppletService()
for indicator_name in applet.GetStatusIconImplementations():
indicator_class = getattr(import_module('blueman.main.indicators.' + indicator_name), indicator_name)
try:
self.indicator = indicator_class(self, applet.GetIconName())
break
except IndicatorNotAvailable:
logging.info(f'Indicator "{indicator_name}" is not available')
logging.info(f'Using indicator "{self.indicator.__class__.__name__}"')
applet.connect('g-signal', self.on_signal)
self.indicator.set_tooltip_title(applet.GetToolTipTitle())
self.indicator.set_tooltip_text(applet.GetToolTipText())
self.indicator.set_visibility(applet.GetVisibility())
self.indicator.set_menu(applet.GetMenu())
self._active = True
def _on_name_vanished(self, _connection: Gio.DBusConnection, _name: str) -> None:
logging.debug("Applet shutdown or not available at startup")
self.quit()
def activate_menu_item(self, *indexes: int) -> None:
AppletService().ActivateMenuItem('(ai)', indexes)
def activate_status_icon(self) -> None:
AppletService().Activate()
def on_signal(self, _applet: AppletService, _sender_name: str, signal_name: str, args: GLib.Variant) -> None:
if signal_name == 'IconNameChanged':
self.indicator.set_icon(*args)
elif signal_name == 'ToolTipTitleChanged':
self.indicator.set_tooltip_title(*args)
elif signal_name == 'ToolTipTextChanged':
self.indicator.set_tooltip_text(*args)
elif signal_name == 'VisibilityChanged':
self.indicator.set_visibility(*args)
elif signal_name == 'MenuChanged':
self.indicator.set_menu(*args)
blueman-2.4.3/blueman/main/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0017617 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/applet/ 0000775 0000000 0000000 00000000000 14650545052 0017005 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/applet/BluezAgent.py 0000664 0000000 0000000 00000025624 14650545052 0021430 0 ustar 00root root 0000000 0000000 import logging
from gettext import gettext as _
from html import escape
from xml.etree import ElementTree
from typing import Dict, Optional, overload, Callable, Union, TYPE_CHECKING, Tuple, Any, List
from blueman.bluez.Device import Device
from blueman.bluez.AgentManager import AgentManager
from blueman.Sdp import ServiceUUID
from blueman.gui.Notification import Notification, _NotificationBubble, _NotificationDialog
from blueman.main.Builder import Builder
from blueman.main.DbusService import DbusService, DbusError
from gi.repository import Gio
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from typing_extensions import Literal
class BluezErrorCanceled(DbusError):
_name = "org.bluez.Error.Canceled"
class BluezErrorRejected(DbusError):
_name = "org.bluez.Error.Rejected"
class BluezAgent(DbusService):
__agent_path = '/org/bluez/agent/blueman'
def __init__(self) -> None:
super().__init__(None, "org.bluez.Agent1", self.__agent_path, Gio.BusType.SYSTEM)
self.add_method("Release", (), "", self._on_release)
self.add_method("RequestPinCode", ("o",), "s", self._on_request_pin_code, is_async=True)
self.add_method("DisplayPinCode", ("o", "s"), "", self._on_display_pin_code)
self.add_method("RequestPasskey", ("o",), "u", self._on_request_passkey, is_async=True)
self.add_method("DisplayPasskey", ("o", "u", "q"), "", self._on_display_passkey)
self.add_method("RequestConfirmation", ("o", "u"), "", self._on_request_confirmation, is_async=True)
self.add_method("RequestAuthorization", ("o",), "", self._on_request_authorization, is_async=True)
self.add_method("AuthorizeService", ("o", "s"), "", self._on_authorize_service, is_async=True)
self.add_method("Cancel", (), "", self._on_cancel)
self.dialog: Optional[Gtk.Dialog] = None
self._db: Optional[ElementTree.ElementTree] = None
self._devhandlerids: Dict[str, int] = {}
self._notification: Optional[Union[_NotificationBubble, _NotificationDialog]] = None
self._service_notifications: List[Union[_NotificationBubble, _NotificationDialog]] = []
def register_agent(self) -> None:
logging.info("Register Agent")
self.register()
AgentManager().register_agent(self.__agent_path, "KeyboardDisplay", default=True)
def unregister_agent(self) -> None:
logging.info("Unregister Agent")
self.unregister()
AgentManager().unregister_agent(self.__agent_path)
def build_passkey_dialog(self, device_alias: str, dialog_msg: str, is_numeric: bool
) -> Tuple[Gtk.Dialog, Gtk.Entry]:
def on_insert_text(editable: Gtk.Entry, new_text: str, _new_text_length: int, _position: int) -> None:
if not new_text.isdigit():
editable.stop_emission("insert-text")
builder = Builder("applet-passkey.ui")
dialog = builder.get_widget("dialog", Gtk.Dialog)
dialog.props.icon_name = "blueman"
dev_name = builder.get_widget("device_name", Gtk.Label)
dev_name.set_markup(device_alias)
msg = builder.get_widget("message", Gtk.Label)
msg.set_text(dialog_msg)
pin_entry = builder.get_widget("pin_entry", Gtk.Entry)
show_input = builder.get_widget("show_input_check", Gtk.CheckButton)
if is_numeric:
pin_entry.set_max_length(6)
pin_entry.set_width_chars(6)
pin_entry.connect("insert-text", on_insert_text)
show_input.hide()
else:
pin_entry.set_max_length(16)
pin_entry.set_width_chars(16)
pin_entry.set_visibility(False)
show_input.connect("toggled", lambda x: pin_entry.set_visibility(x.props.active))
accept_button = builder.get_widget("accept", Gtk.Button)
pin_entry.connect("changed", lambda x: accept_button.set_sensitive(x.get_text() != ''))
return dialog, pin_entry
def get_device_string(self, object_path: str) -> str:
device = Device(obj_path=object_path)
return f"{escape(device.display_name)} ({device['Address']})"
@overload
def ask_passkey(self, dialog_msg: str, is_numeric: "Literal[True]", object_path: str, ok: Callable[[int], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
...
@overload
def ask_passkey(self, dialog_msg: str, is_numeric: "Literal[False]", object_path: str, ok: Callable[[str], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
...
def ask_passkey(self, dialog_msg: str, is_numeric: bool, object_path: str, ok: Callable[[Any], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
def passkey_dialog_cb(dialog: Gtk.Dialog, response_id: int) -> None:
if response_id == Gtk.ResponseType.ACCEPT:
ret = pin_entry.get_text()
ok(int(ret) if is_numeric else ret)
else:
err(BluezErrorRejected("Rejected"))
dialog.destroy()
self.dialog = None
dev_str = self.get_device_string(object_path)
notify_message = _("Pairing request for %s") % dev_str
if self.dialog:
logging.info("Agent: Another dialog still active, cancelling")
err(BluezErrorCanceled("Canceled"))
self.dialog, pin_entry = self.build_passkey_dialog(dev_str, dialog_msg, is_numeric)
if not self.dialog:
logging.error("Agent: Failed to build dialog")
err(BluezErrorCanceled("Canceled"))
Notification(_("Bluetooth Authentication"), notify_message, icon_name="blueman").show()
self.dialog.connect("response", passkey_dialog_cb)
self.dialog.present()
# Workaround BlueZ not calling the Cancel method, see #164
def _on_device_property_changed(self, device: Device, key: str, value: Any, path: str) -> None:
if (key == "Paired" and value) or (key == "Connected" and not value):
handlerid = self._devhandlerids.pop(path)
device.disconnect_signal(handlerid)
self._on_cancel()
def _on_release(self) -> None:
logging.info("Agent.Release")
self._on_cancel()
self.unregister()
def _on_cancel(self) -> None:
logging.info("Agent.Cancel")
if self.dialog:
self.dialog.response(Gtk.ResponseType.REJECT)
self._close()
def _close(self) -> None:
if self._notification is not None:
self._notification.close()
self._notification = None
def _on_request_pin_code(self, object_path: str, ok: Callable[[str], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
logging.info("Agent.RequestPinCode")
dialog_msg = _("Enter PIN code for authentication:")
self.ask_passkey(dialog_msg, False, object_path, ok, err)
if self.dialog:
self.dialog.present()
def _on_request_passkey(self, object_path: str, ok: Callable[[int], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
logging.info("Agent.RequestPasskey")
dialog_msg = _("Enter passkey for authentication:")
self.ask_passkey(dialog_msg, True, object_path, ok, err)
if self.dialog:
self.dialog.present()
def _on_display_passkey(self, object_path: str, passkey: int, entered: int) -> None:
logging.info(f"DisplayPasskey ({object_path}, {passkey:d} {entered:d})")
dev = Device(obj_path=object_path)
self._devhandlerids[object_path] = dev.connect_signal("property-changed", self._on_device_property_changed)
key = f"{passkey:06}"
notify_message = _("Pairing passkey for") + f" {self.get_device_string(object_path)}: " \
f"{key[:entered]}{key[entered]}{key[entered + 1:]}"
self._close()
self._notification = Notification("Bluetooth", notify_message, 0, icon_name="blueman")
self._notification.show()
def _on_display_pin_code(self, object_path: str, pin_code: str) -> None:
logging.info(f'DisplayPinCode ({object_path}, {pin_code})')
dev = Device(obj_path=object_path)
self._devhandlerids[object_path] = dev.connect_signal("property-changed", self._on_device_property_changed)
notify_message = _("Pairing PIN code for") + f" {self.get_device_string(object_path)}: {pin_code}"
self._notification = Notification("Bluetooth", notify_message, 0, icon_name="blueman")
self._notification.show()
def _on_request_confirmation(self, object_path: str, passkey: Optional[int], ok: Callable[[], None],
err: Callable[[BluezErrorCanceled], None]) -> None:
def on_confirm_action(action: str) -> None:
if action == "confirm":
ok()
else:
err(BluezErrorCanceled("User canceled pairing"))
logging.info("Agent.RequestConfirmation")
notify_message = _("Pairing request for:") + f"\n{self.get_device_string(object_path)}"
if passkey:
notify_message += "\n" + _("Confirm value for authentication:") + f" {passkey:06}"
actions = [("confirm", _("Confirm")), ("deny", _("Deny"))]
self._notification = Notification("Bluetooth", notify_message, 0, actions, on_confirm_action,
icon_name="blueman")
self._notification.show()
def _on_request_authorization(self, object_path: str, ok: Callable[[], None],
err: Callable[[BluezErrorCanceled], None]) -> None:
self._on_request_confirmation(object_path, None, ok, err)
def _on_authorize_service(self, object_path: str, uuid: str, ok: Callable[[], None],
err: Callable[[BluezErrorRejected], None]) -> None:
def on_auth_action(action: str) -> None:
logging.info(action)
if action == "always":
Device(obj_path=object_path).set("Trusted", True)
if action == "always" or action == "accept":
ok()
else:
err(BluezErrorRejected("Rejected"))
self._service_notifications.remove(n)
logging.info("Agent.Authorize")
dev_str = self.get_device_string(object_path)
service = ServiceUUID(uuid).name
notify_message = \
_("Authorization request for:") + f"\n{dev_str}\n" + _("Service:") + f" {service}"
actions = [("always", _("Always accept")),
("accept", _("Accept")),
("deny", _("Deny"))]
n = Notification(_("Bluetooth Authentication"), notify_message, 0, actions, on_auth_action, icon_name="blueman")
n.show()
self._service_notifications.append(n)
blueman-2.4.3/blueman/main/applet/Makefile.am 0000664 0000000 0000000 00000000316 14650545052 0021041 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/main/applet
blueman_PYTHON = \
BluezAgent.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/main/applet/Makefile.in 0000664 0000000 0000000 00000042436 14650545052 0021063 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/main/applet
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/main/applet
blueman_PYTHON = \
BluezAgent.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/main/applet/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/main/applet/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/main/applet/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0021104 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/indicators/ 0000775 0000000 0000000 00000000000 14650545052 0017657 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/main/indicators/GtkStatusIcon.py 0000664 0000000 0000000 00000006714 14650545052 0023003 0 ustar 00root root 0000000 0000000 from typing import Callable, Iterable, TYPE_CHECKING, overload, cast, Optional, Tuple
import gi
from blueman.main.Tray import BluemanTray
from blueman.main.indicators.IndicatorInterface import IndicatorInterface
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from blueman.Functions import create_menuitem
if TYPE_CHECKING:
from typing_extensions import Protocol
from blueman.plugins.applet.Menu import MenuItemDict, SubmenuItemDict
class MenuItemActivator(Protocol):
def __call__(self, *idx: int) -> None:
...
@overload
def build_menu(items: Iterable[Tuple[int, "MenuItemDict"]], activate: "MenuItemActivator") -> Gtk.Menu:
...
@overload
def build_menu(items: Iterable[Tuple[int, "SubmenuItemDict"]], activate: Callable[[int], None]) -> Gtk.Menu:
...
def build_menu(items: Iterable[Tuple[int, "SubmenuItemDict"]], activate: Callable[..., None]) -> Gtk.Menu:
menu = Gtk.Menu()
for index, item in items:
if 'text' in item and 'icon_name' in item:
gtk_item: Gtk.MenuItem = create_menuitem(item['text'], item['icon_name'])
label = gtk_item.get_child()
assert isinstance(label, Gtk.Label)
if item['markup']:
label.set_markup_with_mnemonic(item['text'])
else:
label.set_text_with_mnemonic(item['text'])
gtk_item.connect('activate', cast(Callable[[Gtk.MenuItem], None], lambda _, idx=index: activate(idx)))
if 'submenu' in item:
gtk_item.set_submenu(
build_menu(enumerate(item['submenu']), # type: ignore
cast(Callable[[int], None], lambda subid, idx=index: activate(idx, subid))))
if 'tooltip' in item:
gtk_item.props.tooltip_text = item['tooltip']
gtk_item.props.sensitive = item['sensitive']
else:
gtk_item = Gtk.SeparatorMenuItem()
gtk_item.show()
menu.append(gtk_item)
return menu
class GtkStatusIcon(IndicatorInterface):
def __init__(self, tray: BluemanTray, icon_name: str) -> None:
self._on_activate = tray.activate_menu_item
self.indicator = Gtk.StatusIcon(icon_name=icon_name)
self.indicator.set_title('blueman')
self.indicator.connect('popup-menu', self.on_popup_menu)
self.indicator.connect('activate', lambda _status_icon: tray.activate_status_icon())
self._tooltip_title = ""
self._tooltip_text = ""
self._menu: Optional[Gtk.Menu] = None
def on_popup_menu(self, _status_icon: Gtk.StatusIcon, _button: int, _activate_time: int) -> None:
if self._menu:
self._menu.popup_at_pointer(None)
def set_icon(self, icon_name: str) -> None:
self.indicator.props.icon_name = icon_name
def set_tooltip_title(self, title: str) -> None:
self._tooltip_title = title
self._update_tooltip()
def set_tooltip_text(self, text: str) -> None:
self._tooltip_text = text
self._update_tooltip()
def _update_tooltip(self) -> None:
text = self._tooltip_title
if self._tooltip_text:
text += "\n" + self._tooltip_text
self.indicator.props.tooltip_markup = text
def set_visibility(self, visible: bool) -> None:
self.indicator.props.visible = visible
def set_menu(self, menu: Iterable["MenuItemDict"]) -> None:
self._menu = build_menu(((item["id"], item) for item in menu), self._on_activate)
blueman-2.4.3/blueman/main/indicators/IndicatorInterface.py 0000664 0000000 0000000 00000001265 14650545052 0023772 0 ustar 00root root 0000000 0000000 from abc import abstractmethod, ABCMeta
from typing import Iterable, TYPE_CHECKING
if TYPE_CHECKING:
from blueman.plugins.applet.Menu import MenuItemDict
class IndicatorNotAvailable(RuntimeError):
pass
class IndicatorInterface(metaclass=ABCMeta):
@abstractmethod
def set_icon(self, icon_name: str) -> None:
...
@abstractmethod
def set_tooltip_title(self, title: str) -> None:
...
@abstractmethod
def set_tooltip_text(self, text: str) -> None:
...
@abstractmethod
def set_visibility(self, visible: bool) -> None:
...
@abstractmethod
def set_menu(self, menu: Iterable["MenuItemDict"]) -> None:
...
blueman-2.4.3/blueman/main/indicators/Makefile.am 0000664 0000000 0000000 00000000405 14650545052 0021712 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/main/indicators
blueman_PYTHON = \
__init__.py \
GtkStatusIcon.py \
IndicatorInterface.py \
StatusNotifierItem.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/main/indicators/Makefile.in 0000664 0000000 0000000 00000042542 14650545052 0021733 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/main/indicators
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/main/indicators
blueman_PYTHON = \
__init__.py \
GtkStatusIcon.py \
IndicatorInterface.py \
StatusNotifierItem.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/main/indicators/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/main/indicators/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/main/indicators/StatusNotifierItem.py 0000664 0000000 0000000 00000017044 14650545052 0024041 0 ustar 00root root 0000000 0000000 from collections import OrderedDict
from typing import Iterable, TYPE_CHECKING, Callable, List, Tuple, Dict, Union, TypeVar, Any
from gi.repository import Gio, GLib, Pango
from blueman.main.DbusService import DbusService
from blueman.main.Tray import BluemanTray
from blueman.main.indicators.IndicatorInterface import IndicatorInterface, IndicatorNotAvailable
if TYPE_CHECKING:
from blueman.plugins.applet.Menu import MenuItemDict, SubmenuItemDict
from blueman.main.indicators.GtkStatusIcon import MenuItemActivator
class MenuService(DbusService):
def __init__(self, on_activate_menu_item: "MenuItemActivator") -> None:
super().__init__(None, "com.canonical.dbusmenu", "/org/blueman/sni/menu", Gio.BusType.SESSION)
self._items: OrderedDict[int, "MenuItemDict"] = OrderedDict()
self._revision = 0
self._revision_advertised = -1
self._on_activate = on_activate_menu_item
self.add_method("GetLayout", ("i", "i", "as"), ("u", "(ia{sv}av)"), self._get_layout)
self.add_method("Event", ("i", "s", "v", "u"), (), self._on_event)
self.add_method("AboutToShow", ("i",), ("b",), lambda _: self._revision > self._revision_advertised)
self.add_method("GetGroupProperties", ("ai", "as"), ("a(ia{sv})",),
lambda ids, props: [(idx, self._render_item(item)) for idx, item in self._iterate_items()
if idx in ids])
self.add_signal("LayoutUpdated", ("u", "i"))
GLib.timeout_add(100, self._advertise_revision)
def set_items(self, items: Iterable["MenuItemDict"]) -> None:
self._items = OrderedDict((item["id"], item) for item in items)
self._revision += 1
def _advertise_revision(self) -> bool:
if self._revision != self._revision_advertised:
self.emit_signal("LayoutUpdated", self._revision, 0)
self._revision_advertised = self._revision
return True
def _get_layout(self, parent_id: int, _recursion_depth: int, _property_names: List[str]
) -> Tuple[int, Tuple[int, Dict[str, GLib.Variant], List[GLib.Variant]]]:
if parent_id == 0:
return self._revision, (0, {}, self._render_menu(((item["id"] << 8, item) for item in self._items.values()),
self._render_submenu))
else:
item = self._items[parent_id >> 8]
if "submenu" in item and _recursion_depth != 0:
return self._revision, (parent_id, self._render_item(item), self._render_submenu(item, parent_id))
return self._revision, (parent_id, self._render_item(item), [])
def _render_submenu(self, item: "MenuItemDict", idx: int) -> List[GLib.Variant]:
if "submenu" in item:
return self._render_menu(enumerate(item["submenu"], idx + 1), lambda _item, _isx: [])
else:
return []
_T = TypeVar("_T", bound="SubmenuItemDict")
def _render_menu(self, items: Iterable[Tuple[int, _T]], submenu_callback: Callable[[_T, int], List[GLib.Variant]]
) -> List[GLib.Variant]:
return [GLib.Variant("(ia{sv}av)", (idx, self._render_item(item), submenu_callback(item, idx)))
for (idx, item) in items]
def _iterate_items(self) -> Iterable[Tuple[int, "SubmenuItemDict"]]:
for item in self._items.values():
yield item["id"] << 8, item
if "submenu" in item:
yield from enumerate(item["submenu"], (item["id"] << 8) + 1)
def _render_item(self, item: Union["MenuItemDict", "SubmenuItemDict"]) -> Dict[str, GLib.Variant]:
if "text" in item and "icon_name" in item:
label = Pango.parse_markup(item["text"], -1, "\0")[2] if item.get("markup", False) else item["text"]
props = {
"label": GLib.Variant("s", label),
"icon-name": GLib.Variant("s", item["icon_name"]),
"enabled": GLib.Variant("b", item["sensitive"]),
}
if "submenu" in item:
props["children-display"] = GLib.Variant("s", "submenu")
return props
else:
return {"type": GLib.Variant("s", "separator")}
def _on_event(self, idx: int, event_id: str, _data: GLib.Variant, _timestamp: int) -> None:
if event_id == "clicked":
if idx % (1 << 8) == 0:
self._on_activate(idx >> 8)
else:
self._on_activate(idx >> 8, idx % (1 << 8) - 1)
class StatusNotifierItemService(DbusService):
Category = "Hardware"
Id = "blueman"
Title = "blueman"
ItemIsMenu = False
def __init__(self, tray: BluemanTray, icon_name: str) -> None:
super().__init__(None, "org.kde.StatusNotifierItem", "/org/blueman/sni", Gio.BusType.SESSION,
{"Category": "s", "Id": "s", "IconName": "s", "Status": "s", "Title": "s",
"ToolTip": "(sa(iiay)ss)", "Menu": "o", "ItemIsMenu": "b"})
self.add_method("Activate", ("i", "i"), "", lambda x, y: tray.activate_status_icon())
self.menu = MenuService(tray.activate_menu_item)
self.IconName = icon_name
self.Status = "Active"
self.ToolTip: Tuple[str, List[Tuple[int, int, List[int]]], str, str] = ("", [], "", "")
self.Menu = "/org/blueman/sni/menu"
self.add_signal("NewIcon", "")
self.add_signal("NewStatus", "s")
self.add_signal("NewToolTip", "")
def register(self) -> None:
self.menu.register()
super().register()
def unregister(self) -> None:
super().unregister()
self.menu.unregister()
class StatusNotifierItem(IndicatorInterface):
_SNI_BUS_NAME = _SNI_INTERFACE_NAME = "org.kde.StatusNotifierWatcher"
def __init__(self, tray: BluemanTray, icon_name: str) -> None:
self._sni = StatusNotifierItemService(tray, icon_name)
self._sni.register()
self._bus = Gio.bus_get_sync(Gio.BusType.SESSION)
watcher_expected: bool
def on_watcher_appeared(*args: Any) -> None:
nonlocal watcher_expected
if watcher_expected:
watcher_expected = False
else:
tray.activate()
Gio.bus_watch_name(Gio.BusType.SESSION, self._SNI_BUS_NAME, Gio.BusNameWatcherFlags.NONE,
on_watcher_appeared, None)
try:
Gio.bus_get_sync(Gio.BusType.SESSION).call_sync(
self._SNI_BUS_NAME, "/StatusNotifierWatcher", self._SNI_INTERFACE_NAME,
"RegisterStatusNotifierItem", GLib.Variant("(s)", ("/org/blueman/sni",)),
None, Gio.DBusCallFlags.NONE, -1)
watcher_expected = True
except GLib.Error as e:
watcher_expected = not e.message.startswith("org.freedesktop.DBusError.ServiceUnknown")
raise IndicatorNotAvailable
def set_icon(self, icon_name: str) -> None:
self._sni.IconName = icon_name
self._sni.emit_signal("NewIcon")
def set_tooltip_title(self, title: str) -> None:
self._sni.ToolTip = ("", [], title, self._sni.ToolTip[3])
self._sni.emit_signal("NewToolTip")
def set_tooltip_text(self, text: str) -> None:
self._sni.ToolTip = ("", [], self._sni.ToolTip[2], text)
self._sni.emit_signal("NewToolTip")
def set_visibility(self, visible: bool) -> None:
self._sni.Status = status = "Active" if visible else "Passive"
self._sni.emit_signal("NewStatus", status)
def set_menu(self, menu: Iterable["MenuItemDict"]) -> None:
self._sni.menu.set_items(menu)
blueman-2.4.3/blueman/main/indicators/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0021756 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/ 0000775 0000000 0000000 00000000000 14650545052 0016255 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/AppletPlugin.py 0000664 0000000 0000000 00000005767 14650545052 0021252 0 ustar 00root root 0000000 0000000 from typing import Tuple, Callable, Set, Any, TYPE_CHECKING
from blueman.plugins.BasePlugin import BasePlugin
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from blueman.main.Applet import BluemanApplet
class AppletPlugin(BasePlugin):
__icon__ = "application-x-addon-symbolic"
def __init__(self, parent: "BluemanApplet"):
super().__init__()
self.parent = parent
if not Gtk.IconTheme.get_default().has_icon(self.__class__.__icon__):
self.__class__.__icon__ = "application-x-addon-symbolic"
self._dbus_service = parent.DbusSvc
self._dbus_methods: Set[str] = set()
self._dbus_signals: Set[str] = set()
def _add_dbus_method(self, name: str, arguments: Tuple[str, ...], return_value: str, method: Callable[..., Any],
is_async: bool = False) -> None:
self._dbus_methods.add(name)
self._dbus_service.add_method(name, arguments, return_value, method, is_async=is_async)
def _add_dbus_signal(self, name: str, signature: str) -> None:
self._dbus_signals.add(name)
self._dbus_service.add_signal(name, signature)
def _emit_dbus_signal(self, name: str, *args: Any) -> None:
self._dbus_service.emit_signal(name, *args)
def on_unload(self) -> None:
pass
def _unload(self) -> None:
super()._unload()
for method in self._dbus_methods:
self._dbus_service.remove_method(method)
for signal in self._dbus_signals:
self._dbus_service.remove_signal(signal)
def _load(self) -> None:
super()._load()
# The applet will run on_manager_state_changed once at startup so until it has we don't.
if self.parent.plugin_run_state_changed:
self.on_manager_state_changed(self.parent.manager_state)
# virtual funcs
def on_manager_state_changed(self, state: bool) -> None:
"""Run when the dbus service appears and disappears. Should only be used to setup, register agents etc"""
pass
def on_adapter_added(self, path: str) -> None:
"""Run when a new adapter is added to the system"""
pass
def on_adapter_removed(self, path: str) -> None:
"""Run when an adapter is removed from the system"""
pass
def on_device_created(self, path: str) -> None:
"""Run when a new device is found"""
pass
def on_device_removed(self, path: str) -> None:
"""Run when a device is removed"""
pass
def on_adapter_property_changed(self, path: str, key: str, value: Any) -> None:
"""Run when a property changes of any adapters. Make sure to distinguish your actions by path"""
pass
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
"""Run when a property changes of any devices. Make sure to distinguish your actions by path"""
pass
# notify when all plugins finished loading
def on_plugins_loaded(self) -> None:
pass
blueman-2.4.3/blueman/plugins/BasePlugin.py 0000664 0000000 0000000 00000006267 14650545052 0020673 0 ustar 00root root 0000000 0000000 import logging
import weakref
from gettext import gettext as _
from typing import List, TYPE_CHECKING, Dict, Tuple, Any, TypeVar, Type, Optional
from gi.repository import Gio
if TYPE_CHECKING:
from typing_extensions import TypedDict
# type is actually Type[T] and default is T but this is not supported https://github.com/python/mypy/issues/3863
class OptionBase(TypedDict):
type: type
default: Any
class Option(OptionBase, total=False):
name: str
desc: str
range: Tuple[int, int]
class GSettings(TypedDict):
schema: str
path: None
else:
Option = dict
class BasePlugin:
__depends__: List[str] = []
__conflicts__: List[str] = []
__priority__ = 0
__description__: str = _("Unspecified")
__author__: str = _("Unspecified")
__unloadable__ = True
__autoload__ = True
__instance__ = None
__gsettings__: "GSettings"
__options__: Dict[str, "Option"] = {}
def __init__(self, *_args: object) -> None:
if self.__options__:
self.__config = Gio.Settings(
schema_id=self.__class__.__gsettings__["schema"],
path=self.__class__.__gsettings__["path"]
)
weakref.finalize(self, self._on_plugin_delete)
_T = TypeVar("_T", bound="BasePlugin")
@classmethod
def get_instance(cls: Type[_T]) -> Optional[_T]:
return cls.__instance__
def _on_plugin_delete(self) -> None:
self.on_delete()
logging.debug(f"Deleting plugin instance {self}")
@classmethod
def is_configurable(cls) -> bool:
res = map(lambda x: (len(x) > 2), cls.__options__.values())
return True in res
def _unload(self) -> None:
self.on_unload()
self.__class__.__instance__ = None
def _load(self) -> None:
try:
self.on_load()
# self.on_manager_state_changed(applet.Manager != None)
self.__class__.__instance__ = self
except Exception as e:
# AppletPlugin.instances.remove(self)
self.__class__.__instance__ = None
logging.exception(e)
raise
# virtual methods
def on_load(self) -> None:
"""Do what is necessary for the plugin to work like add watches or create ui elements"""
pass
def on_unload(self) -> None:
"""Tear down any watches and ui elements created in on_load"""
raise NotImplementedError
def on_delete(self) -> None:
"""Do cleanup that needs to happen when plugin is deleted"""
pass
def get_option(self, key: str) -> Any:
if key not in self.__class__.__options__:
raise KeyError("No such option")
return self.__config[key]
def set_option(self, key: str, value: Any) -> None:
if key not in self.__class__.__options__:
raise KeyError("No such option")
opt = self.__class__.__options__[key]
if type(value) is opt["type"]:
self.__config[key] = value
self.option_changed(key, value)
else:
raise TypeError(f"Wrong type, must be {repr(opt['type'])}")
def option_changed(self, key: str, value: Any) -> None:
pass
blueman-2.4.3/blueman/plugins/Makefile.am 0000664 0000000 0000000 00000000545 14650545052 0020315 0 ustar 00root root 0000000 0000000 SUBDIRS = \
services \
applet \
mechanism \
manager
bluemandir = $(pythondir)/blueman/plugins
blueman_PYTHON = \
ServicePlugin.py \
AppletPlugin.py \
MechanismPlugin.py \
ManagerPlugin.py \
BasePlugin.py \
errors.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/plugins/Makefile.in 0000664 0000000 0000000 00000057204 14650545052 0020332 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/plugins
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = \
services \
applet \
mechanism \
manager
bluemandir = $(pythondir)/blueman/plugins
blueman_PYTHON = \
ServicePlugin.py \
AppletPlugin.py \
MechanismPlugin.py \
ManagerPlugin.py \
BasePlugin.py \
errors.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/plugins/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/plugins/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/plugins/ManagerPlugin.py 0000664 0000000 0000000 00000000511 14650545052 0021355 0 ustar 00root root 0000000 0000000 from typing import TYPE_CHECKING
from blueman.plugins.BasePlugin import BasePlugin
if TYPE_CHECKING:
from blueman.main.Manager import Blueman
class ManagerPlugin(BasePlugin):
def __init__(self, parent: "Blueman"):
super().__init__()
self.parent = parent
def on_unload(self) -> None:
pass
blueman-2.4.3/blueman/plugins/MechanismPlugin.py 0000664 0000000 0000000 00000000635 14650545052 0021716 0 ustar 00root root 0000000 0000000 from typing import TYPE_CHECKING
if TYPE_CHECKING:
from blueman.main.MechanismApplication import MechanismApplication
class MechanismPlugin:
def __init__(self, parent: "MechanismApplication"):
self.parent = parent
self.timer = self.parent.timer
self.confirm_authorization = self.parent.confirm_authorization
self.on_load()
def on_load(self) -> None:
pass
blueman-2.4.3/blueman/plugins/ServicePlugin.py 0000664 0000000 0000000 00000003163 14650545052 0021411 0 ustar 00root root 0000000 0000000 from typing import List, Tuple, Union, TYPE_CHECKING
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from typing_extensions import Literal
from blueman.main.Services import BluemanServices
class ServicePlugin:
_options: List[str]
instances: List["ServicePlugin"] = []
__plugin_info__: Tuple[str, str]
def __init__(self, parent: "BluemanServices"):
ServicePlugin.instances.append(self)
self._options = []
self.parent = parent
self.widget: Gtk.Grid
self.__is_exposed = False
# call when option has changed.
def option_changed_notify(self, option_id: str, state: bool = True) -> None:
if option_id not in self._options:
self._options.append(option_id)
else:
if state:
self._options.remove(option_id)
self.parent.option_changed()
def get_options(self) -> List[str]:
return self._options
def clear_options(self) -> None:
self._options = []
def on_load(self) -> None:
pass
def on_unload(self) -> None:
pass
# return true if apply button should be sensitive or false if not. -1 to force disabled
def on_query_apply_state(self) -> Union[bool, "Literal[-1]"]:
return False
def on_apply(self) -> None:
pass
# called when current plugin's page is selected. The plugin's widget should be shown
def on_enter(self) -> None:
pass
# called when current plugin's page is changed to another. The plugin's widget should be hidden.
def on_leave(self) -> None:
pass
blueman-2.4.3/blueman/plugins/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0020354 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/applet/ 0000775 0000000 0000000 00000000000 14650545052 0017542 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/applet/AuthAgent.py 0000664 0000000 0000000 00000001360 14650545052 0021774 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.main.applet.BluezAgent import BluezAgent
class AuthAgent(AppletPlugin):
__description__ = _("Provides passkey, authentication services for BlueZ daemon")
__icon__ = "blueman-pair-symbolic"
__author__ = "Walmis"
_agent = None
def on_unload(self) -> None:
if self._agent:
self._agent.unregister_agent()
self._agent = None
def on_manager_state_changed(self, state: bool) -> None:
if state:
self._agent = BluezAgent()
self._agent.register_agent()
else:
# At this point bluez already called Release on the agent
self._agent = None
blueman-2.4.3/blueman/plugins/applet/AutoConnect.py 0000664 0000000 0000000 00000004012 14650545052 0022333 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import TYPE_CHECKING, Union, Optional, Any
from gi.repository import GLib
from blueman.Sdp import ServiceUUID
from blueman.bluez.Device import Device
from blueman.gui.Notification import Notification
from blueman.plugins.AppletPlugin import AppletPlugin
if TYPE_CHECKING:
from blueman.main.Applet import BluemanApplet
class AutoConnect(AppletPlugin):
__depends__ = ["DBusService"]
__icon__ = "bluetooth-symbolic"
__author__ = "cschramm"
__description__ = _("Tries to auto-connect to configurable services on start and every 60 seconds.")
__gsettings__ = {
"schema": "org.blueman.plugins.autoconnect",
"path": None
}
__options__ = {
"services": {"type": list, "default": "[]"}
}
def __init__(self, parent: "BluemanApplet"):
super().__init__(parent)
GLib.timeout_add(60000, self._run)
def on_manager_state_changed(self, state: bool) -> None:
if state:
self._run()
def on_adapter_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Powered" and value:
self._run()
def _run(self) -> bool:
for address, uuid in self.get_option('services'):
device = self.parent.Manager.find_device(address)
if device is None or device.get("Connected"):
continue
def reply(dev: Optional[Device] = device, service_name: str = ServiceUUID(uuid).name) -> None:
assert isinstance(dev, Device) # https://github.com/python/mypy/issues/2608
Notification(_("Connected"), _("Automatically connected to %(service)s on %(device)s") %
{"service": service_name, "device": dev.display_name},
icon_name=dev["Icon"]).show()
def err(_reason: Union[Exception, str]) -> None:
pass
self.parent.Plugins.DBusService.connect_service(device.get_object_path(), uuid, reply, err)
return True
blueman-2.4.3/blueman/plugins/applet/ConnectionNotifier.py 0000664 0000000 0000000 00000003361 14650545052 0023716 0 ustar 00root root 0000000 0000000 import logging
from gettext import gettext as _
from typing import Any, Dict, Union
from blueman.bluez.Device import Device
from blueman.gui.Notification import Notification, _NotificationBubble, _NotificationDialog
from blueman.main.BatteryWatcher import BatteryWatcher
from blueman.plugins.AppletPlugin import AppletPlugin
from gi.repository import GLib
class ConnectionNotifier(AppletPlugin):
__author__ = "cschramm"
__icon__ = "bluetooth-symbolic"
__description__ = _("Shows desktop notifications when devices get connected or disconnected.")
_notifications: Dict[str, Union[_NotificationBubble, _NotificationDialog]] = {}
def on_load(self) -> None:
self._battery_watcher = BatteryWatcher(self._on_battery_update)
def on_unload(self) -> None:
del self._battery_watcher
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected":
device = Device(obj_path=path)
if value:
self._notifications[path] = notification = Notification(
device.display_name,
_('Connected'),
icon_name=device["Icon"]
)
notification.show()
else:
Notification(device.display_name, _('Disconnected'), icon_name=device["Icon"]).show()
def _on_battery_update(self, path: str, value: int) -> None:
notification = self._notifications.pop(path, None)
if notification:
try:
notification.set_message(f"{_('Connected')} {value}%")
notification.set_notification_icon("battery")
except GLib.Error:
logging.error("Failed to update notification", exc_info=True)
blueman-2.4.3/blueman/plugins/applet/DBusService.py 0000664 0000000 0000000 00000013330 14650545052 0022272 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Callable, Union, TYPE_CHECKING
from _blueman import RFCOMMError
from gi.repository import GLib
from blueman.Service import Service
from blueman.bluez.errors import BluezDBusException
if TYPE_CHECKING:
from blueman.main.NetworkManager import NMConnectionError
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.bluez.Device import Device
from blueman.services.Functions import get_service
import logging
from blueman.services.meta import SerialService, NetworkService
class RFCOMMConnectedListener:
def on_rfcomm_connected(self, service: SerialService, port: str) -> None:
...
def on_rfcomm_disconnect(self, port: int) -> None:
...
class RFCOMMConnectHandler:
def rfcomm_connect_handler(self, _service: SerialService, _reply: Callable[[str], None],
_err: Callable[[Union[RFCOMMError, GLib.Error]], None]) -> bool:
return False
class ServiceConnectHandler:
def service_connect_handler(self, _service: Service, _ok: Callable[[], None],
_err: Callable[[Union["NMConnectionError", GLib.Error]], None]) -> bool:
return False
def service_disconnect_handler(self, _service: Service, _ok: Callable[[], None],
_err: Callable[[Union["NMConnectionError", GLib.Error]], None]) -> bool:
return False
class DBusService(AppletPlugin):
__unloadable__ = False
__description__ = _("Provides DBus API for other Blueman components")
__author__ = "Walmis"
def on_load(self) -> None:
self._add_dbus_method("QueryPlugins", (), "as", self.parent.Plugins.get_loaded)
self._add_dbus_method("QueryAvailablePlugins", (), "as", lambda: list(self.parent.Plugins.get_classes()))
self._add_dbus_method("SetPluginConfig", ("s", "b"), "", self.parent.Plugins.set_config)
self._add_dbus_method("ConnectService", ("o", "s"), "", self.connect_service, is_async=True)
self._add_dbus_method("DisconnectService", ("o", "s", "d"), "", self._disconnect_service, is_async=True)
self._add_dbus_method("OpenPluginDialog", (), "", self._open_plugin_dialog)
self._add_dbus_signal("PluginsChanged", "")
self.parent.Plugins.connect("plugin-loaded", lambda *args: self._plugins_changed())
self.parent.Plugins.connect("plugin-unloaded", lambda *args: self._plugins_changed())
def _plugins_changed(self) -> None:
self._emit_dbus_signal("PluginsChanged")
def connect_service(self, object_path: str, uuid: str, ok: Callable[[], None],
err: Callable[[Union[BluezDBusException, "NMConnectionError",
RFCOMMError, GLib.Error, str]], None]) -> None:
try:
self.parent.Plugins.RecentConns
except KeyError:
logging.warning("RecentConns plugin is unavailable")
else:
self.parent.Plugins.RecentConns.notify(object_path, uuid)
if uuid == '00000000-0000-0000-0000-000000000000':
device = Device(obj_path=object_path)
device.connect(reply_handler=ok, error_handler=err)
else:
service = get_service(Device(obj_path=object_path), uuid)
assert service is not None
if any(plugin.service_connect_handler(service, ok, err)
for plugin in self.parent.Plugins.get_loaded_plugins(ServiceConnectHandler)):
pass
elif isinstance(service, SerialService):
def reply(rfcomm: str) -> None:
assert isinstance(service, SerialService) # https://github.com/python/mypy/issues/2608
for plugin in self.parent.Plugins.get_loaded_plugins(RFCOMMConnectedListener):
plugin.on_rfcomm_connected(service, rfcomm)
ok()
if not any(plugin.rfcomm_connect_handler(service, reply, err)
for plugin in self.parent.Plugins.get_loaded_plugins(RFCOMMConnectHandler)):
service.connect(reply_handler=lambda port: ok(), error_handler=err)
elif isinstance(service, NetworkService):
service.connect(reply_handler=lambda interface: ok(), error_handler=err)
else:
logging.info("No handler registered")
err("Service not supported\nPossibly the plugin that handles this service is not loaded")
def _disconnect_service(self, object_path: str, uuid: str, port: int, ok: Callable[[], None],
err: Callable[[Union[BluezDBusException, "NMConnectionError",
GLib.Error, str]], None]) -> None:
if uuid == '00000000-0000-0000-0000-000000000000':
device = Device(obj_path=object_path)
device.disconnect(reply_handler=ok, error_handler=err)
else:
service = get_service(Device(obj_path=object_path), uuid)
assert service is not None
if any(plugin.service_disconnect_handler(service, ok, err)
for plugin in self.parent.Plugins.get_loaded_plugins(ServiceConnectHandler)):
pass
elif isinstance(service, SerialService):
service.disconnect(port, reply_handler=ok, error_handler=err)
for plugin in self.parent.Plugins.get_loaded_plugins(RFCOMMConnectedListener):
plugin.on_rfcomm_disconnect(port)
logging.info("Disconnecting rfcomm device")
elif isinstance(service, NetworkService):
service.disconnect(reply_handler=ok, error_handler=err)
def _open_plugin_dialog(self) -> None:
self.parent.Plugins.StandardItems.on_plugins()
blueman-2.4.3/blueman/plugins/applet/DhcpClient.py 0000664 0000000 0000000 00000004533 14650545052 0022136 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import List, Any
from gi.repository import GLib
from blueman.bluez.Network import AnyNetwork, Network
from blueman.gui.Notification import Notification
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.main.DBusProxies import Mechanism
class DhcpClient(AppletPlugin):
__description__ = _("Provides a basic dhcp client for Bluetooth PAN connections.")
__icon__ = "network-workgroup-symbolic"
__author__ = "Walmis"
_any_network = None
def on_load(self) -> None:
self._any_network = AnyNetwork()
self._any_network.connect_signal('property-changed', self._on_network_prop_changed)
self.querying: List[str] = []
self._add_dbus_method("DhcpClient", ("s",), "", self.dhcp_acquire)
def on_unload(self) -> None:
del self._any_network
def _on_network_prop_changed(self, _network: AnyNetwork, key: str, value: Any, object_path: str) -> None:
if key == "Interface":
if value != "":
self.dhcp_acquire(object_path)
def dhcp_acquire(self, object_path: str) -> None:
device = Network(obj_path=object_path)["Interface"]
if device not in self.querying:
self.querying.append(device)
else:
return
if device != "":
def reply(_obj: Mechanism, result: str, _user_data: None) -> None:
logging.info(result)
Notification(_("Bluetooth Network"),
_("Interface %(0)s bound to IP address %(1)s") % {"0": device, "1": result},
icon_name="network-workgroup").show()
self.querying.remove(device)
def err(_obj: Mechanism, result: GLib.Error, _user_data: None) -> None:
logging.warning(result)
Notification(_("Bluetooth Network"), _("Failed to obtain an IP address on %s") % device,
icon_name="network-workgroup").show()
self.querying.remove(device)
Notification(_("Bluetooth Network"), _("Trying to obtain an IP address on %s\nPlease wait…" % device),
icon_name="network-workgroup").show()
m = Mechanism()
m.DhcpClient('(s)', object_path, result_handler=reply, error_handler=err, timeout=120 * 1000)
blueman-2.4.3/blueman/plugins/applet/DisconnectItems.py 0000664 0000000 0000000 00000002664 14650545052 0023217 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Any, TYPE_CHECKING, cast, Callable
from blueman.plugins.AppletPlugin import AppletPlugin
if TYPE_CHECKING:
from blueman.main.Applet import BluemanApplet
class DisconnectItems(AppletPlugin):
__depends__ = ["Menu"]
__icon__ = "bluetooth-disconnected-symbolic"
__author__ = "cschramm"
__description__ = _("Adds disconnect menu items")
def __init__(self, parent: "BluemanApplet"):
super().__init__(parent)
self._menu = self.parent.Plugins.Menu
def on_unload(self) -> None:
self._menu.unregister(self)
def on_manager_state_changed(self, state: bool) -> None:
self._menu.unregister(self)
if state:
self._render()
def on_adapter_removed(self, path: str) -> None:
self._menu.unregister(self)
self._render()
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected":
self._menu.unregister(self)
self._render()
def _render(self) -> None:
for idx, device in enumerate(self.parent.Manager.get_devices()):
if device["Connected"]:
self._menu.add(self, (25, idx), text=_("Disconnect %s") % device.display_name,
icon_name="bluetooth-disconnected-symbolic",
callback=cast(Callable[[], None], lambda dev=device: dev.disconnect()))
blueman-2.4.3/blueman/plugins/applet/DiscvManager.py 0000664 0000000 0000000 00000011020 14650545052 0022451 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Any, Optional
from blueman.bluez.Adapter import Adapter
from blueman.bluez.errors import DBusNoSuchAdapterError
from blueman.plugins.AppletPlugin import AppletPlugin
from gi.repository import GLib
import logging
class DiscvManager(AppletPlugin):
__depends__ = ["Menu"]
__author__ = "Walmis"
__icon__ = "edit-find-symbolic"
__description__ = _(
"Provides a menu item for making the default adapter temporarily visible when it is set to hidden by default")
__gsettings__ = {
"schema": "org.blueman.plugins.discvmanager",
"path": None
}
__options__ = {
"time": {
"type": int,
"default": 60,
"name": _("Discoverable timeout"),
"desc": _("Amount of time in seconds discoverable mode will last"),
"range": (60, 600)
}
}
adapter: Optional[Adapter]
def on_load(self) -> None:
self.item = self.parent.Plugins.Menu.add(self, 20, text=_("_Make Discoverable"), icon_name="edit-find-symbolic",
tooltip=_("Make the default adapter temporarily visible"),
callback=self.on_set_discoverable, visible=False)
self.adapter = None
self.time_left = -1
self.timeout: Optional[int] = None
def on_unload(self) -> None:
self.parent.Plugins.Menu.unregister(self)
del self.item
if self.timeout:
GLib.source_remove(self.timeout)
def on_manager_state_changed(self, state: bool) -> None:
if state:
self.init_adapter()
self.update_menuitems()
else:
self.adapter = None
self.update_menuitems()
def on_update(self) -> bool:
self.item.set_sensitive(False)
if self.time_left >= 1:
self.item.set_text(_("Discoverable… %ss") % self.time_left)
else:
self.item.set_text(_("Discoverable…"))
self.time_left -= 1
return True
def on_set_discoverable(self) -> None:
if self.adapter:
self.adapter.set("Discoverable", True)
self.adapter.set("DiscoverableTimeout", self.get_option("time"))
def init_adapter(self) -> None:
try:
self.adapter = self.parent.Manager.get_adapter()
except DBusNoSuchAdapterError:
self.adapter = None
def on_adapter_added(self, path: str) -> None:
if self.adapter is None:
self.init_adapter()
self.update_menuitems()
def on_adapter_removed(self, path: str) -> None:
logging.info(path)
if self.adapter is None:
# FIXME we appear to call this more than once on adapter removal
logging.warning("Warning: adapter is None")
elif path == self.adapter.get_object_path():
self.init_adapter()
self.update_menuitems()
def on_adapter_property_changed(self, path: str, key: str, value: Any) -> None:
if self.adapter and path == self.adapter.get_object_path():
logging.debug(f"prop {key} {value}")
if key == "DiscoverableTimeout":
if value == 0: # always visible
if self.timeout is not None:
GLib.source_remove(self.timeout)
self.time_left = -1
self.timeout = None
else:
if self.time_left > -1:
if self.timeout is not None:
GLib.source_remove(self.timeout)
self.time_left = value
self.timeout = GLib.timeout_add(1000, self.on_update)
return
elif (key == "Discoverable" and not value) or (key == "Powered" and not value):
logging.info("Stop")
if self.timeout is not None:
GLib.source_remove(self.timeout)
self.time_left = -1
self.timeout = None
self.update_menuitems()
def update_menuitems(self) -> None:
if self.adapter is None:
logging.warning("warning: Adapter is None")
self.item.set_visible(False)
elif (not self.adapter["Discoverable"] or self.adapter["DiscoverableTimeout"] > 0) and self.adapter["Powered"]:
self.item.set_visible(True)
self.item.set_text(_("_Make Discoverable"))
self.item.set_sensitive(True)
else:
self.item.set_visible(False)
blueman-2.4.3/blueman/plugins/applet/ExitItem.py 0000664 0000000 0000000 00000001070 14650545052 0021642 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from blueman.plugins.AppletPlugin import AppletPlugin
class ExitItem(AppletPlugin):
__depends__ = ["Menu"]
__description__ = _("Adds an exit menu item to quit the applet")
__author__ = "Walmis"
__icon__ = "application-exit-symbolic"
def on_load(self) -> None:
self.parent.Plugins.Menu.add(self, 100, text=_("_Exit"), icon_name='application-exit-symbolic',
callback=self.parent.quit)
def on_unload(self) -> None:
self.parent.Plugins.Menu.unregister(self)
blueman-2.4.3/blueman/plugins/applet/GameControllerWakelock.py 0000664 0000000 0000000 00000004742 14650545052 0024521 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import Any
from blueman.bluez.Device import Device
from blueman.Functions import launch
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.errors import UnsupportedPlatformError
import gi
gi.require_version('Gdk', '3.0')
try:
gi.require_version('GdkX11', '3.0')
except ValueError:
raise ImportError("Couldn't find required namespace GdkX11")
from gi.repository import Gdk
from gi.repository import GdkX11
if not isinstance(Gdk.Screen.get_default(), GdkX11.X11Screen):
raise UnsupportedPlatformError('Only X11 platform is supported')
class GameControllerWakelock(AppletPlugin):
__description__ = _("Temporarily suspends the screensaver when a bluetooth game controller is connected.")
__author__ = "bwRavencl"
__icon__ = "input-gaming-symbolic"
def on_load(self) -> None:
self.wake_lock = 0
screen = Gdk.Screen.get_default()
assert screen is not None
window = screen.get_root_window()
assert isinstance(window, GdkX11.X11Window)
self.root_window_id = f"{window.get_xid():#x}"
def on_unload(self) -> None:
if self.wake_lock:
self.wake_lock = 1
self.xdg_screensaver("resume")
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected":
klass = Device(obj_path=path)["Class"] & 0x1fff
if klass == 0x504 or klass == 0x508:
if value:
self.xdg_screensaver("suspend")
else:
self.xdg_screensaver("resume")
def xdg_screensaver(self, action: str) -> None:
command = f"xdg-screensaver {action} {self.root_window_id}"
if action == "resume":
if self.wake_lock <= 0:
self.wake_lock = 0
elif self.wake_lock > 1:
self.wake_lock -= 1
else:
ret = launch(command, sn=False)
if ret:
self.wake_lock -= 1
else:
logging.error(f"{action} failed")
elif action == "suspend":
if self.wake_lock >= 1:
self.wake_lock += 1
else:
ret = launch(command, sn=False)
if ret:
self.wake_lock += 1
else:
logging.error(f"{action} failed")
logging.info(f"Number of locks: {self.wake_lock}")
blueman-2.4.3/blueman/plugins/applet/KillSwitch.py 0000664 0000000 0000000 00000013124 14650545052 0022172 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import os
from typing import Dict, Callable, Any, Optional
from gi.repository import GLib, Gio
import struct
import logging
from blueman.main.DBusProxies import Mechanism
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.applet.PowerManager import PowerManager, PowerStateHandler
from blueman.plugins.applet.StatusIcon import StatusIconVisibilityHandler
RFKILL_TYPE_BLUETOOTH = 2
RFKILL_OP_ADD = 0
RFKILL_OP_DEL = 1
RFKILL_OP_CHANGE = 2
RFKILL_OP_CHANGE_ALL = 3
RFKILL_EVENT_SIZE_V1 = 8
if not os.path.exists('/dev/rfkill'):
raise ImportError('Hardware kill switch not found')
class Switch:
def __init__(self, idx: int, switch_type: int, soft: int, hard: int):
self.idx = idx
self.type = switch_type
self.soft = soft
self.hard = hard
class KillSwitch(AppletPlugin, PowerStateHandler, StatusIconVisibilityHandler):
__author__ = "Walmis"
__description__ = _("Switches Bluetooth killswitch status to match Bluetooth power state. "
"Allows turning Bluetooth back on from an icon that shows its status; "
"provided it isn't unplugged by the system, or physically.")
__depends__ = ["PowerManager"]
__icon__ = "system-shutdown-symbolic"
__gsettings__ = {
"schema": "org.blueman.plugins.killswitch",
"path": None
}
__options__ = {
"checked": {"type": bool, "default": False}
}
_switches: Dict[int, Switch] = {}
_iom = None
_enabled = True
_hardblocked = False
def on_load(self) -> None:
self._connman_proxy: Optional[Gio.DBusProxy] = None
self._connman_watch_id = Gio.bus_watch_name(Gio.BusType.SYSTEM, "net.connman", Gio.BusNameWatcherFlags.NONE,
self._on_connman_appeared, self._on_connman_vanished)
channel = GLib.IOChannel.new_file("/dev/rfkill", "r")
if channel is None:
raise ImportError('Could not access RF kill switch')
self._iom = GLib.io_add_watch(channel, GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP, self.io_event)
def on_unload(self) -> None:
Gio.bus_unwatch_name(self._connman_watch_id)
self._connman_proxy = None
if self._iom:
GLib.source_remove(self._iom)
def _on_connman_appeared(self, connection: Gio.DBusConnection, name: str, owner: str) -> None:
logging.info(f"{name} appeared")
self._connman_proxy = Gio.DBusProxy.new_for_bus_sync(
Gio.BusType.SYSTEM,
Gio.DBusProxyFlags.DO_NOT_AUTO_START,
None,
'net.connman',
'/net/connman/technology/bluetooth',
'net.connman.Technology',
None)
def _on_connman_vanished(self, connection: Gio.DBusConnection, name: str) -> None:
logging.info(f"{name} vanished")
self._connman_proxy = None
def io_event(self, channel: GLib.IOChannel, condition: GLib.IOCondition) -> bool:
if condition & GLib.IO_ERR or condition & GLib.IO_HUP:
return False
fd = channel.unix_get_fd()
data = os.read(fd, RFKILL_EVENT_SIZE_V1)
if len(data) != RFKILL_EVENT_SIZE_V1:
logging.warning(f"Bad rfkill event size: {len(data)}")
return True
(idx, switch_type, op, soft, hard) = struct.unpack("IBBBB", data)
if switch_type != RFKILL_TYPE_BLUETOOTH:
return True
if op == RFKILL_OP_ADD:
self._switches[idx] = Switch(idx, switch_type, soft, hard)
logging.info(f"killswitch registered {idx}")
elif op == RFKILL_OP_DEL:
del self._switches[idx]
logging.info(f"killswitch removed {idx}")
elif op == RFKILL_OP_CHANGE and (self._switches[idx].soft != soft or self._switches[idx].hard != hard):
self._switches[idx] = Switch(idx, switch_type, soft, hard)
logging.info(f"killswitch changed {idx}")
else:
return True
self._enabled = True
self._hardblocked = False
for s in self._switches.values():
self._hardblocked |= s.hard == 1
self._enabled &= (s.soft == 0 and s.hard == 0)
logging.info(f"State: {self._enabled}")
if "StatusIcon" in self.parent.Plugins.get_loaded():
self.parent.Plugins.StatusIcon.query_visibility(delay_hiding=not self._hardblocked)
self.parent.Plugins.PowerManager.update_power_state()
return True
def on_power_state_query(self) -> PowerManager.State:
if self._hardblocked:
return PowerManager.State.OFF_FORCED
elif self._enabled:
return PowerManager.State.ON
else:
return PowerManager.State.OFF
def on_power_state_change_requested(self, _: PowerManager, state: bool, cb: Callable[[bool], None]) -> None:
logging.info(state)
def reply(*_: Any) -> None:
cb(True)
def error(*_: Any) -> None:
cb(False)
if self._connman_proxy:
logging.debug(f"Using connman to set state: {state}")
self._connman_proxy.SetProperty('(sv)', 'Powered', GLib.Variant.new_boolean(state),
result_handler=reply, error_handler=error)
else:
logging.debug(f"Using mechanism to set state: {state}")
Mechanism().SetRfkillState('(b)', state, result_handler=reply, error_handler=error)
def on_query_force_status_icon_visibility(self) -> bool:
# Force status icon to show if Bluetooth is soft-blocked
return not self._hardblocked and not self._enabled
blueman-2.4.3/blueman/plugins/applet/Makefile.am 0000664 0000000 0000000 00000001422 14650545052 0021575 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/plugins/applet
blueman_PYTHON = \
__init__.py \
AuthAgent.py \
AutoConnect.py \
ConnectionNotifier.py \
DBusService.py \
DhcpClient.py \
DisconnectItems.py \
DiscvManager.py \
ExitItem.py \
GameControllerWakelock.py \
KillSwitch.py \
Menu.py \
NetUsage.py \
Networking.py \
NMDUNSupport.py \
NMPANSupport.py \
PowerManager.py \
PPPSupport.py \
RecentConns.py \
SerialManager.py \
ShowConnected.py \
StatusIcon.py \
StandardItems.py \
StatusNotifierItem.py \
TransferService.py
if HAVE_PULSEAUDIO
blueman_PYTHON += PulseAudioProfile.py
endif
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/plugins/applet/Makefile.in 0000664 0000000 0000000 00000044312 14650545052 0021613 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_PULSEAUDIO_TRUE@am__append_1 = PulseAudioProfile.py
subdir = blueman/plugins/applet
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__blueman_PYTHON_DIST) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__blueman_PYTHON_DIST = __init__.py AuthAgent.py AutoConnect.py \
ConnectionNotifier.py DBusService.py DhcpClient.py \
DisconnectItems.py DiscvManager.py ExitItem.py \
GameControllerWakelock.py KillSwitch.py Menu.py NetUsage.py \
Networking.py NMDUNSupport.py NMPANSupport.py PowerManager.py \
PPPSupport.py RecentConns.py SerialManager.py ShowConnected.py \
StatusIcon.py StandardItems.py StatusNotifierItem.py \
TransferService.py PulseAudioProfile.py
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/plugins/applet
blueman_PYTHON = __init__.py AuthAgent.py AutoConnect.py \
ConnectionNotifier.py DBusService.py DhcpClient.py \
DisconnectItems.py DiscvManager.py ExitItem.py \
GameControllerWakelock.py KillSwitch.py Menu.py NetUsage.py \
Networking.py NMDUNSupport.py NMPANSupport.py PowerManager.py \
PPPSupport.py RecentConns.py SerialManager.py ShowConnected.py \
StatusIcon.py StandardItems.py StatusNotifierItem.py \
TransferService.py $(am__append_1)
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/plugins/applet/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/plugins/applet/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/plugins/applet/Menu.py 0000664 0000000 0000000 00000015265 14650545052 0021031 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import List, Union, Iterable, Dict, Optional, Callable, \
TYPE_CHECKING, Tuple, Iterator, Mapping, Sequence
from gi.repository import GLib
from blueman.plugins.AppletPlugin import AppletPlugin
if TYPE_CHECKING:
from typing_extensions import TypedDict
class SubmenuItemDict(TypedDict):
text: str
markup: bool
icon_name: str
sensitive: bool
tooltip: Optional[str]
callback: Callable[[], None]
class MenuItemDictBase(SubmenuItemDict):
id: int
class MenuItemDict(MenuItemDictBase, total=False):
submenu: Iterable["SubmenuItemDict"]
class MenuItem:
def __init__(self, menu_plugin: "Menu", owner: AppletPlugin, priority: Tuple[int, int], text: Optional[str],
markup: bool, icon_name: Optional[str], tooltip: Optional[str], callback: Optional[Callable[[], None]],
submenu_function: Optional[Callable[[], Iterable["SubmenuItemDict"]]], visible: bool, sensitive: bool):
self._menu_plugin = menu_plugin
self._owner = owner
self._priority = priority
self._text = text
self._markup = markup
self._icon_name = icon_name
self._tooltip = tooltip
self._callback = callback
self._submenu_function = submenu_function
self._visible = visible
self._sensitive = sensitive
assert text and icon_name and (callback or submenu_function) or \
not any([text, icon_name, tooltip, callback, submenu_function])
@property
def owner(self) -> AppletPlugin:
return self._owner
@property
def priority(self) -> Tuple[int, int]:
return self._priority
@property
def callback(self) -> Optional[Callable[[], None]]:
return self._callback
@property
def visible(self) -> bool:
return self._visible
def _iter_base(self) -> Iterator[Tuple[str, Union[str, bool]]]:
for key in ['text', 'markup', 'icon_name', 'tooltip', 'sensitive']:
value = getattr(self, '_' + key)
if value is not None:
yield key, value
def __iter__(self) -> Iterator[Tuple[str, Union[int, str, bool, List[Dict[str, Union[str, bool]]]]]]:
yield "id", (self._priority[0] << 8) + self._priority[1]
yield from self._iter_base()
submenu = self.submenu_items
if submenu:
yield 'submenu', [dict(item) for item in submenu]
@property
def submenu_items(self) -> List["SubmenuItem"]:
if not self._submenu_function:
return []
submenu_items = self._submenu_function()
if not submenu_items:
return []
return [SubmenuItem(self._menu_plugin, self._owner, (0, 0), item.get('text'), item.get('markup', False),
item.get('icon_name'), item.get('tooltip'), item.get('callback'), None, True,
item.get('sensitive', True))
for item in submenu_items]
def set_text(self, text: str, markup: bool = False) -> None:
self._text = text
self._markup = markup
self._menu_plugin.on_menu_changed()
def set_icon_name(self, icon_name: str) -> None:
self._icon_name = icon_name
self._menu_plugin.on_menu_changed()
def set_tooltip(self, tooltip: str) -> None:
self._tooltip = tooltip
self._menu_plugin.on_menu_changed()
def set_visible(self, visible: bool) -> None:
self._visible = visible
self._menu_plugin.on_menu_changed()
def set_sensitive(self, sensitive: bool) -> None:
self._sensitive = sensitive
self._menu_plugin.on_menu_changed()
class SubmenuItem(MenuItem):
def __iter__(self) -> Iterator[Tuple[str, Union[str, bool]]]:
yield from self._iter_base()
class Menu(AppletPlugin):
__description__ = _("Provides a menu for the applet and an API for other plugins to manipulate it")
__icon__ = "open-menu-symbolic"
__author__ = "Walmis"
__unloadable__ = False
def on_load(self) -> None:
self.__menuitems: Dict[Tuple[int, int], MenuItem] = {}
self._add_dbus_signal("MenuChanged", "aa{sv}")
self._add_dbus_method("GetMenu", (), "aa{sv}", self._get_menu)
self._add_dbus_method("ActivateMenuItem", ("ai",), "", self._activate_menu_item)
def add(self, owner: AppletPlugin, priority: Union[int, Tuple[int, int]], text: Optional[str] = None,
markup: bool = False, icon_name: Optional[str] = None, tooltip: Optional[str] = None,
callback: Optional[Callable[[], None]] = None,
submenu_function: Optional[Callable[[], Iterable["SubmenuItemDict"]]] = None,
visible: bool = True, sensitive: bool = True) -> MenuItem:
if isinstance(priority, int):
priority = (priority, 0)
assert priority[0] < 256
assert priority[1] < 256
item = MenuItem(self, owner, priority, text, markup, icon_name, tooltip, callback, submenu_function, visible,
sensitive)
self.__menuitems[item.priority] = item
self.on_menu_changed()
return item
def unregister(self, owner: AppletPlugin) -> None:
for item in list(self.__menuitems.values()):
if item.owner == owner:
del self.__menuitems[item.priority]
self.on_menu_changed()
def on_menu_changed(self) -> None:
self._emit_dbus_signal("MenuChanged", self._get_menu())
def _get_menu(self) -> List[Dict[str, GLib.Variant]]:
return self._prepare_menu(dict(self.__menuitems[key])
for key in sorted(self.__menuitems.keys())
if self.__menuitems[key].visible)
def _prepare_menu(self, data: Iterable[Mapping[str, Union[int, str, bool,
Iterable[Mapping[str, Union[str, bool]]]]]]) \
-> List[Dict[str, GLib.Variant]]:
return [{k: self._build_variant(v) for k, v in item.items()} for item in data]
def _build_variant(self, value: Union[int, str, bool, Iterable[Mapping[str, Union[str, bool]]]]) -> GLib.Variant:
if isinstance(value, bool):
return GLib.Variant("b", value)
if isinstance(value, int):
return GLib.Variant("i", value)
if isinstance(value, str):
return GLib.Variant("s", value)
return GLib.Variant("aa{sv}", self._prepare_menu(value))
def _activate_menu_item(self, indexes: Sequence[int]) -> None:
node = self.__menuitems[(indexes[0] >> 8, indexes[0] % (1 << 8))]
for index in list(indexes)[1:]:
node = node.submenu_items[index]
if node.callback:
node.callback()
blueman-2.4.3/blueman/plugins/applet/NMDUNSupport.py 0000664 0000000 0000000 00000002621 14650545052 0022373 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Callable, Union
from gi.repository import GLib
from blueman.Service import Service
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.main.NetworkManager import NMDUNConnection, NMConnectionError
from blueman.Sdp import DIALUP_NET_SVCLASS_ID
from blueman.plugins.applet.DBusService import ServiceConnectHandler
class NMDUNSupport(AppletPlugin, ServiceConnectHandler):
__depends__ = ["DBusService"]
__conflicts__ = ["PPPSupport"]
__icon__ = "modem-symbolic"
__author__ = "infirit"
__description__ = _("Provides support for Dial Up Networking (DUN) with ModemManager and NetworkManager")
__priority__ = 1
def service_connect_handler(self, service: Service, ok: Callable[[], None],
err: Callable[[Union[NMConnectionError, GLib.Error]], None]) -> bool:
if DIALUP_NET_SVCLASS_ID != service.short_uuid:
return False
conn = NMDUNConnection(service, ok, err)
conn.activate()
return True
def service_disconnect_handler(self, service: Service, ok: Callable[[], None],
err: Callable[[Union[NMConnectionError, GLib.Error]], None]) -> bool:
if DIALUP_NET_SVCLASS_ID != service.short_uuid:
return False
conn = NMDUNConnection(service, ok, err)
conn.deactivate()
return True
blueman-2.4.3/blueman/plugins/applet/NMPANSupport.py 0000664 0000000 0000000 00000002632 14650545052 0022365 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Callable, Union
from gi.repository import GLib
from blueman.Service import Service
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.main.NetworkManager import NMPANConnection, NMConnectionError
from blueman.plugins.applet.DBusService import ServiceConnectHandler
from blueman.services.meta import NetworkService
class NMPANSupport(AppletPlugin, ServiceConnectHandler):
__depends__ = ["DBusService"]
__conflicts__ = ["DhcpClient"]
__icon__ = "network-workgroup-symbolic"
__author__ = "infirit"
__description__ = _("Provides support for Personal Area Networking (PAN) introduced in NetworkManager 0.8")
__priority__ = 2
def service_connect_handler(self, service: Service, ok: Callable[[], None],
err: Callable[[Union[NMConnectionError, GLib.Error]], None]) -> bool:
if not isinstance(service, NetworkService):
return False
conn = NMPANConnection(service, ok, err)
conn.activate()
return True
def service_disconnect_handler(self, service: Service, ok: Callable[[], None],
err: Callable[[Union[NMConnectionError, GLib.Error]], None]) -> bool:
if not isinstance(service, NetworkService):
return False
conn = NMPANConnection(service, ok, err)
conn.deactivate()
return True
blueman-2.4.3/blueman/plugins/applet/NetUsage.py 0000664 0000000 0000000 00000030467 14650545052 0021641 0 ustar 00root root 0000000 0000000 from html import escape
import time
import datetime
from gettext import gettext as _, ngettext
import logging
from typing import List, Any, Optional
from blueman.Functions import *
from blueman.main.Builder import Builder
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.bluez.Device import Device
from blueman.bluez.Network import AnyNetwork
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gio
import gi
from blueman.plugins.applet.PPPSupport import PPPConnectedListener
from blueman.bluemantyping import GSignals
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Pango
class MonitorBase(GObject.GObject):
__gsignals__: GSignals = {
'disconnected': (GObject.SignalFlags.NO_HOOKS, None, ()),
'stats': (GObject.SignalFlags.NO_HOOKS, None, (int, int)),
}
def __init__(self, device: Device, interface: str):
super().__init__()
self.interface = interface
self.device = device
self.general_config = Gio.Settings(schema_id="org.blueman.general")
self.config = Gio.Settings(schema_id="org.blueman.plugins.netusage",
path=f"/org/blueman/plugins/netusages/{device['Address']}/")
self.last_tx = 0
self.last_rx = 0
# tx and rx must be cumulative absolute values
def update_stats(self, tx: int, rx: int) -> None:
dtx = tx - self.last_tx
drx = rx - self.last_rx
if dtx < 0:
dtx = 0
if drx < 0:
drx = 0
self.last_rx = rx
self.last_tx = tx
if dtx > 0:
self.config["tx"] += dtx
if drx > 0:
self.config["rx"] += drx
self.emit("stats", self.config["tx"], self.config["rx"])
if not self.device["Address"] in self.general_config["netusage-dev-list"]:
self.general_config["netusage-dev-list"] += [self.device["Address"]]
def disconnect_monitor(self) -> None:
self.emit("disconnected")
class Monitor(MonitorBase):
def __init__(self, device: Device, interface: str):
super().__init__(device, interface)
self.poller = None
self.ppp_port = None
self.poller = GLib.timeout_add(5000, self.poll_stats)
def __del__(self) -> None:
logging.debug("deleting monitor")
def poll_stats(self) -> bool:
try:
with open(f"/sys/class/net/{self.interface}/statistics/tx_bytes") as f:
tx = int(f.readline())
with open(f"/sys/class/net/{self.interface}/statistics/rx_bytes") as f:
rx = int(f.readline())
except OSError:
self.poller = None
self.ppp_port = None
self.disconnect_monitor()
return False
self.update_stats(tx, rx)
return True
class Dialog:
running = False
def __init__(self, plugin: "NetUsage"):
if not Dialog.running:
Dialog.running = True
else:
return
self.plugin = plugin
builder = Builder("net-usage.ui")
self.dialog = builder.get_widget("dialog", Gtk.Dialog)
self.dialog.connect("response", self.on_response)
cr1 = Gtk.CellRendererText()
cr1.props.ellipsize = Pango.EllipsizeMode.END
self._handlerids: List[int] = []
self._handlerids.append(plugin.connect("monitor-added", self.monitor_added))
self._handlerids.append(plugin.connect("monitor-removed", self.monitor_removed))
self._handlerids.append(plugin.connect("stats", self.on_stats))
cr2 = Gtk.CellRendererText()
cr2.props.sensitive = False
cr2.props.style = Pango.Style.ITALIC
self.liststore = Gtk.ListStore(str, str, str, object)
self.e_ul = builder.get_widget("e_ul", Gtk.Entry)
self.e_dl = builder.get_widget("e_dl", Gtk.Entry)
self.e_total = builder.get_widget("e_total", Gtk.Entry)
self.l_started = builder.get_widget("l_started", Gtk.Label)
self.l_duration = builder.get_widget("l_duration", Gtk.Label)
self.b_reset = builder.get_widget("b_reset", Gtk.Button)
self.b_reset.connect("clicked", self.on_reset)
self.cb_device = builder.get_widget("cb_device", Gtk.ComboBox)
self.cb_device.props.model = self.liststore
self.cb_device.connect("changed", self.on_selection_changed)
self.cb_device.pack_start(cr1, True)
self.cb_device.add_attribute(cr1, 'markup', 1)
self.cb_device.pack_start(cr2, False)
self.cb_device.add_attribute(cr2, 'markup', 2)
general_config = Gio.Settings(schema_id="org.blueman.general")
added = False
for d in general_config["netusage-dev-list"]:
for m in plugin.monitors:
if d == m.device["Address"]:
titer = self.liststore.append(
[d, self.get_caption(m.device.display_name, m.device["Address"]),
_("Connected:") + " " + m.interface, m])
if self.cb_device.get_active() == -1:
self.cb_device.set_active_iter(titer)
added = True
break
if not added:
name = d
if self.plugin.parent.Manager:
device = self.plugin.parent.Manager.find_device(d)
if device is None:
pass
else:
name = self.get_caption(device.display_name, device["Address"])
self.liststore.append([d, name, _("Not Connected"), None])
added = False
if len(self.liststore) > 0:
if self.cb_device.get_active() == -1:
self.cb_device.set_active(0)
else:
msg = _("No usage statistics are available yet. Try establishing a connection first and "
"then check this page.")
d = Gtk.MessageDialog(parent=self.dialog, modal=True, type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.CLOSE, text=msg)
d.props.icon_name = "blueman"
d.run()
d.destroy()
self.on_response(None, None)
return
self.dialog.show()
def on_response(self, _dialog: Optional[Gtk.Dialog], _response: Optional[int]) -> None:
for sigid in self._handlerids:
self.plugin.disconnect(sigid)
self._handlerids = []
Dialog.running = False
self.dialog.destroy()
def update_time(self) -> None:
time = self.config["time"]
if time:
self.datetime = datetime.datetime.fromtimestamp(time)
self.l_started.props.label = str(self.datetime)
delta = datetime.datetime.now() - self.datetime
d = ngettext("day", "days", delta.days)
h = ngettext("hour", "hours", delta.seconds // 3600)
m = ngettext("minute", "minutes", delta.seconds % 3600 // 60)
self.l_duration.props.label = _("%d %s %d %s and %d %s") % (
delta.days, d, delta.seconds // 3600, h, delta.seconds % 3600 // 60, m)
else:
self.l_started.props.label = _("Unknown")
self.l_duration.props.label = _("Unknown")
def on_selection_changed(self, cb: Gtk.ComboBox) -> None:
titer = cb.get_active_iter()
assert titer is not None
(addr,) = self.liststore.get(titer, 0)
self.config = Gio.Settings(schema_id="org.blueman.plugins.netusage",
path=f"/org/blueman/plugins/netusages/{addr}/")
self.update_counts(self.config["tx"], self.config["rx"])
self.update_time()
def get_caption(self, name: str, address: str) -> str:
return f"{escape(name)}\n{address}"
def update_counts(self, tx: int, rx: int) -> None:
tx = int(tx)
rx = int(rx)
(num, suffix) = format_bytes(tx)
self.e_ul.props.text = f"{num:.2f} {suffix}"
(num, suffix) = format_bytes(rx)
self.e_dl.props.text = f"{num:.2f} {suffix}"
(num, suffix) = format_bytes(int(tx) + int(rx))
self.e_total.props.text = f"{num:.2f} {suffix}"
self.update_time()
def on_reset(self, _button: Gtk.Button) -> None:
d = Gtk.MessageDialog(parent=self.dialog, modal=True, type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.YES_NO,
text=_("Are you sure you want to reset the counter?"))
res = d.run()
d.destroy()
if res == Gtk.ResponseType.YES:
self.config["rx"] = 0
self.config["tx"] = 0
self.config["time"] = int(time.time())
self.update_counts(0, 0)
def on_stats(self, _parent: "NetUsage", monitor: Monitor, tx: int, rx: int) -> None:
titer = self.cb_device.get_active_iter()
assert titer is not None
(mon,) = self.liststore.get(titer, 3)
if mon == monitor:
self.update_counts(tx, rx)
def monitor_added(self, _parent: "NetUsage", monitor: Monitor) -> None:
for row in self.liststore:
titer = row.iter
(val,) = self.liststore.get(titer, 0)
if val == monitor.device["Address"]:
caption = self.get_caption(monitor.device.display_name, monitor.device["Address"])
self.liststore.set(titer, 1, caption, 2, _("Connected:") + " " + monitor.interface, 3, monitor)
return
self.liststore.append(
[monitor.device["Address"], self.get_caption(monitor.device.display_name, monitor.device["Address"]),
_("Connected:") + " " + monitor.interface, monitor]
)
def monitor_removed(self, _parent: "NetUsage", monitor: Monitor) -> None:
for row in self.liststore:
titer = row.iter
(val,) = self.liststore.get(titer, 0)
if val == monitor.device["Address"]:
caption = self.get_caption(monitor.device.display_name, monitor.device["Address"])
self.liststore.set(titer, 1, caption, 2, _("Not Connected"), 3, None)
return
class NetUsage(AppletPlugin, GObject.GObject, PPPConnectedListener):
__depends__ = ["Menu"]
__icon__ = "network-wireless-symbolic"
__description__ = _("Allows you to monitor your (mobile broadband) network traffic usage. Useful for limited "
"data access plans. This plugin tracks every device separately.")
__author__ = "Walmis"
__autoload__ = False
__gsignals__: GSignals = {
'monitor-added': (GObject.SignalFlags.NO_HOOKS, None, (Monitor,)),
'monitor-removed': (GObject.SignalFlags.NO_HOOKS, None, (Monitor,)),
# monitor, tx, rx
'stats': (GObject.SignalFlags.NO_HOOKS, None, (Monitor, int, int)),
}
_any_network = None
def on_load(self) -> None:
GObject.GObject.__init__(self)
self.monitors: List[Monitor] = []
self._any_network = AnyNetwork()
self._any_network.connect_signal('property-changed', self._on_network_property_changed)
self.parent.Plugins.Menu.add(self, 84, text=_("Network _Usage"), icon_name="network-wireless-symbolic",
tooltip=_("Shows network traffic usage"), callback=self.activate_ui)
def _on_network_property_changed(self, _network: AnyNetwork, key: str, value: Any, path: str) -> None:
if key == "Interface" and value != "":
d = Device(obj_path=path)
self.monitor_interface(d, value)
def activate_ui(self) -> None:
Dialog(self)
def on_unload(self) -> None:
del self._any_network
self.parent.Plugins.Menu.unregister(self)
def monitor_interface(self, device: Device, interface: str) -> None:
m = Monitor(device, interface)
self.monitors.append(m)
m.connect("stats", self.on_stats)
m.connect("disconnected", self.on_monitor_disconnected)
self.emit("monitor-added", m)
def on_ppp_connected(self, device: Device, _rfcomm: str, ppp_port: str) -> None:
self.monitor_interface(device, ppp_port)
def on_monitor_disconnected(self, monitor: Monitor) -> None:
self.monitors.remove(monitor)
self.emit("monitor-removed", monitor)
def on_stats(self, monitor: Monitor, tx: int, rx: int) -> None:
self.emit("stats", monitor, tx, rx)
blueman-2.4.3/blueman/plugins/applet/Networking.py 0000664 0000000 0000000 00000006275 14650545052 0022255 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Dict, Optional
from gi.repository import GLib
from gi.repository import Gio
from blueman.bluez.NetworkServer import NetworkServer
from blueman.main.DBusProxies import Mechanism
from blueman.main.DNSServerProvider import DNSServerProvider
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.gui.CommonUi import ErrorDialog
import logging
class Networking(AppletPlugin):
__icon__ = "network-workgroup-symbolic"
__description__ = _("Manages local network services, like NAP bridges")
__author__ = "Walmis"
_dns_server_provider: Optional[DNSServerProvider] = None
def on_load(self) -> None:
self._registered: Dict[str, bool] = {}
self.Config = Gio.Settings(schema_id="org.blueman.network")
self.Config.connect("changed", self.on_config_changed)
self._apply_nap_settings()
self._dns_server_provider = DNSServerProvider()
self._dns_server_provider.connect("changed", lambda _provider: self._apply_nap_settings())
def on_manager_state_changed(self, state: bool) -> None:
if state:
self.update_status()
def _apply_nap_settings(self) -> None:
if not self.Config["nap-enable"] or self.Config["ip4-address"] is None:
return
def reply(_obj: Mechanism, _result: None, _user_data: None) -> None:
pass
def err(_obj: Mechanism, result: GLib.Error, _user_data: None) -> None:
d = ErrorDialog("Failed to apply network settings",
"You might not be able to connect to the Bluetooth network via this machine",
result,
margin_left=9)
d.run()
d.destroy()
m = Mechanism()
m.EnableNetwork('(sssb)', self.Config["ip4-address"], self.Config["ip4-netmask"], self.Config["dhcp-handler"],
False, result_handler=reply, error_handler=err)
def on_unload(self) -> None:
for adapter_path in self._registered:
s = NetworkServer(obj_path=adapter_path)
s.unregister("nap")
self._registered = {}
del self.Config
del self._dns_server_provider
def on_adapter_added(self, path: str) -> None:
self.update_status()
def update_status(self) -> None:
self.set_nap(self.Config["nap-enable"])
def on_config_changed(self, config: Gio.Settings, key: str) -> None:
if key == "nap-enable":
self.set_nap(config[key])
def set_nap(self, on: bool) -> None:
logging.info(f"set nap {on}")
if self.parent.manager_state:
adapters = self.parent.Manager.get_adapters()
for adapter in adapters:
object_path = adapter.get_object_path()
registered = self._registered.setdefault(object_path, False)
s = NetworkServer(obj_path=object_path)
if on and not registered:
s.register("nap", "pan1")
self._registered[object_path] = True
elif not on and registered:
s.unregister("nap")
self._registered[object_path] = False
blueman-2.4.3/blueman/plugins/applet/PPPSupport.py 0000664 0000000 0000000 00000007237 14650545052 0022161 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import TYPE_CHECKING, Callable, Union
from _blueman import RFCOMMError
from blueman.services.meta.SerialService import SerialService
from blueman.bluez.Device import Device
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.gui.Notification import Notification
from blueman.main.DBusProxies import Mechanism
from gi.repository import GLib
from gi.repository import Gio
import subprocess
import logging
from blueman.plugins.applet.DBusService import RFCOMMConnectHandler
from blueman.services import DialupNetwork
if TYPE_CHECKING:
from blueman.main.Applet import BluemanApplet
class PPPConnectedListener:
def on_ppp_connected(self, device: Device, rfcomm: str, ppp_port: str) -> None:
...
class Connection:
def __init__(self, applet: "BluemanApplet", service: DialupNetwork, port: int,
ok: Callable[[str], None], err: Callable[[GLib.Error], None]):
self.reply_handler = ok
self.error_handler = err
self.service = service
self.port = port
self.parent = applet
stdout, stderr = subprocess.Popen(['ps', 'ax', '-o', 'pid,args'], stdout=subprocess.PIPE).communicate()
if b'ModemManager' in stdout:
timeout = 10
logging.info(f"ModemManager is running, delaying connection {timeout} sec for it to complete probing")
GLib.timeout_add_seconds(timeout, self.connect)
else:
self.connect()
def connect(self) -> bool:
c = Gio.Settings(schema_id="org.blueman.gsmsetting",
path=f"/org/blueman/gsmsettings/{self.service.device['Address']}/")
m = Mechanism()
m.PPPConnect('(uss)', self.port, c["number"], c["apn"], result_handler=self.on_connected,
error_handler=self.on_error)
return False
def on_error(self, _obj: Mechanism, result: GLib.Error, _user_data: None) -> None:
logging.info(f"Failed {result}")
self.error_handler(result)
def _connect() -> bool:
self.service.disconnect(self.port)
return False
GLib.timeout_add(1000, _connect)
def on_connected(self, _obj: Mechanism, result: str, _user_data: None) -> None:
rfcomm_dev = f"/dev/rfcomm{self.port:d}"
self.reply_handler(rfcomm_dev)
for plugin in self.parent.Plugins.get_loaded_plugins(PPPConnectedListener):
plugin.on_ppp_connected(self.service.device, rfcomm_dev, result)
msg = _("Successfully connected to DUN service on %(0)s.\n"
"Network is now available through %(1)s") % \
{"0": self.service.device.display_name, "1": result}
Notification(_("Connected"), msg, icon_name="network-wireless-symbolic").show()
class PPPSupport(AppletPlugin, RFCOMMConnectHandler):
__depends__ = ["DBusService"]
__description__ = _("Provides basic support for connecting to the internet via DUN profile.")
__author__ = "Walmis"
__icon__ = "modem-symbolic"
__priority__ = 0
def rfcomm_connect_handler(self, service: SerialService, reply: Callable[[str], None],
err: Callable[[Union[RFCOMMError, GLib.Error]], None]) -> bool:
if isinstance(service, DialupNetwork):
def local_reply(port: int) -> None:
assert isinstance(service, DialupNetwork) # https://github.com/python/mypy/issues/2608
Connection(self.parent, service, port, reply, err)
service.connect(reply_handler=local_reply, error_handler=err)
logging.info("Connecting rfcomm device")
return True
else:
return False
blueman-2.4.3/blueman/plugins/applet/PowerManager.py 0000664 0000000 0000000 00000016510 14650545052 0022506 0 ustar 00root root 0000000 0000000 from enum import Enum
from gettext import gettext as _
import logging
from typing import Callable, Any, Optional
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.bluez.Adapter import Adapter
from gi.repository import GLib
from blueman.plugins.applet.StatusIcon import StatusIconProvider
class PowerStateListener:
def on_power_state_changed(self, manager: "PowerManager", state: bool) -> None:
return
class PowerStateHandler:
def on_power_state_query(self) -> "PowerManager.State":
return PowerManager.State.ON
def on_power_state_change_requested(self, manager: "PowerManager", state: bool,
cb: Callable[[bool], None]) -> None:
...
class PowerManager(AppletPlugin, StatusIconProvider):
__depends__ = ["Menu"]
__unloadable__ = True
__description__ = _("Controls Bluetooth adapter power states")
__author__ = "Walmis"
__icon__ = "gnome-power-manager-symbolic"
class State(Enum):
ON = 2
OFF = 1
OFF_FORCED = 0
def on_load(self) -> None:
self.item = self.parent.Plugins.Menu.add(self, 1, text=_("Turn Bluetooth _Off"), markup=True,
icon_name="bluetooth-disabled-symbolic",
tooltip=_("Turn off all adapters"),
callback=self.on_bluetooth_toggled)
self.adapter_state = True
self.current_state = True
self.request_in_progress = False
self._add_dbus_signal("BluetoothStatusChanged", "b")
self._add_dbus_method("SetBluetoothStatus", ("b",), "", self.request_power_state)
self._add_dbus_method("GetBluetoothStatus", (), "b", self.get_bluetooth_status)
def on_unload(self) -> None:
self.parent.Plugins.Menu.unregister(self)
@property
def CurrentState(self) -> bool:
return self.current_state
def on_manager_state_changed(self, state: bool) -> None:
if state:
def timeout() -> bool:
self.request_power_state(self.get_adapter_state())
return False
GLib.timeout_add(1000, timeout)
def get_adapter_state(self) -> bool:
adapters = self.parent.Manager.get_adapters()
for adapter in adapters:
if not adapter["Powered"]:
return False
return bool(adapters)
def set_adapter_state(self, state: bool) -> None:
try:
logging.info(state)
adapters = self.parent.Manager.get_adapters()
for adapter in adapters:
adapter.set("Powered", state)
self.adapter_state = state
except Exception:
logging.error("Exception occurred", exc_info=True)
class Callback:
def __init__(self, parent: "PowerManager", state: bool):
self.parent = parent
self.num_cb = 0
self.called = 0
self.state = state
self.success = False
self.timer = GLib.timeout_add(5000, self.timeout)
def __call__(self, result: bool) -> None:
self.called += 1
if result:
self.success = True
self.check()
def check(self) -> None:
if self.called == self.num_cb:
GLib.source_remove(self.timer)
logging.info("callbacks done")
self.parent.set_adapter_state(self.state)
self.parent.update_power_state()
self.parent.request_in_progress = False
def timeout(self) -> bool:
logging.info("Timeout reached while setting power state")
self.parent.update_power_state()
self.parent.request_in_progress = False
return False
def request_power_state(self, state: bool, force: bool = False) -> None:
if self.current_state != state or force:
if not self.request_in_progress:
self.request_in_progress = True
logging.info(f"Requesting {state}")
cb = PowerManager.Callback(self, state)
handlers = list(self.parent.Plugins.get_loaded_plugins(PowerStateHandler))
for handler in handlers:
handler.on_power_state_change_requested(self, state, cb)
cb.num_cb = len(handlers)
cb.check()
else:
logging.info("Another request in progress")
# queries other plugins to determine the current power state
def update_power_state(self) -> None:
rets = [plugin.on_power_state_query()
for plugin in self.parent.Plugins.get_loaded_plugins(PowerStateHandler)]
off = any(x != self.State.ON for x in rets) or not self.adapter_state
foff = self.State.OFF_FORCED in rets
on = self.State.ON in rets or self.adapter_state
new_state = True
if foff or off:
self.item.set_text(_("Turn Bluetooth _On"), markup=True)
self.item.set_icon_name("bluetooth-symbolic")
self.item.set_tooltip(_("Turn on all adapters"))
self.item.set_sensitive(not foff)
new_state = False
elif on and not self.current_state:
self.item.set_text(_("Turn Bluetooth _Off"), markup=True)
self.item.set_icon_name("bluetooth-disabled-symbolic")
self.item.set_tooltip(_("Turn off all adapters"))
self.item.set_sensitive(True)
new_state = True
logging.info(f"off {off} | foff {foff} | on {on} | current state {self.current_state} | new state {new_state}")
if self.current_state != new_state:
logging.info(f"Signalling {new_state}")
self.current_state = new_state
self._emit_dbus_signal("BluetoothStatusChanged", new_state)
for plugin in self.parent.Plugins.get_loaded_plugins(PowerStateListener):
plugin.on_power_state_changed(self, new_state)
if "StatusIcon" in self.parent.Plugins.get_loaded():
if new_state:
self.parent.Plugins.StatusIcon.set_tooltip_title(_("Bluetooth Enabled"))
self.parent.Plugins.StatusIcon.query_visibility(delay_hiding=True)
else:
self.parent.Plugins.StatusIcon.set_tooltip_title(_("Bluetooth Disabled"))
self.parent.Plugins.StatusIcon.query_visibility()
self.parent.Plugins.StatusIcon.icon_should_change()
def get_bluetooth_status(self) -> bool:
return self.current_state
def on_adapter_property_changed(self, _path: str, key: str, value: Any) -> None:
if key == "Powered":
if value and not self.current_state:
logging.warning("adapter powered on while in off state, turning bluetooth on")
self.request_power_state(True)
self.adapter_state = self.get_adapter_state()
self.update_power_state()
def on_bluetooth_toggled(self) -> None:
self.request_power_state(not self.current_state)
def on_status_icon_query_icon(self) -> Optional[str]:
return "blueman-disabled" if not self.get_bluetooth_status() else None
def on_adapter_added(self, path: str) -> None:
adapter = Adapter(obj_path=path)
adapter.set("Powered", self.adapter_state)
blueman-2.4.3/blueman/plugins/applet/PulseAudioProfile.py 0000664 0000000 0000000 00000013615 14650545052 0023515 0 ustar 00root root 0000000 0000000 import logging
from gettext import gettext as _
from html import escape
from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Callable
from blueman.main.PulseAudioUtils import EventType, PulseAudioUtils
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.Sdp import (AUDIO_SINK_SVCLASS_ID, AUDIO_SOURCE_SVCLASS_ID,
ServiceUUID)
if TYPE_CHECKING:
from blueman.bluez.Device import Device
from blueman.main.PulseAudioUtils import CardInfo, CardProfileInfo
from blueman.plugins.applet.Menu import MenuItem, SubmenuItemDict
class AudioProfiles(AppletPlugin):
__depends__ = ["Menu"]
__description__ = _("Adds audio profile selector to the status icon menu")
__author__ = "Abhijeet Viswa"
def on_load(self) -> None:
self._devices: Dict[str, "CardInfo"] = {}
self._device_menus: Dict[str, "MenuItem"] = {}
self._menu = self.parent.Plugins.Menu
pa = PulseAudioUtils()
pa.connect("event", self.on_pa_event)
pa.connect("connected", self.on_pa_ready)
def generate_menu(self) -> None:
devices = self.parent.Manager.get_devices()
for device in devices:
if device['Connected']:
self.request_device_profile_menu(device)
def request_device_profile_menu(self, device: "Device") -> None:
audio_source = False
for uuid in device['UUIDs']:
if ServiceUUID(uuid).short_uuid in (AUDIO_SOURCE_SVCLASS_ID, AUDIO_SINK_SVCLASS_ID):
audio_source = True
break
if device['Connected'] and audio_source:
pa = PulseAudioUtils()
if not pa.connected:
return
if not device['Address'] in self._devices:
self.query_pa(device)
else:
self.add_device_profile_menu(device)
def add_device_profile_menu(self, device: "Device") -> None:
def _activate_profile_wrapper(device: "Device", profile: "CardProfileInfo") -> Callable[[], None]:
def _wrapper() -> None:
self.on_activate_profile(device, profile)
return _wrapper
def _generate_profiles_menu(info: "CardInfo") -> List["SubmenuItemDict"]:
items: List["SubmenuItemDict"] = []
if not info:
return items
for profile in info["profiles"]:
profile_name = escape(profile["description"])
profile_icon = "bluetooth-symbolic"
if profile["name"] == info["active_profile"]:
profile_name = f"{profile_name}"
profile_icon = "dialog-ok"
items.append({
"text": profile_name,
"markup": True,
"icon_name": profile_icon,
"sensitive": True,
"callback": _activate_profile_wrapper(device, profile),
"tooltip": "",
})
return items
info = self._devices[device['Address']]
idx = max((item.priority[1] for item in self._device_menus.values()), default=-1) + 1
menu = self._menu.add(self, (42, idx), _("Audio Profiles for %s") % device.display_name,
icon_name="audio-card-symbolic",
submenu_function=lambda: _generate_profiles_menu(info))
self._device_menus[device['Address']] = menu
def query_pa(self, device: "Device") -> None:
def list_cb(cards: Mapping[str, "CardInfo"]) -> None:
for c in cards.values():
if c["proplist"]["device.string"] == device['Address']:
self._devices[device['Address']] = c
self.add_device_profile_menu(device)
return
pa = PulseAudioUtils()
pa.list_cards(list_cb)
def on_activate_profile(self, device: "Device", profile: "CardProfileInfo") -> None:
pa = PulseAudioUtils()
c = self._devices[device['Address']]
def on_result(res: int) -> None:
if not res:
logging.error(f"Failed to change profile to {profile['name']}")
pa.set_card_profile(c["index"], profile["name"], on_result)
def on_pa_event(self, utils: PulseAudioUtils, event: int, idx: int) -> None:
logging.debug(f"{event} {idx}")
def get_card_cb(card: "CardInfo") -> None:
drivers = ("module-bluetooth-device.c",
"module-bluez4-device.c",
"module-bluez5-device.c")
if card["driver"] in drivers:
self._devices[card["proplist"]["device.string"]] = card
self.clear_menu()
self.generate_menu()
if event & EventType.FACILITY_MASK == EventType.CARD:
logging.info("card")
if event & EventType.TYPE_MASK == EventType.CHANGE:
logging.info("change")
utils.get_card(idx, get_card_cb)
elif event & EventType.TYPE_MASK == EventType.REMOVE:
logging.info("remove")
else:
logging.info("add")
utils.get_card(idx, get_card_cb)
def on_pa_ready(self, _utils: PulseAudioUtils) -> None:
logging.info("PulseAudio Ready")
self.generate_menu()
def on_adapter_added(self, path: str) -> None:
self.clear_menu()
self.generate_menu()
def on_adapter_removed(self, path: str) -> None:
self.clear_menu()
self.generate_menu()
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected":
self.clear_menu()
self.generate_menu()
def on_manager_state_changed(self, state: bool) -> None:
self.clear_menu()
def on_unload(self) -> None:
self.clear_menu()
def clear_menu(self) -> None:
self._device_menus = {}
self._menu.unregister(self)
blueman-2.4.3/blueman/plugins/applet/RecentConns.py 0000664 0000000 0000000 00000017167 14650545052 0022351 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from operator import itemgetter
import html
import time
import logging
from typing import List, TYPE_CHECKING, Optional, Callable, cast, Union
from blueman.bluez.Device import Device
from blueman.bluez.errors import DBusNoSuchAdapterError
from blueman.gui.Notification import Notification
from blueman.Sdp import ServiceUUID
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.applet.Menu import MenuItem
from blueman.plugins.applet.PowerManager import PowerManager, PowerStateListener
if TYPE_CHECKING:
from blueman.plugins.applet.Menu import Menu, SubmenuItemDict
from typing_extensions import TypedDict
class _ItemBase(TypedDict):
adapter: str
address: str
alias: str
icon: str
name: str
uuid: str
class Item(_ItemBase):
time: float
device: str
mitem: Optional[SubmenuItemDict]
class StoredIcon(_ItemBase):
time: str
REGISTRY_VERSION = 0
class RecentConns(AppletPlugin, PowerStateListener):
__depends__ = ["DBusService", "Menu"]
__icon__ = "document-open-recent-symbolic"
__description__ = _("Provides a menu item that contains last used connections for quick access")
__author__ = "Walmis"
__gsettings__ = {
"schema": "org.blueman.plugins.recentconns",
"path": None
}
__options__ = {
"max-items": {"type": int,
"default": 6,
# the maximum number of items RecentConns menu will display
"name": _("Maximum items"),
"desc": _("The maximum number of items recent connections menu will display."),
"range": (6, 20)},
"recent-connections": {"type": list, "default": "[]"}
}
def on_load(self) -> None:
self.__menuitems: List["SubmenuItemDict"] = []
self._rebuild_menu()
def on_power_state_changed(self, manager: PowerManager, state: bool) -> None:
self._rebuild()
def on_unload(self) -> None:
self.parent.Plugins.Menu.unregister(self)
def _rebuild(self) -> None:
if 'PowerManager' in self.parent.Plugins.get_loaded() and \
not self.parent.Plugins.PowerManager.get_bluetooth_status():
for mitem in self._mitems:
mitem.set_sensitive(False)
return
items = self._get_items()
if len(items) == 0:
for mitem in self._mitems:
mitem.set_sensitive(False)
return
for mitem in self._mitems:
mitem.set_sensitive(True)
self.__menuitems = [self._build_menu_item(item) for item in items[:self.get_option("max-items")]]
self._rebuild_menu()
def on_manager_state_changed(self, state: bool) -> None:
if state:
self._rebuild()
else:
for mitem in self._mitems:
mitem.set_sensitive(False)
def on_device_created(self, path: str) -> None:
self._rebuild()
def on_device_removed(self, path: str) -> None:
self._rebuild()
def on_adapter_added(self, path: str) -> None:
self._rebuild()
def on_adapter_removed(self, path: str) -> None:
self._rebuild()
def notify(self, object_path: str, uuid: str) -> None:
device = Device(obj_path=object_path)
logging.info(f"{device} {uuid}")
try:
adapter = self.parent.Manager.get_adapter(device['Adapter'])
except DBusNoSuchAdapterError:
logging.warning("adapter not found")
return
item = {
"adapter": adapter["Address"],
"address": device['Address'],
"alias": device.display_name,
"icon": device['Icon'],
"name": ServiceUUID(uuid).name,
"uuid": uuid,
"time": str(time.time()),
}
stored_items = self.get_option("recent-connections")
for i in stored_items:
if i["adapter"] == item["adapter"] and \
i["address"] == item["address"] and \
i["uuid"] == item["uuid"]:
i["time"] = item["time"]
i["device"] = object_path
break
else:
stored_items.append(item)
self.set_option("recent-connections", stored_items)
self._rebuild()
def on_item_activated(self, item: "Item") -> None:
logging.info(f"Connect {item['address']} {item['uuid']}")
assert item["mitem"] is not None
item["mitem"]["sensitive"] = False
self.parent.Plugins.Menu.on_menu_changed()
def reply() -> None:
assert item["mitem"] is not None # https://github.com/python/mypy/issues/2608
Notification(_("Connected"), _("Connected to %s") % item["mitem"]["text"],
icon_name=item["icon"]).show()
item["mitem"]["sensitive"] = True
self.parent.Plugins.Menu.on_menu_changed()
def err(reason: Union[Exception, str]) -> None:
Notification(_("Failed to connect"), str(reason).split(": ")[-1],
icon_name="dialog-error").show()
assert item["mitem"] is not None # https://github.com/python/mypy/issues/2608
item["mitem"]["sensitive"] = True
self.parent.Plugins.Menu.on_menu_changed()
self.parent.Plugins.DBusService.connect_service(item["device"], item["uuid"], reply, err)
def _build_menu_item(self, item: "Item") -> "SubmenuItemDict":
alias = html.escape(item["alias"])
mitem: "SubmenuItemDict" = {
"text": _("%(service)s on %(device)s") % {"service": item["name"], "device": alias},
"markup": True,
"icon_name": item["mitem"]["icon_name"] if item["mitem"] is not None else item["icon"],
"sensitive": item["device"] is not None,
"tooltip": None if item["device"] is None else _("Adapter for this connection is not available"),
"callback": (item["mitem"]["callback"] if item["mitem"] is not None
else cast(Callable[[], None], lambda itm=item: self.on_item_activated(itm)))
}
item["mitem"] = mitem
return mitem
def _rebuild_menu(self) -> None:
menu: "Menu" = self.parent.Plugins.Menu
self._mitems: List[MenuItem] = []
menu.unregister(self)
menu.add(self, 52, text=_("Reconnect to…"), icon_name="document-open-recent-symbolic",
sensitive=False, callback=lambda: None)
for (idx, item) in enumerate(self.__menuitems):
self._mitems.append(menu.add(self, (53, idx), **item))
menu.add(self, 59)
def _get_device_path(self, adapter_path: str, address: str) -> Optional[str]:
try:
adapter = self.parent.Manager.get_adapter(adapter_path)
except DBusNoSuchAdapterError:
return None
device = self.parent.Manager.find_device(address, adapter.get_object_path())
return device.get_object_path() if device is not None else None
def _get_items(self) -> List["Item"]:
return sorted(
({
"adapter": i["adapter"],
"address": i["address"],
"alias": i["alias"],
"icon": i["icon"],
"name": i["name"],
"uuid": i["uuid"],
"time": float(i["time"]),
"device": device,
"mitem": None
}
for i in self.get_option("recent-connections")
if (device := self._get_device_path(i["adapter"], i["address"]))),
key=itemgetter("time"),
reverse=True
)
blueman-2.4.3/blueman/plugins/applet/SerialManager.py 0000664 0000000 0000000 00000013334 14650545052 0022632 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Dict, Any, Callable, Tuple # noqa: F401
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.gui.Notification import Notification
from blueman.Sdp import SERIAL_PORT_SVCLASS_ID
from blueman.plugins.applet.DBusService import RFCOMMConnectedListener
from blueman.services.Functions import get_services
from _blueman import rfcomm_list, RFCOMMError
from subprocess import Popen
import logging
import os
import signal
from blueman.bluez.Device import Device
from gi.repository import GLib
from blueman.services.meta import SerialService
class SerialManager(AppletPlugin, RFCOMMConnectedListener):
__icon__ = "bluetooth-symbolic"
__description__ = _("Standard SPP profile connection handler, allows executing custom actions")
__author__ = "walmis"
__gsettings__ = {
"schema": "org.blueman.plugins.serialmanager",
"path": None
}
__options__ = {
"script": {"type": str, "default": "",
"name": _("Script to execute on connection"),
"desc": _("The following arguments will be passed:\n"
"Address, Name, service name, uuid16s, rfcomm node\n"
"For example:\n"
"AA:BB:CC:DD:EE:FF, Phone, DUN service, 0x1103, /dev/rfcomm0\n"
"uuid16s are returned as a comma separated list\n\n"
"Upon device disconnection the script will be sent a HUP signal")},
}
scripts: Dict[str, Dict[str, "Popen[Any]"]] = {}
def on_load(self) -> None:
self.scripts = {}
def on_unload(self) -> None:
for bdaddr in self.scripts.keys():
self.terminate_all_scripts(bdaddr)
def on_delete(self) -> None:
logging.debug("Terminating any running scripts")
for bdaddr in self.scripts:
self.terminate_all_scripts(bdaddr)
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected" and not value:
device = Device(obj_path=path)
self.terminate_all_scripts(device["Address"])
self.on_device_disconnect(device)
def on_rfcomm_connected(self, service: SerialService, port: str) -> None:
device = service.device
if SERIAL_PORT_SVCLASS_ID == service.short_uuid:
Notification(_("Serial port connected"),
_("Serial port service on device %s now will be available via %s") % (
device.display_name, port),
icon_name="blueman-serial").show()
self.call_script(device['Address'],
device.display_name,
service.name,
service.short_uuid,
port)
def terminate_all_scripts(self, address: str) -> None:
if address not in self.scripts:
# Script already terminated or failed to start
return
for p in self.scripts[address].values():
logging.info(f"Sending HUP to {p.pid}")
try:
os.killpg(p.pid, signal.SIGHUP)
except ProcessLookupError:
logging.debug(f"No process found for pid {p.pid}")
def on_script_closed(self, pid: int, _cond: int, address_node: Tuple[str, str]) -> None:
address, node = address_node
del self.scripts[address][node]
logging.info(f"Script with PID {pid} closed")
def manage_script(self, address: str, node: str, process: "Popen[Any]") -> None:
if address not in self.scripts:
self.scripts[address] = {}
if node in self.scripts[address]:
self.scripts[address][node].terminate()
self.scripts[address][node] = process
GLib.child_watch_add(process.pid, self.on_script_closed, (address, node))
def call_script(self, address: str, name: str, sv_name: str, uuid16: int, node: str) -> None:
c = self.get_option("script")
if c and c != "":
args = c.split(" ")
try:
args += [address, name, sv_name, f"{uuid16:#x}", node]
logging.debug(" ".join(args))
p = Popen(args, preexec_fn=lambda: os.setpgid(0, 0))
self.manage_script(address, node, p)
except Exception as e:
logging.debug(str(e))
Notification(_("Serial port connection script failed"),
_("There was a problem launching script %s\n"
"%s") % (c, str(e)),
icon_name="blueman-serial").show()
def on_rfcomm_disconnect(self, port: int) -> None:
for bdaddr, scripts in self.scripts.items():
process = scripts.get(f"/dev/rfcomm{port:i}")
if process:
logging.info(f"Sending HUP to {process.pid}")
os.killpg(process.pid, signal.SIGHUP)
def on_device_disconnect(self, device: Device) -> None:
serial_services = [service for service in get_services(device) if isinstance(service, SerialService)]
if not serial_services:
return
try:
active_ports = [rfcomm['id'] for rfcomm in rfcomm_list() if rfcomm['dst'] == device['Address']]
except RFCOMMError as e:
logging.error(f"rfcomm_list failed with: {e}")
return
for port in active_ports:
name = f"/dev/rfcomm{port:d}"
try:
logging.info(f"Disconnecting {name}")
serial_services[0].disconnect(port)
except GLib.Error:
logging.error(f"Failed to disconnect {name}", exc_info=True)
blueman-2.4.3/blueman/plugins/applet/ShowConnected.py 0000664 0000000 0000000 00000011103 14650545052 0022653 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import Optional, Any, List, Set
from gi.repository import GLib
from blueman.bluez.Battery import Battery
from blueman.bluez.Device import Device
from blueman.bluez.errors import BluezDBusException
from blueman.main.BatteryWatcher import BatteryWatcher
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.applet.StatusIcon import StatusIconProvider
from blueman.main.PluginManager import PluginManager
class ShowConnected(AppletPlugin, StatusIconProvider):
__author__ = "Walmis"
__depends__ = ["StatusIcon"]
__icon__ = "bluetooth-symbolic"
__description__ = _("Adds an indication on the status icon when Bluetooth is active and shows the "
"connections in the tooltip.")
def on_load(self) -> None:
self._connections: Set[str] = set()
self.active = False
self.initialized = False
self._handlers: List[int] = []
self._handlers.append(self.parent.Plugins.connect('plugin-loaded', self._on_plugins_changed))
self._handlers.append(self.parent.Plugins.connect('plugin-unloaded', self._on_plugins_changed))
self._battery_watcher = BatteryWatcher(lambda *args: self.update_statusicon())
def on_unload(self) -> None:
self.parent.Plugins.StatusIcon.set_tooltip_text(None)
self._connections = set()
self.parent.Plugins.StatusIcon.icon_should_change()
for handler in self._handlers:
self.parent.Plugins.disconnect(handler)
self._handlers = []
del self._battery_watcher
def on_status_icon_query_icon(self) -> Optional[str]:
if self._connections:
self.active = True
return "blueman-active"
else:
self.active = False
return None
def enumerate_connections(self) -> bool:
self._connections = {device.get_object_path()
for device in self.parent.Manager.get_devices()
if device["Connected"]}
logging.info(f"Found {len(self._connections):d} existing connections")
if (self._connections and not self.active) or (not self._connections and self.active):
self.parent.Plugins.StatusIcon.icon_should_change()
self.update_statusicon()
return False
def update_statusicon(self) -> None:
if self._connections:
def build_line(obj_path: str) -> str:
line: str = Device(obj_path=obj_path)["Alias"]
try:
return f"{line} 🔋{Battery(obj_path=obj_path)['Percentage']}%"
except BluezDBusException:
return line
self.parent.Plugins.StatusIcon.set_tooltip_title(_("Bluetooth Active"))
self.parent.Plugins.StatusIcon.set_tooltip_text("\n".join(map(build_line, self._connections)))
else:
self.parent.Plugins.StatusIcon.set_tooltip_text(None)
if 'PowerManager' in self.parent.Plugins.get_loaded():
status = self.parent.Plugins.PowerManager.get_bluetooth_status()
if status:
self.parent.Plugins.StatusIcon.set_tooltip_title(_("Bluetooth Enabled"))
else:
self.parent.Plugins.StatusIcon.set_tooltip_title(_("Bluetooth Disabled"))
else:
self.parent.Plugins.StatusIcon.set_tooltip_title("Blueman")
def on_manager_state_changed(self, state: bool) -> None:
if state:
if not self.initialized:
GLib.timeout_add(0, self.enumerate_connections)
self.initialized = True
else:
GLib.timeout_add(1000, self.enumerate_connections)
else:
self._connections = set()
self.update_statusicon()
def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
if key == "Connected":
if value:
self._connections.add(path)
else:
self._connections.remove(path)
if (self._connections and not self.active) or (not self._connections and self.active):
self.parent.Plugins.StatusIcon.icon_should_change()
self.update_statusicon()
def on_adapter_added(self, _path: str) -> None:
self.enumerate_connections()
def on_adapter_removed(self, _path: str) -> None:
self.enumerate_connections()
def _on_plugins_changed(self, _pluginmngr: PluginManager[AppletPlugin], name: str) -> None:
if name == "PowerManager":
self.update_statusicon()
blueman-2.4.3/blueman/plugins/applet/StandardItems.py 0000664 0000000 0000000 00000011320 14650545052 0022653 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Optional
from blueman.Functions import launch
from blueman.main.DBusProxies import ManagerService
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.gui.CommonUi import show_about_dialog
from blueman.gui.applet.PluginDialog import PluginDialog
import gi
from blueman.plugins.applet.PowerManager import PowerManager, PowerStateListener
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gdk
class StandardItems(AppletPlugin, PowerStateListener):
__depends__ = ["Menu"]
__unloadable__ = False
__description__ = _("Adds standard menu items to the status icon menu")
__author__ = "walmis"
__gsettings__ = {
"schema": "org.blueman.plugins.standarditems",
"path": None
}
__options__ = {
"toggle-manager-onclick": {
"type": bool,
"default": False,
"name": _("Toggle the manager on clicking the system tray icon"),
"desc": _("Clicking the system tray icon will toggle the manager instead of focusing on it.")
}
}
def on_load(self) -> None:
self._plugin_window: Optional[Gtk.ApplicationWindow] = None
self.parent.Plugins.Menu.add(self, 21)
self.parent.Plugins.Menu.add(self, 31)
self.send = self.parent.Plugins.Menu.add(self, 40, text=_("Send _Files to Device") + "…",
icon_name="blueman-send-symbolic", callback=self.on_send)
self.parent.Plugins.Menu.add(self, 51)
self.devices = self.parent.Plugins.Menu.add(self, 60, text=_("_Devices") + "…",
icon_name="bluetooth-symbolic",
callback=self.on_devices)
self.adapters = self.parent.Plugins.Menu.add(self, 70, text=_("Adap_ters") + "…",
icon_name="bluetooth-symbolic",
callback=self.on_adapters)
self.parent.Plugins.Menu.add(self, 80, text=_("_Local Services") + "…",
icon_name="document-properties-symbolic",
callback=self.on_local_services)
self.parent.Plugins.Menu.add(self, 81)
self.parent.Plugins.Menu.add(self, 90, text=_("_Help"), icon_name='help-about-symbolic',
callback=self.on_about)
self.parent.Plugins.Menu.add(self, 85, text=_("_Plugins"), icon_name="application-x-addon-symbolic",
callback=self.on_plugins)
def change_sensitivity(self, sensitive: bool) -> None:
if 'PowerManager' in self.parent.Plugins.get_loaded():
power = self.parent.Plugins.PowerManager.get_bluetooth_status()
else:
power = True
sensitive = sensitive and self.parent.Manager is not None and power
self.send.set_sensitive(sensitive)
self.devices.set_sensitive(sensitive)
self.adapters.set_sensitive(sensitive)
def on_manager_state_changed(self, state: bool) -> None:
self.change_sensitivity(state)
def on_power_state_changed(self, manager: PowerManager, state: bool) -> None:
self.change_sensitivity(state)
def on_send(self) -> None:
launch("blueman-sendto", name=_("File Sender"))
def on_devices(self) -> None:
m = ManagerService()
if m.get_name_owner() and self.get_option("toggle-manager-onclick"):
m.quit()
else:
m.activate()
def on_adapters(self) -> None:
launch("blueman-adapters", name=_("Adapter Preferences"))
def on_local_services(self) -> None:
launch("blueman-services", name=_("Service Preferences"))
def on_about(self) -> None:
about = show_about_dialog("Blueman " + _("applet"), run=False)
im = Gtk.Image(icon_name="application-x-addon-symbolic", pixel_size=16)
button = Gtk.Button(label=_("Plugins"), visible=True, image=im)
button.connect("clicked", lambda _button: self.on_plugins())
about.action_area.pack_start(button, True, True, 0)
about.action_area.reorder_child(button, 0)
about.run()
about.destroy()
def on_plugins(self) -> None:
def on_close(win: Gtk.Window, _event: Gdk.Event) -> bool:
win.destroy()
self._plugin_window = None
return False
if self._plugin_window:
self._plugin_window.present()
else:
self._plugin_window = PluginDialog(self.parent)
self._plugin_window.connect("delete-event", on_close)
self._plugin_window.show()
blueman-2.4.3/blueman/plugins/applet/StatusIcon.py 0000664 0000000 0000000 00000012567 14650545052 0022223 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from operator import itemgetter
from typing import Optional, Tuple, List
from gi.repository import GObject, GLib, Gio
from blueman.Functions import launch
from blueman.main.PluginManager import PluginManager
from blueman.plugins.AppletPlugin import AppletPlugin
class StatusIconImplementationProvider:
def on_query_status_icon_implementation(self) -> Tuple[str, int]:
return "GtkStatusIcon", 0
class StatusIconVisibilityHandler:
def on_query_force_status_icon_visibility(self) -> bool:
return False
class StatusIconProvider:
def on_status_icon_query_icon(self) -> Optional[str]:
return None
class StatusIcon(AppletPlugin, GObject.GObject):
__icon__ = "bluetooth-symbolic"
__depends__ = ["StandardItems", "Menu"]
visible = None
visibility_timeout: Optional[int] = None
_implementations = None
def on_load(self) -> None:
GObject.GObject.__init__(self)
self._tooltip_title = _("Bluetooth Enabled")
self._tooltip_text = ""
self.general_config = Gio.Settings(schema_id="org.blueman.general")
self.general_config.connect("changed::symbolic-status-icons", self.on_symbolic_config_change)
self.query_visibility(emit=False)
self.parent.Plugins.connect('plugin-loaded', self._on_plugins_changed)
self.parent.Plugins.connect('plugin-unloaded', self._on_plugins_changed)
self._add_dbus_method("GetVisibility", (), "b", lambda: self.visible)
self._add_dbus_signal("VisibilityChanged", "b")
self._add_dbus_signal("ToolTipTitleChanged", "s")
self._add_dbus_signal("ToolTipTextChanged", "s")
self._add_dbus_method("GetToolTipTitle", (), "s", lambda: self._tooltip_title)
self._add_dbus_method("GetToolTipText", (), "s", lambda: self._tooltip_text)
self._add_dbus_signal("IconNameChanged", "s")
self._add_dbus_method("GetStatusIconImplementations", (), "as", self._get_status_icon_implementations)
self._add_dbus_method("GetIconName", (), "s", self._get_icon_name)
self._add_dbus_method("Activate", (), "", self.parent.Plugins.StandardItems.on_devices)
def query_visibility(self, delay_hiding: bool = False, emit: bool = True) -> None:
if self.parent.Manager.get_adapters() or \
any(plugin.on_query_force_status_icon_visibility()
for plugin in self.parent.Plugins.get_loaded_plugins(StatusIconVisibilityHandler)):
self.set_visible(True, emit)
elif not self.visibility_timeout:
if delay_hiding:
self.visibility_timeout = GLib.timeout_add(2500, self.on_visibility_timeout)
else:
self.set_visible(False, emit)
def on_visibility_timeout(self) -> bool:
assert self.visibility_timeout is not None
GLib.source_remove(self.visibility_timeout)
self.visibility_timeout = None
self.query_visibility()
return False
def set_visible(self, visible: bool, emit: bool) -> None:
self.visible = visible
if emit:
self._emit_dbus_signal("VisibilityChanged", visible)
def set_tooltip_title(self, title: str) -> None:
self._tooltip_title = title
self._emit_dbus_signal("ToolTipTitleChanged", title)
def set_tooltip_text(self, text: Optional[str]) -> None:
self._tooltip_text = "" if text is None else text
self._emit_dbus_signal("ToolTipTextChanged", self._tooltip_text)
def on_symbolic_config_change(self, settings: Gio.Settings, key: str) -> None:
self.icon_should_change()
def icon_should_change(self) -> None:
self._emit_dbus_signal("IconNameChanged", self._get_icon_name())
self.query_visibility()
def on_adapter_added(self, _path: str) -> None:
self.query_visibility()
def on_adapter_removed(self, _path: str) -> None:
self.query_visibility()
def on_manager_state_changed(self, state: bool) -> None:
self.query_visibility()
if state:
launch('blueman-tray', icon_name='blueman', sn=False)
def _on_plugins_changed(self, _plugins: PluginManager[AppletPlugin], _name: str) -> None:
implementations = self._get_status_icon_implementations()
if not self._implementations or self._implementations != implementations:
self._implementations = implementations
if self.parent.manager_state:
launch('blueman-tray', icon_name='blueman', sn=False)
def _get_status_icon_implementations(self) -> List[str]:
return [implementation for implementation, _ in sorted(
(plugin.on_query_status_icon_implementation()
for plugin in self.parent.Plugins.get_loaded_plugins(StatusIconImplementationProvider)),
key=itemgetter(1),
reverse=True
)] + ["GtkStatusIcon"]
def _get_icon_name(self) -> str:
# default icon name
name = "blueman-tray"
for plugin in self.parent.Plugins.get_loaded_plugins(StatusIconProvider):
icon = plugin.on_status_icon_query_icon()
if icon is not None:
# status icon
name = icon
# depending on configuration, ensure fullcolor icons..
name = name.replace("-symbolic", "")
if self.general_config.get_boolean("symbolic-status-icons"):
# or symbolic
name = f"{name}-symbolic"
return name
blueman-2.4.3/blueman/plugins/applet/StatusNotifierItem.py 0000664 0000000 0000000 00000000756 14650545052 0023726 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Tuple
from blueman.plugins.AppletPlugin import AppletPlugin
from blueman.plugins.applet.StatusIcon import StatusIconImplementationProvider
class StatusNotifierItem(AppletPlugin, StatusIconImplementationProvider):
__description__ = _("Provides a StatusNotifierItem to show a statusicon")
__icon__ = "bluetooth-symbolic"
def on_query_status_icon_implementation(self) -> Tuple[str, int]:
return "StatusNotifierItem", 20
blueman-2.4.3/blueman/plugins/applet/TransferService.py 0000664 0000000 0000000 00000033312 14650545052 0023223 0 ustar 00root root 0000000 0000000 from datetime import datetime
from gettext import gettext as _, ngettext
import os
import shutil
import logging
from html import escape
from typing import List, Dict, TYPE_CHECKING, Callable, Tuple, Optional, Union
from blueman.bluez.obex.AgentManager import AgentManager
from blueman.bluez.obex.Manager import Manager
from blueman.bluez.obex.Transfer import Transfer
from blueman.bluez.obex.Session import Session
from blueman.Functions import launch
from blueman.gui.Notification import Notification, _NotificationBubble, _NotificationDialog
from blueman.main.Applet import BluemanApplet
from blueman.main.DbusService import DbusService, DbusError
from blueman.plugins.AppletPlugin import AppletPlugin
from gi.repository import GLib, Gio
if TYPE_CHECKING:
from typing_extensions import TypedDict
class TransferDict(TypedDict):
path: str
size: Optional[int]
name: str
class PendingTransferDict(TypedDict):
transfer_path: str
address: str
root: str
filename: str
size: Optional[int]
name: str
NotificationType = Union[_NotificationBubble, _NotificationDialog]
class ObexErrorRejected(DbusError):
_name = "org.bluez.obex.Error.Rejected"
class ObexErrorCanceled(DbusError):
_name = "org.bluez.obex.Error.Canceled"
class Agent(DbusService):
__agent_path = '/org/bluez/obex/agent/blueman'
def __init__(self, applet: BluemanApplet):
super().__init__(None, "org.bluez.obex.Agent1", self.__agent_path, Gio.BusType.SESSION)
self.add_method("Release", (), "", self._release)
self.add_method("Cancel", (), "", self._cancel)
self.add_method("AuthorizePush", ("o",), "s", self._authorize_push, is_async=True)
self.register()
self._applet = applet
self._config = Gio.Settings(schema_id="org.blueman.transfer")
self._allowed_devices: List[str] = []
self._notification: Optional[NotificationType] = None
self._pending_transfer: Optional["PendingTransferDict"] = None
self.transfers: Dict[str, "TransferDict"] = {}
def register_at_manager(self) -> None:
AgentManager().register_agent(self.__agent_path)
def unregister_from_manager(self) -> None:
AgentManager().unregister_agent(self.__agent_path)
def _release(self) -> None:
raise Exception(self.__agent_path + " was released unexpectedly")
def _authorize_push(self, transfer_path: str, ok: Callable[[str], None],
err: Callable[[ObexErrorRejected], None]) -> None:
def on_action(action: str) -> None:
logging.info(f"Action {action}")
if action == "accept":
assert self._pending_transfer
self.transfers[self._pending_transfer['transfer_path']] = {
'path': self._pending_transfer['root'] + '/' + os.path.basename(self._pending_transfer['filename']),
'size': self._pending_transfer['size'],
'name': self._pending_transfer['name']
}
ok(self.transfers[self._pending_transfer['transfer_path']]['path'])
self._allowed_devices.append(self._pending_transfer['address'])
def _remove() -> bool:
assert self._pending_transfer is not None # https://github.com/python/mypy/issues/2608
self._allowed_devices.remove(self._pending_transfer['address'])
return False
GLib.timeout_add(60000, _remove)
else:
err(ObexErrorRejected("Rejected"))
transfer = Transfer(obj_path=transfer_path)
session = Session(obj_path=transfer.session)
root = session.root
address = session.address
filename = transfer.name
size = transfer.size
try:
adapter = self._applet.Manager.get_adapter()
device = self._applet.Manager.find_device(address, adapter.get_object_path())
assert device is not None
name = device.display_name
trusted = device["Trusted"]
except Exception as e:
logging.exception(e)
name = address
trusted = False
self._pending_transfer = {'transfer_path': transfer_path, 'address': address, 'root': root,
'filename': filename, 'size': size, 'name': name}
# This device was neither allowed nor is it trusted -> ask for confirmation
if address not in self._allowed_devices and not (self._config['opp-accept'] and trusted):
self._notification = notification = Notification(
_("Incoming file over Bluetooth"),
_("Incoming file %(0)s from %(1)s") % {"0": "" + escape(filename) + "",
"1": "" + escape(name) + ""},
30000, [("accept", _("Accept")), ("reject", _("Reject"))], on_action,
icon_name="blueman"
)
notification.show()
# Device is trusted or was already allowed, larger file -> display a notification, but auto-accept
elif size and size > 350000:
self._notification = notification = Notification(
_("Receiving file"),
_("Receiving file %(0)s from %(1)s") % {"0": "" + escape(filename) + "",
"1": "" + escape(name) + ""},
icon_name="blueman"
)
on_action('accept')
notification.show()
# Device is trusted or was already allowed. very small file -> auto-accept and transfer silently
else:
self._notification = None
on_action("accept")
def _cancel(self) -> None:
if self._notification:
self._notification.close()
raise ObexErrorCanceled("Canceled")
class TransferService(AppletPlugin):
__author__ = "cschramm"
__description__ = _("Provides OBEX file transfer capabilities")
__icon__ = "blueman-send-symbolic"
_silent_transfers = 0
_normal_transfers = 0
_manager = None
_agent = None
_watch = None
_notification = None
_handlerids: List[int] = []
def on_load(self) -> None:
def on_reset(_action: str) -> None:
self._notification = None
self._config.reset('shared-path')
logging.info('Reset share path')
self._config = Gio.Settings(schema_id="org.blueman.transfer")
share_path, invalid_share_path = self._make_share_path()
if invalid_share_path:
text = _('Configured directory for incoming files does not exist')
secondary_text = _('Please make sure that directory "%s" exists or '
'configure it with blueman-services. Until then the default "%s" will be used')
self._notification = Notification(text, secondary_text % (self._config["shared-path"], share_path),
icon_name='blueman', timeout=30000,
actions=[('reset', 'Reset to default')], actions_cb=on_reset)
self._notification.show()
self._watch = Manager.watch_name_owner(self._on_dbus_name_appeared, self._on_dbus_name_vanished)
def on_unload(self) -> None:
if self._watch:
Gio.bus_unwatch_name(self._watch)
self._unregister_agent()
def _make_share_path(self) -> Tuple[str, bool]:
config_path = self._config["shared-path"]
default_path = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DOWNLOAD)
path = None
error = False
if config_path == '':
path = default_path
elif not os.path.isdir(config_path):
path = default_path
error = True
logging.warning(f"Invalid shared-path {config_path}")
else:
path = config_path
if not path:
path = os.path.expanduser("~")
logging.warning('Failed to get Download dir from XDG')
# We used to always store the full path which caused problems
if config_path == default_path:
logging.info('Reset stored path, identical to default path.')
self._config["shared-path"] = ''
return path, error
def _register_agent(self) -> None:
if not self._agent:
self._agent = Agent(self.parent)
self._agent.register_at_manager()
def _unregister_agent(self) -> None:
if self._agent:
self._agent.unregister_from_manager()
self._agent.unregister()
self._agent = None
def _on_dbus_name_appeared(self, _connection: Gio.DBusConnection, name: str, owner: str) -> None:
logging.info(f"{name} {owner}")
self._manager = Manager()
self._handlerids.append(self._manager.connect("transfer-started", self._on_transfer_started))
self._handlerids.append(self._manager.connect("transfer-completed", self._on_transfer_completed))
self._handlerids.append(self._manager.connect('session-removed', self._on_session_removed))
self._register_agent()
def _on_dbus_name_vanished(self, _connection: Gio.DBusConnection, name: str) -> None:
logging.info(f"{name} not running or was stopped")
if self._manager:
for sigid in self._handlerids:
self._manager.disconnect(sigid)
self._manager = None
self._handlerids = []
if self._agent:
self._agent.unregister()
self._agent = None
def _on_transfer_started(self, _manager: Manager, transfer_path: str) -> None:
if not self._agent or transfer_path not in self._agent.transfers:
# This is not an incoming transfer we authorized
return
size = self._agent.transfers[transfer_path]['size']
assert size is not None
if size > 350000:
self._normal_transfers += 1
else:
self._silent_transfers += 1
def _add_open(self, n: NotificationType, name: str, path: str) -> None:
if n.actions_supported:
logging.info("adding action")
def on_open(_action: str) -> None:
self._notification = None
logging.info("open")
launch("xdg-open", paths=[path], system=True)
n.add_action("open", name, on_open)
def _on_transfer_completed(self, _manager: Manager, transfer_path: str, success: bool) -> None:
if not self._agent or transfer_path not in self._agent.transfers:
logging.info("This is probably not an incoming transfer we authorized")
return
attributes = self._agent.transfers[transfer_path]
src = attributes['path']
dest_dir, ignored = self._make_share_path()
filename = os.path.basename(src)
dest = os.path.join(dest_dir, filename)
if os.path.exists(dest):
now = datetime.now()
filename = f"{now.strftime('%Y%m%d%H%M%S')}_{filename}"
logging.info(f"Destination file exists, renaming to: {filename}")
try:
shutil.move(src, dest)
except (OSError, PermissionError):
logging.error("Failed to move files", exc_info=True)
success = False
if success:
self._notification = Notification(_("File received"),
_("File %(0)s from %(1)s successfully received") % {
"0": "" + escape(filename) + "",
"1": "" + escape(attributes['name']) + ""},
icon_name="blueman")
self._add_open(self._notification, _("Open"), dest)
self._notification.show()
elif not success:
n = Notification(
_("Transfer failed"),
_("Transfer of file %(0)s failed") % {
"0": "" + escape(filename) + "",
"1": "" + escape(attributes['name']) + ""},
icon_name="blueman"
)
n.show()
assert attributes['size'] is not None
if attributes['size'] > 350000:
self._normal_transfers -= 1
else:
self._silent_transfers -= 1
del self._agent.transfers[transfer_path]
def _on_session_removed(self, _manager: Manager, _session_path: str) -> None:
if self._silent_transfers == 0:
return
share_path, ignored = self._make_share_path()
if self._normal_transfers == 0:
self._notification = Notification(_("Files received"),
ngettext("Received %(files)d file in the background",
"Received %(files)d files in the background",
self._silent_transfers) % {"files": self._silent_transfers},
icon_name="blueman")
self._add_open(self._notification, _("Open Location"), share_path)
self._notification.show()
else:
self._notification = Notification(_("Files received"),
ngettext("Received %(files)d more file in the background",
"Received %(files)d more files in the background",
self._silent_transfers) % {"files": self._silent_transfers},
icon_name="blueman")
self._add_open(self._notification, _("Open Location"), share_path)
self._notification.show()
blueman-2.4.3/blueman/plugins/applet/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0021641 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/errors.py 0000664 0000000 0000000 00000000147 14650545052 0020145 0 ustar 00root root 0000000 0000000 class PluginException(Exception):
pass
class UnsupportedPlatformError(PluginException):
pass
blueman-2.4.3/blueman/plugins/manager/ 0000775 0000000 0000000 00000000000 14650545052 0017667 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/manager/Info.py 0000664 0000000 0000000 00000010577 14650545052 0021146 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import List, Tuple, Iterable, Callable, Any, Optional
from gi.repository import Gtk, Gdk
import logging
from gi.repository.GObject import GObject
from blueman.Functions import create_menuitem
from blueman.Sdp import ServiceUUID
from blueman.bluez.Device import Device
from blueman.bluez.errors import BluezDBusException
from blueman.gui.manager.ManagerDeviceMenu import MenuItemsProvider, ManagerDeviceMenu, DeviceMenuItem
from blueman.plugins.ManagerPlugin import ManagerPlugin
def show_info(device: Device, parent: Gtk.Window) -> None:
def format_boolean(x: bool) -> str:
return _('yes') if x else _('no')
def format_rssi(rssi: int) -> str:
if rssi in [0x99, 0x7f]:
return f'invalid (0x{rssi:02x})'
else:
return f'{rssi} dBm (0x{rssi:02x})'
def format_uuids(uuids: Iterable[str]) -> str:
return "\n".join([uuid + ' ' + ServiceUUID(uuid).name for uuid in uuids])
store = Gtk.ListStore(str, str)
view = Gtk.TreeView(model=store, headers_visible=False)
view_selection = view.get_selection()
view_selection.set_mode(Gtk.SelectionMode.MULTIPLE)
def on_accel_activated(_group: Gtk.AccelGroup, _dialog: GObject, key: int, _modifier: Gdk.ModifierType) -> bool:
if key != 99:
logging.warning(f"Ignoring key {key}")
return False
store, paths = view_selection.get_selected_rows()
text = []
for path in paths:
row = store[path]
text.append(row[-1])
logging.info("\n".join(text))
clipboard.set_text("\n".join(text), -1)
return False
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
dialog = Gtk.Dialog(icon_name="blueman", title="blueman")
dialog.set_transient_for(parent)
dialog_content_area = dialog.get_content_area()
label = Gtk.Label()
label.set_markup(_("Select row(s) and use Control + C to copy"))
label.show()
dialog_content_area.pack_start(label, True, False, 0)
accelgroup = Gtk.AccelGroup()
dialog.add_accel_group(accelgroup)
key, mod = Gtk.accelerator_parse("C")
accelgroup.connect(key, mod, Gtk.AccelFlags.MASK, on_accel_activated)
for i in range(2):
column = Gtk.TreeViewColumn()
cell = Gtk.CellRendererText()
column.pack_start(cell, True)
column.add_attribute(cell, 'text', i)
view.append_column(column)
dialog_content_area.pack_start(view, True, False, 0)
view.show_all()
properties: Iterable[Tuple[str, Optional[Callable[[Any], str]]]] = (
('Address', None),
('AddressType', None),
('Name', None),
('Alias', None),
('Class', lambda x: f"0x{x:06x}"),
('Appearance', lambda x: f"0x{x:04x}"),
('Icon', None),
('Paired', format_boolean),
('Trusted', format_boolean),
('Blocked', format_boolean),
('LegacyPairing', format_boolean),
('RSSI', format_rssi),
('Connected', format_boolean),
('UUIDs', format_uuids),
('Modalias', None),
('Adapter', None),
# FIXME below 3 we need some sample data to decode and display properly
('ManufacturerData', str),
('ServiceData', str),
('AdvertisingData', str)
)
for name, func in properties:
try:
if func is None:
store.append((name, device.get(name)))
else:
store.append((name, func(device.get(name))))
except BluezDBusException:
logging.info(f"Could not get property {name}")
pass
except ValueError:
logging.info(f"Could not add property {name}")
pass
dialog.run()
dialog.destroy()
class Info(ManagerPlugin, MenuItemsProvider):
def on_request_menu_items(
self,
manager_menu: ManagerDeviceMenu,
device: Device,
_powered: bool,
) -> List[DeviceMenuItem]:
item = create_menuitem(_("_Info"), "dialog-information-symbolic")
item.props.tooltip_text = _("Show device information")
_window = manager_menu.get_toplevel()
assert isinstance(_window, Gtk.Window)
window = _window # https://github.com/python/mypy/issues/2608
item.connect('activate', lambda x: show_info(device, window))
return [DeviceMenuItem(item, DeviceMenuItem.Group.ACTIONS, 400)]
blueman-2.4.3/blueman/plugins/manager/Makefile.am 0000664 0000000 0000000 00000000464 14650545052 0021727 0 ustar 00root root 0000000 0000000 SUBDIRS =
bluemandir = $(pythondir)/blueman/plugins/manager
blueman_PYTHON = \
Info.py \
Notes.py \
Services.py \
__init__.py
if HAVE_PULSEAUDIO
blueman_PYTHON += PulseAudioProfile.py
endif
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/plugins/manager/Makefile.in 0000664 0000000 0000000 00000057315 14650545052 0021747 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_PULSEAUDIO_TRUE@am__append_1 = PulseAudioProfile.py
subdir = blueman/plugins/manager
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__blueman_PYTHON_DIST) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__blueman_PYTHON_DIST = Info.py Notes.py Services.py __init__.py \
PulseAudioProfile.py
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS =
bluemandir = $(pythondir)/blueman/plugins/manager
blueman_PYTHON = Info.py Notes.py Services.py __init__.py \
$(am__append_1)
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/plugins/manager/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/plugins/manager/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/plugins/manager/Notes.py 0000664 0000000 0000000 00000004527 14650545052 0021341 0 ustar 00root root 0000000 0000000 import datetime
from gettext import gettext as _
from tempfile import NamedTemporaryFile
from typing import List
from blueman.Functions import create_menuitem, launch
from blueman.bluez.Device import Device
from blueman.gui.manager.ManagerDeviceMenu import MenuItemsProvider, ManagerDeviceMenu, DeviceMenuItem
from blueman.main.Builder import Builder
from blueman.plugins.ManagerPlugin import ManagerPlugin
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
def send_note_cb(dialog: Gtk.Dialog, response_id: int, device_address: str, text_view: Gtk.Entry) -> None:
text = text_view.get_buffer().props.text
dialog.destroy()
if response_id == Gtk.ResponseType.REJECT:
return
date = datetime.datetime.now().strftime('%Y%m%dT%H%M00')
data = ('BEGIN:VNOTE \n'
'VERSION:1.1 \n'
f'BODY;CHARSET=UTF-8: {" ".join(text.splitlines())} \n'
f'DCREATED:{date} \n'
f'LAST-MODIFIED:{date} \n'
'CLASS:PUBLIC \n'
'X-IRMC-LUID:000001000000 \n'
'END:VNOTE \n')
tempfile = NamedTemporaryFile(suffix='.vnt', prefix='note', delete=False)
tempfile.write(data.encode('utf-8'))
tempfile.close()
launch(f"blueman-sendto --delete --device={device_address}", paths=[tempfile.name])
def send_note(device: Device, parent: Gtk.ApplicationWindow) -> None:
builder = Builder("note.ui")
dialog = builder.get_widget("dialog", Gtk.Dialog)
dialog.set_transient_for(parent)
dialog.props.icon_name = 'blueman'
note = builder.get_widget("note", Gtk.Entry)
dialog.connect('response', send_note_cb, device['Address'], note)
dialog.present()
class Notes(ManagerPlugin, MenuItemsProvider):
def on_request_menu_items(
self,
manager_menu: ManagerDeviceMenu,
device: Device,
powered: bool,
) -> List[DeviceMenuItem]:
if not powered:
return []
item = create_menuitem(_("Send _note"), "dialog-information-symbolic")
item.props.tooltip_text = _("Send a text note")
assert isinstance(manager_menu.Blueman.window, Gtk.ApplicationWindow)
window = manager_menu.Blueman.window # https://github.com/python/mypy/issues/2608
item.connect('activate', lambda x: send_note(device, window))
return [DeviceMenuItem(item, DeviceMenuItem.Group.ACTIONS, 500)]
blueman-2.4.3/blueman/plugins/manager/PulseAudioProfile.py 0000664 0000000 0000000 00000011620 14650545052 0023634 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from typing import Dict, List, TYPE_CHECKING, Mapping, Sequence
from blueman.bluez.Device import Device
from blueman.plugins.ManagerPlugin import ManagerPlugin
from blueman.main.PulseAudioUtils import PulseAudioUtils, EventType
from blueman.gui.manager.ManagerDeviceMenu import ManagerDeviceMenu, MenuItemsProvider, DeviceMenuItem
from blueman.Functions import create_menuitem
from blueman.Sdp import AUDIO_SOURCE_SVCLASS_ID, AUDIO_SINK_SVCLASS_ID, ServiceUUID
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
if TYPE_CHECKING:
from blueman.main.PulseAudioUtils import CardInfo # noqa: F401
class PulseAudioProfile(ManagerPlugin, MenuItemsProvider):
def on_load(self) -> None:
self.devices: Dict[str, "CardInfo"] = {}
self.deferred: List[Device] = []
pa = PulseAudioUtils()
pa.connect("event", self.on_pa_event)
pa.connect("connected", self.on_pa_ready)
def on_pa_ready(self, _utils: PulseAudioUtils) -> None:
logging.info("connected")
for dev in self.deferred:
self.regenerate_with_device(dev['Address'])
self.deferred = []
# updates all menu instances with the following device address
def regenerate_with_device(self, device_addr: str) -> None:
for inst in ManagerDeviceMenu.__instances__:
if inst.SelectedDevice['Address'] == device_addr and not inst.is_popup:
inst.generate()
def on_pa_event(self, utils: PulseAudioUtils, event: int, idx: int) -> None:
logging.debug(f"{event} {idx}")
def get_card_cb(card: "CardInfo") -> None:
drivers = ("module-bluetooth-device.c",
"module-bluez4-device.c",
"module-bluez5-device.c")
if card["driver"] in drivers:
self.devices[card["proplist"]["device.string"]] = card
self.regenerate_with_device(card["proplist"]["device.string"])
if event & EventType.CARD:
logging.info("card")
if event & EventType.CHANGE:
logging.info("change")
utils.get_card(idx, get_card_cb)
elif event & EventType.REMOVE:
logging.info("remove")
else:
logging.info("add")
utils.get_card(idx, get_card_cb)
def query_pa(self, device: Device, item: Gtk.MenuItem) -> None:
def list_cb(cards: Mapping[str, "CardInfo"]) -> None:
for c in cards.values():
if c["proplist"]["device.string"] == device['Address']:
self.devices[device['Address']] = c
self.generate_menu(device, item)
return
pa = PulseAudioUtils()
pa.list_cards(list_cb)
def on_selection_changed(self, item: Gtk.CheckMenuItem, device: Device, profile: str) -> None:
if item.get_active():
pa = PulseAudioUtils()
c = self.devices[device['Address']]
def on_result(res: int) -> None:
if not res:
self.parent.infobar_update(_("Failed to change profile to %s" % profile))
pa.set_card_profile(c["index"], profile, on_result)
def generate_menu(self, device: Device, item: Gtk.MenuItem) -> None:
info = self.devices[device['Address']]
group: Sequence[Gtk.RadioMenuItem] = []
sub = Gtk.Menu()
if info:
for profile in info["profiles"]:
i = Gtk.RadioMenuItem.new_with_label(group, profile["description"])
group = i.get_group()
if profile["name"] == info["active_profile"]:
i.set_active(True)
i.connect("toggled", self.on_selection_changed,
device, profile["name"])
sub.append(i)
i.show()
item.set_submenu(sub)
item.show()
def on_request_menu_items(
self,
manager_menu: ManagerDeviceMenu,
device: Device,
_powered: bool,
) -> List[DeviceMenuItem]:
audio_source = False
for uuid in device['UUIDs']:
if ServiceUUID(uuid).short_uuid in (AUDIO_SOURCE_SVCLASS_ID, AUDIO_SINK_SVCLASS_ID):
audio_source = True
break
if device['Connected'] and audio_source:
pa = PulseAudioUtils()
if not pa.connected:
self.deferred.append(device)
return []
item = create_menuitem(_("Audio Profile"), "audio-card-symbolic")
item.props.tooltip_text = _("Select audio profile for PulseAudio")
if not device['Address'] in self.devices:
self.query_pa(device, item)
else:
self.generate_menu(device, item)
else:
return []
return [DeviceMenuItem(item, DeviceMenuItem.Group.ACTIONS, 300)]
blueman-2.4.3/blueman/plugins/manager/Services.py 0000664 0000000 0000000 00000010345 14650545052 0022027 0 ustar 00root root 0000000 0000000 from typing import List, Callable
import cairo
from blueman.bluez.Device import Device
from blueman.config.AutoConnectConfig import AutoConnectConfig
from blueman.gui.manager.ManagerDeviceMenu import MenuItemsProvider, ManagerDeviceMenu, DeviceMenuItem
from blueman.plugins.ManagerPlugin import ManagerPlugin
from blueman.Functions import create_menuitem
from blueman.main.DBusProxies import AppletService
from blueman.services import get_services
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class Services(ManagerPlugin, MenuItemsProvider):
def on_load(self) -> None:
self.icon_theme = Gtk.IconTheme.get_default()
def _make_x_icon(self, icon_name: str, size: int) -> cairo.ImageSurface:
assert self.parent.window is not None
scale = self.parent.window.get_scale_factor()
window = self.parent.window.get_window()
target = self.icon_theme.load_surface(icon_name, size, scale, window, Gtk.IconLookupFlags.FORCE_SIZE)
assert isinstance(target, cairo.ImageSurface)
bmx = self.icon_theme.load_surface("blueman-x", size, scale, window, Gtk.IconLookupFlags.FORCE_SIZE)
assert isinstance(bmx, cairo.ImageSurface)
x = target.get_width() - bmx.get_width()
y = target.get_height() - bmx.get_height()
context = cairo.Context(target)
context.set_source_surface(bmx, x, y)
context.paint()
return target
def on_request_menu_items(
self,
manager_menu: ManagerDeviceMenu,
device: Device,
powered: bool,
) -> List[DeviceMenuItem]:
items: List[DeviceMenuItem] = []
appl = AppletService()
services = get_services(device)
if powered:
connectable_services = [service for service in services if service.connectable]
for service in connectable_services:
item: Gtk.MenuItem = create_menuitem(service.name, service.icon)
if service.description:
item.props.tooltip_text = service.description
item.connect("activate", lambda _item: manager_menu.connect_service(service.device, service.uuid))
items.append(DeviceMenuItem(item, DeviceMenuItem.Group.CONNECT, service.priority))
item.props.sensitive = service.available
item.show()
connected_services = [service for service in services if service.connected_instances]
for service in connected_services:
for instance in service.connected_instances:
surface = self._make_x_icon(service.icon, 16)
item = create_menuitem(instance.name, surface=surface)
item.connect(
"activate",
lambda _item: manager_menu.disconnect_service(service.device, service.uuid, instance.port)
)
items.append(DeviceMenuItem(item, DeviceMenuItem.Group.DISCONNECT, service.priority + 100))
item.show()
object_path = device.get_object_path()
if services:
config = AutoConnectConfig()
autoconnect_services = set(config["services"])
for service in services:
if service.connected_instances or (object_path, service.uuid) in autoconnect_services:
item = Gtk.CheckMenuItem(label=service.name)
config.bind_to_menuitem(item, (object_path, service.uuid))
item.show()
items.append(DeviceMenuItem(item, DeviceMenuItem.Group.AUTOCONNECT, service.priority))
for action, priority in set((action, service.priority)
for service in services for action in service.common_actions
if any(plugin in appl.QueryPlugins() for plugin in action.plugins)):
item = create_menuitem(action.title, action.icon)
items.append(DeviceMenuItem(item, DeviceMenuItem.Group.ACTIONS, priority + 200))
item.show()
item.connect("activate", self._get_activation_handler(action.callback))
return items
@staticmethod
def _get_activation_handler(callback: Callable[[], None]) -> Callable[[Gtk.MenuItem], None]:
return lambda _: callback()
blueman-2.4.3/blueman/plugins/manager/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0021766 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/mechanism/ 0000775 0000000 0000000 00000000000 14650545052 0020221 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/mechanism/Makefile.am 0000664 0000000 0000000 00000000346 14650545052 0022260 0 ustar 00root root 0000000 0000000
bluemandir = $(pythondir)/blueman/plugins/mechanism
blueman_PYTHON = __init__.py Network.py Ppp.py Rfcomm.py RfKill.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/plugins/mechanism/Makefile.in 0000664 0000000 0000000 00000042506 14650545052 0022275 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/plugins/mechanism
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/plugins/mechanism
blueman_PYTHON = __init__.py Network.py Ppp.py Rfcomm.py RfKill.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/plugins/mechanism/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/plugins/mechanism/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/plugins/mechanism/Network.py 0000664 0000000 0000000 00000004154 14650545052 0022230 0 ustar 00root root 0000000 0000000 from typing import Callable, Union, Dict, Type, TYPE_CHECKING
from blueman.bluez.Network import Network as BluezNetwork
from blueman.plugins.MechanismPlugin import MechanismPlugin
from blueman.main.NetConf import NetConf, DnsMasqHandler, DhcpdHandler, UdhcpdHandler
if TYPE_CHECKING:
from blueman.main.NetConf import DHCPHandler
DHCPDHANDLERS: Dict[str, Type["DHCPHandler"]] = {
"DnsMasqHandler": DnsMasqHandler,
"DhcpdHandler": DhcpdHandler,
"UdhcpdHandler": UdhcpdHandler
}
class Network(MechanismPlugin):
def on_load(self) -> None:
self.parent.add_method("DhcpClient", ("s",), "s", self._run_dhcp_client, pass_sender=True, is_async=True)
self.parent.add_method("EnableNetwork", ("s", "s", "s", "b"), "", self._enable_network, pass_sender=True)
self.parent.add_method("DisableNetwork", (), "", self._disable_network, pass_sender=True)
def _run_dhcp_client(self, object_path: str, caller: str, ok: Callable[[str], None],
err: Callable[[Union[Exception, int]], None]) -> None:
self.timer.stop()
self.confirm_authorization(caller, "org.blueman.dhcp.client")
from blueman.main.DhcpClient import DhcpClient
def dh_error(_dh: DhcpClient, num: int) -> None:
err(num)
self.timer.resume()
def dh_connected(_dh: DhcpClient, ip: str) -> None:
ok(ip)
self.timer.resume()
dh = DhcpClient(BluezNetwork(obj_path=object_path)["Interface"])
dh.connect("error-occurred", dh_error)
dh.connect("connected", dh_connected)
try:
dh.run()
except Exception as e:
err(e)
def _enable_network(self, ip_address: str, netmask: str, dhcp_handler: str, address_changed: bool,
caller: str) -> None:
self.confirm_authorization(caller, "org.blueman.network.setup")
NetConf.apply_settings(ip_address, netmask, DHCPDHANDLERS[dhcp_handler], address_changed)
def _disable_network(self, caller: str) -> None:
self.confirm_authorization(caller, "org.blueman.network.setup")
NetConf.clean_up()
blueman-2.4.3/blueman/plugins/mechanism/Ppp.py 0000664 0000000 0000000 00000002076 14650545052 0021337 0 ustar 00root root 0000000 0000000 from typing import Callable
from blueman.main.PPPConnection import PPPConnection
from blueman.plugins.MechanismPlugin import MechanismPlugin
class Ppp(MechanismPlugin):
def on_load(self) -> None:
self.parent.add_method("PPPConnect", ("u", "s", "s"), "s", self._ppp_connect, pass_sender=True, is_async=True)
def _ppp_connected(self, _ppp: PPPConnection, port: str, ok: Callable[[str], None]) -> None:
ok(port)
self.timer.resume()
def _ppp_error(self, _ppp: PPPConnection, message: str, err: Callable[[str], None]) -> None:
err(message)
self.timer.resume()
def _ppp_connect(self, port: int, number: str, apn: str, caller: str,
ok: Callable[[str], None], err: Callable[[str], None]) -> None:
self.confirm_authorization(caller, "org.blueman.pppd.pppconnect")
self.timer.stop()
ppp = PPPConnection(f"/dev/rfcomm{port:d}", number, apn)
ppp.connect("error-occurred", self._ppp_error, err)
ppp.connect("connected", self._ppp_connected, ok)
ppp.connect_rfcomm()
blueman-2.4.3/blueman/plugins/mechanism/RfKill.py 0000664 0000000 0000000 00000001357 14650545052 0021764 0 ustar 00root root 0000000 0000000 import os
import struct
from blueman.plugins.MechanismPlugin import MechanismPlugin
from blueman.plugins.applet.KillSwitch import RFKILL_TYPE_BLUETOOTH, RFKILL_OP_CHANGE_ALL
if not os.path.exists('/dev/rfkill'):
raise ImportError("Hardware kill switch not found")
class RfKill(MechanismPlugin):
def on_load(self) -> None:
self.parent.add_method("SetRfkillState", ("b",), "", self._set_rfkill_state, pass_sender=True)
def _set_rfkill_state(self, state: bool, caller: str) -> None:
self.confirm_authorization(caller, "org.blueman.rfkill.setstate")
with open('/dev/rfkill', 'r+b', buffering=0) as f:
f.write(struct.pack("IBBBB", 0, RFKILL_TYPE_BLUETOOTH, RFKILL_OP_CHANGE_ALL, (0 if state else 1), 0))
blueman-2.4.3/blueman/plugins/mechanism/Rfcomm.py 0000664 0000000 0000000 00000001563 14650545052 0022023 0 ustar 00root root 0000000 0000000 import os
import subprocess
import signal
from blueman.Constants import RFCOMM_WATCHER_PATH
from blueman.plugins.MechanismPlugin import MechanismPlugin
class Rfcomm(MechanismPlugin):
def on_load(self) -> None:
self.parent.add_method("OpenRFCOMM", ("d",), "", self._open_rfcomm)
self.parent.add_method("CloseRFCOMM", ("d",), "", self._close_rfcomm)
def _open_rfcomm(self, port_id: int) -> None:
subprocess.Popen([RFCOMM_WATCHER_PATH, f"/dev/rfcomm{port_id:d}"])
def _close_rfcomm(self, port_id: int) -> None:
out, err = subprocess.Popen(['ps', '-e', 'o', 'pid,args'], stdout=subprocess.PIPE).communicate()
for line in out.decode("UTF-8").splitlines():
pid, cmdline = line.split(maxsplit=1)
if f"blueman-rfcomm-watcher /dev/rfcomm{port_id:d}" in cmdline:
os.kill(int(pid), signal.SIGTERM)
blueman-2.4.3/blueman/plugins/mechanism/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0022320 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/services/ 0000775 0000000 0000000 00000000000 14650545052 0020100 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/plugins/services/Makefile.am 0000664 0000000 0000000 00000000337 14650545052 0022137 0 ustar 00root root 0000000 0000000
bluemandir = $(pythondir)/blueman/plugins/services
blueman_PYTHON = \
Network.py \
Transfer.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/plugins/services/Makefile.in 0000664 0000000 0000000 00000042475 14650545052 0022161 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/plugins/services
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/plugins/services
blueman_PYTHON = \
Network.py \
Transfer.py \
__init__.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/plugins/services/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/plugins/services/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/plugins/services/Network.py 0000664 0000000 0000000 00000023725 14650545052 0022114 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from random import randint
import logging
import ipaddress
from typing import List, Tuple, cast, Union, TYPE_CHECKING
from blueman.Functions import have, get_local_interfaces
from blueman.main.Builder import Builder
from blueman.plugins.ServicePlugin import ServicePlugin
from blueman.main.DBusProxies import Mechanism
from blueman.main.DBusProxies import AppletService
from blueman.gui.CommonUi import ErrorDialog
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gio, Gtk, GObject
if TYPE_CHECKING:
from typing_extensions import Literal
class Network(ServicePlugin):
__plugin_info__ = (_("Network"), "network-workgroup")
def on_load(self) -> None:
self._builder = Builder("services-network.ui")
self.widget = self._builder.get_widget("network", Gtk.Grid)
self.interfaces: List[Tuple[str, Union[ipaddress.IPv4Interface, ipaddress.IPv6Interface]]] = []
netifs = get_local_interfaces()
for iface in netifs:
if iface != "lo" and iface != "pan1":
logging.info(iface)
ipiface = ipaddress.ip_interface('/'.join(cast(Tuple[str, str], netifs[iface])))
self.interfaces.append((iface, ipiface))
self.setup_network()
try:
self.ip_check()
except (ValueError, ipaddress.AddressValueError) as e:
logging.exception(e)
def on_apply(self) -> None:
if self.on_query_apply_state():
logging.info("network apply")
m = Mechanism()
nap_enable = self._builder.get_widget("nap-enable", Gtk.CheckButton)
if nap_enable.props.active:
if self._builder.get_widget("r_dhcpd", Gtk.RadioButton).props.active:
stype = "DhcpdHandler"
elif self._builder.get_widget("r_dnsmasq", Gtk.RadioButton).props.active:
stype = "DnsMasqHandler"
elif self._builder.get_widget("r_udhcpd", Gtk.RadioButton).props.active:
stype = "UdhcpdHandler"
net_ip = self._builder.get_widget("net_ip", Gtk.Entry)
try:
changed = net_ip.props.text != self.Config["ip4-address"]
m.EnableNetwork('(sssb)', net_ip.props.text, "255.255.255.0", stype, changed)
if not self.Config["nap-enable"]:
self.Config["nap-enable"] = True
self.Config["ip4-address"] = net_ip.props.text
self.Config["dhcp-handler"] = stype
except Exception as e:
parent = self.widget.get_toplevel()
assert isinstance(parent, Gtk.Container)
d = ErrorDialog("Failed to apply network settings", excp=e, parent=parent)
d.run()
d.destroy()
return
else:
self.Config["nap-enable"] = False
m.DisableNetwork()
self.clear_options()
def ip_check(self) -> None:
entry = self._builder.get_widget("net_ip", Gtk.Entry)
try:
nap_ipiface = ipaddress.ip_interface('/'.join((entry.props.text, '255.255.255.0')))
except (ValueError, ipaddress.AddressValueError):
entry.props.secondary_icon_name = "dialog-error"
entry.props.secondary_icon_tooltip_text = _("Invalid IP address")
raise
for iface, ipiface in self.interfaces:
if nap_ipiface.ip == ipiface.ip:
error_message = _("IP address conflicts with interface %s which has the same address" % iface)
tooltip_text = error_message
entry.props.secondary_icon_name = "dialog-error"
entry.props.secondary_icon_tooltip_text = tooltip_text
raise ValueError(error_message)
elif nap_ipiface.network == ipiface.network:
tooltip_text = _(
"IP address overlaps with subnet of interface %s, which has the following configuration %s/%s\n"
"This may cause incorrect network behavior" % (iface, ipiface.ip, ipiface.netmask))
entry.props.secondary_icon_name = "dialog-warning"
entry.props.secondary_icon_tooltip_text = tooltip_text
return
entry.props.secondary_icon_name = None
def on_query_apply_state(self) -> Union[bool, "Literal[-1]"]:
opts = self.get_options()
if not opts:
return False
if "ip" in opts:
try:
self.ip_check()
except (ValueError, ipaddress.AddressValueError) as e:
logging.exception(e)
return -1
return True
def setup_network(self) -> None:
self.Config = Gio.Settings(schema_id="org.blueman.network")
nap_enable = self._builder.get_widget("nap-enable", Gtk.CheckButton)
r_dnsmasq = self._builder.get_widget("r_dnsmasq", Gtk.RadioButton)
r_dhcpd = self._builder.get_widget("r_dhcpd", Gtk.RadioButton)
r_udhcpd = self._builder.get_widget("r_udhcpd", Gtk.RadioButton)
net_ip = self._builder.get_widget("net_ip", Gtk.Entry)
rb_nm = self._builder.get_widget("rb_nm", Gtk.RadioButton)
rb_blueman = self._builder.get_widget("rb_blueman", Gtk.RadioButton)
rb_dun_nm = self._builder.get_widget("rb_dun_nm", Gtk.RadioButton)
rb_dun_blueman = self._builder.get_widget("rb_dun_blueman", Gtk.RadioButton)
nap_frame = self._builder.get_widget("nap_frame", Gtk.Frame)
warning = self._builder.get_widget("warning", Gtk.Box)
if not self.Config["nap-enable"]:
nap_frame.props.sensitive = False
if self.Config["ip4-address"] is not None:
net_ip.props.text = self.Config["ip4-address"]
nap_enable.props.active = True
else:
net_ip.props.text = f"10.{randint(0, 255):d}.{randint(0, 255):d}.1"
if self.Config["dhcp-handler"] is None:
nap_frame.props.sensitive = False
nap_enable.props.active = False
r_dnsmasq.props.active = True
self.Config["nap-enable"] = False
have_dhcpd = have("dhcpd3") or have("dhcpd")
have_dnsmasq = have("dnsmasq")
have_udhcpd = have("udhcpd")
if self.Config["dhcp-handler"] == "DnsMasqHandler" and have_dnsmasq:
r_dnsmasq.props.active = True
elif self.Config["dhcp-handler"] == "DhcpdHandler" and have_dhcpd:
r_dhcpd.props.active = True
elif self.Config["dhcp-handler"] == "UdhcpdHandler" and have_udhcpd:
r_udhcpd.props.active = True
else:
r_dnsmasq.props.active = True
if not have_dnsmasq and not have_dhcpd and not have_udhcpd:
nap_frame.props.sensitive = False
warning.props.visible = True
warning.props.sensitive = True
nap_enable.props.sensitive = False
self.Config["nap-enable"] = False
if not have_dnsmasq:
r_dnsmasq.props.sensitive = False
r_dnsmasq.props.active = False
if not have_dhcpd:
r_dhcpd.props.sensitive = False
r_dhcpd.props.active = False
if not have_udhcpd:
r_udhcpd.props.sensitive = False
r_udhcpd.props.active = False
r_dnsmasq.connect("toggled", lambda x: self.option_changed_notify("dnsmasq"))
r_dhcpd.connect("toggled", lambda x: self.option_changed_notify("dhcpd"))
r_udhcpd.connect("toggled", lambda x: self.option_changed_notify("udhcpd"))
net_ip.connect("changed", lambda x: self.option_changed_notify("ip", False))
nap_enable.connect("toggled", lambda x: self.option_changed_notify("nap_enable"))
self.Config.bind("nap-enable", nap_enable, "active", Gio.SettingsBindFlags.GET)
nap_enable.bind_property("active", nap_frame, "sensitive", GObject.BindingFlags.DEFAULT)
applet = AppletService()
avail_plugins = applet.QueryAvailablePlugins()
active_plugins = applet.QueryPlugins()
def dun_support_toggled(rb: Gtk.RadioButton, x: str) -> None:
if rb.props.active and x == "nm":
applet.SetPluginConfig('(sb)', "PPPSupport", False)
applet.SetPluginConfig('(sb)', "NMDUNSupport", True)
elif rb.props.active and x == "blueman":
applet.SetPluginConfig('(sb)', "NMDUNSupport", False)
applet.SetPluginConfig('(sb)', "PPPSupport", True)
def pan_support_toggled(rb: Gtk.RadioButton, x: str) -> None:
if rb.props.active and x == "nm":
applet.SetPluginConfig('(sb)', "DhcpClient", False)
applet.SetPluginConfig('(sb)', "NMPANSupport", True)
elif rb.props.active and x == "blueman":
applet.SetPluginConfig('(sb)', "NMPANSupport", False)
applet.SetPluginConfig('(sb)', "DhcpClient", True)
if "PPPSupport" in active_plugins:
rb_dun_blueman.props.active = True
if "NMDUNSupport" in avail_plugins:
rb_dun_nm.props.sensitive = True
else:
rb_dun_nm.props.sensitive = False
rb_dun_nm.props.tooltip_text = _("Not currently supported with this setup")
if "DhcpClient" in active_plugins:
rb_blueman.props.active = True
if "NMPANSupport" in avail_plugins:
rb_nm.props.sensitive = True
else:
rb_nm.props.sensitive = False
rb_nm.props.tooltip_text = _("Not currently supported with this setup")
if "NMPANSupport" in active_plugins:
rb_nm.props.active = True
if "NMDUNSupport" in active_plugins:
rb_dun_nm.props.active = True
rb_nm.connect("toggled", pan_support_toggled, "nm")
rb_blueman.connect("toggled", pan_support_toggled, "blueman")
rb_dun_nm.connect("toggled", dun_support_toggled, "nm")
rb_dun_blueman.connect("toggled", dun_support_toggled, "blueman")
blueman-2.4.3/blueman/plugins/services/Transfer.py 0000664 0000000 0000000 00000005107 14650545052 0022241 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
from blueman.main.Builder import Builder
from blueman.plugins.ServicePlugin import ServicePlugin
from blueman.main.DBusProxies import AppletService
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gio
class Transfer(ServicePlugin):
__plugin_info__ = (_("Transfer"), "folder")
def on_load(self) -> None:
self._builder = Builder("services-transfer.ui")
self.widget = self._builder.get_widget("transfer", Gtk.Grid)
a = AppletService()
if "TransferService" in a.QueryPlugins():
self._setup_transfer()
else:
self.widget.props.sensitive = False
self.widget.props.tooltip_text = _("Applet's transfer service plugin is disabled")
def on_property_changed(self, config: Gio.Settings, key: str) -> None:
value = config[key]
if key == "shared-path":
self._builder.get_widget(key, Gtk.FileChooserButton).set_current_folder(value)
self.option_changed_notify(key, False)
def on_apply(self) -> None:
if self.on_query_apply_state():
for opt in self.get_options():
if opt == "shared-path":
shared_path = self._builder.get_widget("shared-path", Gtk.FileChooserButton)
self._config["shared-path"] = shared_path.get_filename()
elif opt == "opp-accept":
opp_accept = self._builder.get_widget("opp-accept", Gtk.CheckButton)
self._config["opp-accept"] = opp_accept.get_active()
else:
raise NotImplementedError(f"Unknow option: {opt}")
self.clear_options()
logging.info("transfer apply")
def on_query_apply_state(self) -> bool:
opts = self.get_options()
if not opts:
return False
else:
return True
def _setup_transfer(self) -> None:
self._config = Gio.Settings(schema_id="org.blueman.transfer")
self._config.connect("changed", self.on_property_changed)
opp_accept = self._builder.get_widget("opp-accept", Gtk.CheckButton)
shared_path = self._builder.get_widget("shared-path", Gtk.FileChooserButton)
opp_accept.props.active = self._config["opp-accept"]
if self._config["shared-path"]:
shared_path.set_current_folder(self._config["shared-path"])
opp_accept.connect("toggled", lambda x: self.option_changed_notify("opp-accept"))
shared_path.connect("file-set", lambda x: self.option_changed_notify("shared-path"))
blueman-2.4.3/blueman/plugins/services/__init__.py 0000664 0000000 0000000 00000000000 14650545052 0022177 0 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/services/ 0000775 0000000 0000000 00000000000 14650545052 0016417 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/services/DialupNetwork.py 0000664 0000000 0000000 00000001326 14650545052 0021563 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Set
from blueman.Service import Action
from blueman.services.meta import SerialService
from blueman.Sdp import DIALUP_NET_SVCLASS_ID
from blueman.gui.GsmSettings import GsmSettings
class DialupNetwork(SerialService):
__svclass_id__ = DIALUP_NET_SVCLASS_ID
__icon__ = "modem"
__priority__ = 50
@property
def common_actions(self) -> Set[Action]:
def open_settings() -> None:
d = GsmSettings(self.device['Address'])
d.run()
d.destroy()
return {Action(
_("Dialup Settings"),
"preferences-other",
{'PPPSupport', 'NMDUNSupport'},
open_settings
)}
blueman-2.4.3/blueman/services/Functions.py 0000664 0000000 0000000 00000001467 14650545052 0020751 0 ustar 00root root 0000000 0000000 import inspect
import logging
from typing import Optional, List
from blueman.Service import Service
from blueman.Sdp import ServiceUUID
from blueman.bluez.Device import Device
from blueman.bluez.errors import BluezDBusException
import blueman.services
def get_service(device: Device, uuid: str) -> Optional[Service]:
for name, cls in inspect.getmembers(blueman.services, inspect.isclass):
if ServiceUUID(uuid).short_uuid == cls.__svclass_id__:
svc: Service = cls(device, uuid)
return svc
return None
def get_services(device: Device) -> List[Service]:
try:
services = (get_service(device, uuid) for uuid in device['UUIDs'])
return [service for service in services if service]
except BluezDBusException as e:
logging.exception(e)
return []
blueman-2.4.3/blueman/services/GroupNetwork.py 0000664 0000000 0000000 00000000341 14650545052 0021435 0 ustar 00root root 0000000 0000000 from blueman.services.meta import NetworkService
from blueman.Sdp import GN_SVCLASS_ID
class GroupNetwork(NetworkService):
__svclass_id__ = GN_SVCLASS_ID
__icon__ = "network-wireless-symbolic"
__priority__ = 80
blueman-2.4.3/blueman/services/Makefile.am 0000664 0000000 0000000 00000000475 14650545052 0020461 0 ustar 00root root 0000000 0000000 SUBDIRS = meta
bluemandir = $(pythondir)/blueman/services
blueman_PYTHON = \
__init__.py \
DialupNetwork.py \
Functions.py \
GroupNetwork.py \
NetworkAccessPoint.py \
SerialPort.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/services/Makefile.in 0000664 0000000 0000000 00000057134 14650545052 0020476 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/services
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = meta
bluemandir = $(pythondir)/blueman/services
blueman_PYTHON = \
__init__.py \
DialupNetwork.py \
Functions.py \
GroupNetwork.py \
NetworkAccessPoint.py \
SerialPort.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/services/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/services/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-bluemanPYTHON \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/services/NetworkAccessPoint.py 0000664 0000000 0000000 00000000351 14650545052 0022555 0 ustar 00root root 0000000 0000000 from blueman.services.meta import NetworkService
from blueman.Sdp import NAP_SVCLASS_ID
class NetworkAccessPoint(NetworkService):
__svclass_id__ = NAP_SVCLASS_ID
__icon__ = "network-wireless-symbolic"
__priority__ = 81
blueman-2.4.3/blueman/services/SerialPort.py 0000664 0000000 0000000 00000000344 14650545052 0021056 0 ustar 00root root 0000000 0000000 from blueman.services.meta import SerialService
from blueman.Sdp import SERIAL_PORT_SVCLASS_ID
class SerialPort(SerialService):
__svclass_id__ = SERIAL_PORT_SVCLASS_ID
__icon__ = "blueman-serial"
__priority__ = 50
blueman-2.4.3/blueman/services/__init__.py 0000664 0000000 0000000 00000000773 14650545052 0020537 0 ustar 00root root 0000000 0000000 from blueman.services.DialupNetwork import DialupNetwork as DialupNetwork
from blueman.services.GroupNetwork import GroupNetwork as GroupNetwork
from blueman.services.NetworkAccessPoint import NetworkAccessPoint as NetworkAccessPoint
from blueman.services.SerialPort import SerialPort as SerialPort
from blueman.services.Functions import get_service as get_service, get_services as get_services
__all__ = ["DialupNetwork", "GroupNetwork", "NetworkAccessPoint", "SerialPort", "get_service", "get_services"]
blueman-2.4.3/blueman/services/meta/ 0000775 0000000 0000000 00000000000 14650545052 0017345 5 ustar 00root root 0000000 0000000 blueman-2.4.3/blueman/services/meta/Makefile.am 0000664 0000000 0000000 00000000362 14650545052 0021402 0 ustar 00root root 0000000 0000000 bluemandir = $(pythondir)/blueman/services/meta
blueman_PYTHON = \
__init__.py \
NetworkService.py \
SerialService.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
clean-local:
rm -rf *.pyc *.pyo
blueman-2.4.3/blueman/services/meta/Makefile.in 0000664 0000000 0000000 00000042505 14650545052 0021420 0 ustar 00root root 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = blueman/services/meta
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(blueman_PYTHON) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(bluemandir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
py_compile = $(top_srcdir)/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
BLUEZ_CFLAGS = @BLUEZ_CFLAGS@
BLUEZ_LIBS = @BLUEZ_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
CYTHONEXEC = @CYTHONEXEC@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALEDIR = @LOCALEDIR@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NETWORKTOOLS = @NETWORKTOOLS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGLIBDIR = @PKGLIBDIR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POLKIT = @POLKIT@
POLKIT_CFLAGS = @POLKIT_CFLAGS@
POLKIT_LIBS = @POLKIT_LIBS@
POSUB = @POSUB@
PYGOBJECT_CFLAGS = @PYGOBJECT_CFLAGS@
PYGOBJECT_LIBS = @PYGOBJECT_LIBS@
PYTHON = @PYTHON@
PYTHONDIR = @PYTHONDIR@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
dhconfig = @dhconfig@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gsettingsschemadir = @gsettingsschemadir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
icondir = @icondir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemd_system_unit_dir = @systemd_system_unit_dir@
systemd_user_unit_dir = @systemd_user_unit_dir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bluemandir = $(pythondir)/blueman/services/meta
blueman_PYTHON = \
__init__.py \
NetworkService.py \
SerialService.py
CLEANFILES = \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(CLEANFILES)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign blueman/services/meta/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign blueman/services/meta/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-bluemanPYTHON: $(blueman_PYTHON)
@$(NORMAL_INSTALL)
@list='$(blueman_PYTHON)'; dlist=; list2=; test -n "$(bluemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bluemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bluemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bluemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(bluemandir)" || exit $$?; \
done || exit $$?; \
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(bluemandir)" $$dlist; \
else :; fi
uninstall-bluemanPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(blueman_PYTHON)'; test -n "$(bluemandir)" || list=; \
py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(bluemandir)'; \
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
st=0; \
for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
dir='$(DESTDIR)$(bluemandir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done || exit $$?; \
exit $$st
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
for dir in "$(DESTDIR)$(bluemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-bluemanPYTHON
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-bluemanPYTHON
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-bluemanPYTHON install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-bluemanPYTHON
.PRECIOUS: Makefile
clean-local:
rm -rf *.pyc *.pyo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
blueman-2.4.3/blueman/services/meta/NetworkService.py 0000664 0000000 0000000 00000003425 14650545052 0022675 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
from typing import Optional, Callable, List, Set
from blueman.main.DBusProxies import AppletService
from blueman.Service import Service, Action, Instance
from blueman.bluez.Device import Device
from blueman.bluez.Network import Network
from blueman.bluez.errors import BluezDBusException
class NetworkService(Service):
def __init__(self, device: Device, uuid: str):
super().__init__(device, uuid)
self._service = Network(obj_path=device.get_object_path())
@property
def available(self) -> bool:
# This interface is only available after pairing
paired: bool = self.device["Paired"]
return paired
@property
def connectable(self) -> bool:
return not self.available or not self._service["Connected"]
@property
def connected_instances(self) -> List[Instance]:
return [] if self.connectable else [Instance(self.name)]
def connect(
self,
reply_handler: Optional[Callable[[str], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._service.connect(self.uuid, reply_handler=reply_handler, error_handler=error_handler)
def disconnect(
self,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[BluezDBusException], None]] = None,
) -> None:
self._service.disconnect(reply_handler=reply_handler, error_handler=error_handler)
@property
def common_actions(self) -> Set[Action]:
def renew() -> None:
AppletService().DhcpClient('(s)', self.device.get_object_path())
return {Action(
_("Renew IP Address"),
"view-refresh",
{"DhcpClient"},
renew
)}
blueman-2.4.3/blueman/services/meta/SerialService.py 0000664 0000000 0000000 00000010744 14650545052 0022465 0 ustar 00root root 0000000 0000000 from gettext import gettext as _
import logging
import os
import subprocess
from typing import Callable, Dict, Optional, List
from gi.repository import Gio, GLib
from blueman.bluez.Adapter import Adapter
from _blueman import create_rfcomm_device, get_rfcomm_channel, RFCOMMError, rfcomm_list
from blueman.Service import Service, Instance
from blueman.bluez.Device import Device
from blueman.main.DBusProxies import Mechanism
from blueman.Constants import RFCOMM_WATCHER_PATH
class SerialService(Service):
def __init__(self, device: Device, uuid: str) -> None:
super().__init__(device, uuid)
self._handlerids: Dict[int, int] = {}
@property
def available(self) -> bool:
# It will ask to pair anyway so not make it available
paired: bool = self.device["Paired"]
return paired
@property
def connectable(self) -> bool:
try:
rfcomm_list()
except RFCOMMError:
return False
return True
@property
def connected_instances(self) -> List[Instance]:
try:
lst = rfcomm_list()
except RFCOMMError as e:
logging.error(e)
return []
return [Instance(_("Serial Port %s") % "rfcomm%d" % dev["id"], dev["id"]) for dev in lst
if dev["dst"] == self.device['Address'] and dev["state"] == "connected"]
def on_file_changed(
self,
monitor: Gio.FileMonitor,
file: Gio.File,
_other_file: Gio.File,
event_type: Gio.FileMonitorEvent,
port: int
) -> None:
if event_type == Gio.FileMonitorEvent.DELETED:
logging.info(f'{file.get_path()} got deleted')
if port in self._handlerids:
handler_id = self._handlerids.pop(port)
monitor.disconnect(handler_id)
else:
logging.warning(f"No handler id for {port}")
elif event_type == Gio.FileMonitorEvent.ATTRIBUTE_CHANGED:
path = file.get_path()
assert path is not None
self.try_replace_root_watcher(monitor, path, port)
def try_replace_root_watcher(self, monitor: Gio.FileMonitor, path: str, port: int) -> None:
if not os.access(path, os.R_OK | os.W_OK):
return
logging.info(f'User was granted access to {path}')
logging.info('Replacing root watcher')
Mechanism().CloseRFCOMM('(d)', port)
subprocess.Popen([RFCOMM_WATCHER_PATH, path])
if port in self._handlerids:
handler_id = self._handlerids.pop(port)
monitor.disconnect(handler_id)
else:
logging.warning(f"No handler id for {port}")
def connect(
self,
reply_handler: Optional[Callable[[int], None]] = None,
error_handler: Optional[Callable[[RFCOMMError], None]] = None
) -> bool:
# We expect this service to have a reserved UUID
uuid = self.short_uuid
assert uuid
channel = get_rfcomm_channel(uuid, self.device['Address'])
if channel is None or channel == 0:
error = RFCOMMError("Failed to get rfcomm channel")
if error_handler:
error_handler(error)
return True
else:
raise error
try:
port_id = create_rfcomm_device(Adapter(obj_path=self.device["Adapter"])['Address'], self.device["Address"],
channel)
filename = f"/dev/rfcomm{port_id:d}"
logging.info('Starting rfcomm watcher as root')
Mechanism().OpenRFCOMM('(d)', port_id)
mon = Gio.File.new_for_path(filename).monitor_file(Gio.FileMonitorFlags.NONE)
self._handlerids[port_id] = mon.connect('changed', self.on_file_changed, port_id)
self.try_replace_root_watcher(mon, filename, port_id)
if reply_handler:
reply_handler(port_id)
except RFCOMMError as e:
if error_handler:
error_handler(e)
else:
raise e
return True
def disconnect(
self,
port_id: int,
reply_handler: Optional[Callable[[], None]] = None,
error_handler: Optional[Callable[[str], None]] = None
) -> None:
try:
Mechanism().CloseRFCOMM('(d)', port_id)
except GLib.Error as e:
if error_handler:
error_handler(e.message)
else:
raise
if reply_handler:
reply_handler()
blueman-2.4.3/blueman/services/meta/__init__.py 0000664 0000000 0000000 00000000320 14650545052 0021451 0 ustar 00root root 0000000 0000000 from blueman.services.meta.NetworkService import NetworkService as NetworkService
from blueman.services.meta.SerialService import SerialService as SerialService
__all__ = ["NetworkService", "SerialService"]
blueman-2.4.3/compile 0000775 0000000 0000000 00000016350 14650545052 0014534 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# 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 2, 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 .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
blueman-2.4.3/config.guess 0000775 0000000 0000000 00000140512 14650545052 0015474 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2022-01-09'
# This file 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 .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to .
# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX. However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
# Just in case it came from the environment.
GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
tmp=
# shellcheck disable=SC2172
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039,SC3028
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
fi
done
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#elif defined(__GLIBC__)
LIBC=gnu
#else
#include
/* First heuristic to detect musl libc. */
#ifdef __DEFINED_va_list
LIBC=musl
#endif
#endif
EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc"
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
command -v ldd >/dev/null &&
ldd --version 2>&1 | grep -q ^musl; then
LIBC=musl
fi
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
if [ "$LIBC" = unknown ]; then
LIBC=gnu
fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
case $UNAME_MACHINE_ARCH in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
case $UNAME_MACHINE_ARCH in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# Determine ABI tags.
case $UNAME_MACHINE_ARCH in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
GUESS=$machine-${os}${release}${abi-}
;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
;;
*:SecBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
;;
*:MidnightBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
;;
*:ekkoBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
;;
*:SolidBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
;;
*:OS108:*:*)
GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
;;
macppc:MirBSD:*:*)
GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
;;
*:MirBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
;;
*:Sortix:*:*)
GUESS=$UNAME_MACHINE-unknown-sortix
;;
*:Twizzler:*:*)
GUESS=$UNAME_MACHINE-unknown-twizzler
;;
*:Redox:*:*)
GUESS=$UNAME_MACHINE-unknown-redox
;;
mips:OSF1:*.*)
GUESS=mips-dec-osf1
;;
alpha:OSF1:*:*)
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
UNAME_MACHINE=alpha ;;
"EV5 (21164)")
UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
;;
Amiga*:UNIX_System_V:4.0:*)
GUESS=m68k-unknown-sysv4
;;
*:[Aa]miga[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-amigaos
;;
*:[Mm]orph[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-morphos
;;
*:OS/390:*:*)
GUESS=i370-ibm-openedition
;;
*:z/VM:*:*)
GUESS=s390-ibm-zvmoe
;;
*:OS400:*:*)
GUESS=powerpc-ibm-os400
;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
GUESS=arm-acorn-riscix$UNAME_RELEASE
;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
GUESS=arm-unknown-riscos
;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
GUESS=hppa1.1-hitachi-hiuxmpp
;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
case `(/bin/universe) 2>/dev/null` in
att) GUESS=pyramid-pyramid-sysv3 ;;
*) GUESS=pyramid-pyramid-bsd ;;
esac
;;
NILE*:*:*:dcosx)
GUESS=pyramid-pyramid-svr4
;;
DRS?6000:unix:4.0:6*)
GUESS=sparc-icl-nx6
;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) GUESS=sparc-icl-nx7 ;;
esac
;;
s390x:SunOS:*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
;;
sun4H:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-hal-solaris2$SUN_REL
;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris2$SUN_REL
;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
GUESS=i386-pc-auroraux$UNAME_RELEASE
;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris3$SUN_REL
;;
sun4*:SunOS:*:*)
case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
GUESS=sparc-sun-sunos$SUN_REL
;;
sun3*:SunOS:*:*)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case `/bin/arch` in
sun3)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
;;
aushp:SunOS:*:*)
GUESS=sparc-auspex-sunos$UNAME_RELEASE
;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
GUESS=m68k-milan-mint$UNAME_RELEASE
;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
GUESS=m68k-hades-mint$UNAME_RELEASE
;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
GUESS=m68k-unknown-mint$UNAME_RELEASE
;;
m68k:machten:*:*)
GUESS=m68k-apple-machten$UNAME_RELEASE
;;
powerpc:machten:*:*)
GUESS=powerpc-apple-machten$UNAME_RELEASE
;;
RISC*:Mach:*:*)
GUESS=mips-dec-mach_bsd4.3
;;
RISC*:ULTRIX:*:*)
GUESS=mips-dec-ultrix$UNAME_RELEASE
;;
VAX*:ULTRIX*:*:*)
GUESS=vax-dec-ultrix$UNAME_RELEASE
;;
2020:CLIX:*:* | 2430:CLIX:*:*)
GUESS=clipper-intergraph-clix$UNAME_RELEASE
;;
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=mips-mips-riscos$UNAME_RELEASE
;;
Motorola:PowerMAX_OS:*:*)
GUESS=powerpc-motorola-powermax
;;
Motorola:*:4.3:PL8-*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:Power_UNIX:*:*)
GUESS=powerpc-harris-powerunix
;;
m88k:CX/UX:7*:*)
GUESS=m88k-harris-cxux7
;;
m88k:*:4*:R4*)
GUESS=m88k-motorola-sysv4
;;
m88k:*:3*:R3*)
GUESS=m88k-motorola-sysv3
;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
GUESS=m88k-dg-dgux$UNAME_RELEASE
else
GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
GUESS=i586-dg-dgux$UNAME_RELEASE
fi
;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
GUESS=m88k-dolphin-sysv3
;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
GUESS=m88k-motorola-sysv3
;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
GUESS=m88k-tektronix-sysv3
;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
GUESS=m68k-tektronix-bsd
;;
*:IRIX*:*:*)
IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
GUESS=mips-sgi-irix$IRIX_REL
;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
GUESS=i386-ibm-aix
;;
ia64:AIX:*:*)
if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
GUESS=$SYSTEM_NAME
else
GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
GUESS=rs6000-ibm-aix3.2.4
else
GUESS=rs6000-ibm-aix3.2
fi
;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$IBM_ARCH-ibm-aix$IBM_REV
;;
*:AIX:*:*)
GUESS=rs6000-ibm-aix
;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
GUESS=romp-ibm-bsd4.4
;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
GUESS=rs6000-bull-bosx
;;
DPX/2?00:B.O.S.:*:*)
GUESS=m68k-bull-sysv3
;;
9000/[34]??:4.3bsd:1.*:*)
GUESS=m68k-hp-bsd
;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
GUESS=m68k-hp-bsd4.4
;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
case $UNAME_MACHINE in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case $sc_cpu_version in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case $sc_kernel_bits in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH=hppa2.0w
else
HP_ARCH=hppa64
fi
fi
GUESS=$HP_ARCH-hp-hpux$HPUX_REV
;;
ia64:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
GUESS=ia64-hp-hpux$HPUX_REV
;;
3050*:HI-UX:*:*)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=unknown-hitachi-hiuxwe2
;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
GUESS=hppa1.1-hp-bsd
;;
9000/8??:4.3bsd:*:*)
GUESS=hppa1.0-hp-bsd
;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
GUESS=hppa1.0-hp-mpeix
;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
GUESS=hppa1.1-hp-osf
;;
hp8??:OSF1:*:*)
GUESS=hppa1.0-hp-osf
;;
i*86:OSF1:*:*)
if test -x /usr/sbin/sysversion ; then
GUESS=$UNAME_MACHINE-unknown-osf1mk
else
GUESS=$UNAME_MACHINE-unknown-osf1
fi
;;
parisc*:Lites*:*:*)
GUESS=hppa1.1-hp-lites
;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
GUESS=c1-convex-bsd
;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
GUESS=c34-convex-bsd
;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
GUESS=c38-convex-bsd
;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
GUESS=c4-convex-bsd
;;
CRAY*Y-MP:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=ymp-cray-unicos$CRAY_REL
;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=t90-cray-unicos$CRAY_REL
;;
CRAY*T3E:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=alphaev5-cray-unicosmk$CRAY_REL
;;
CRAY*SV1:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=sv1-cray-unicos$CRAY_REL
;;
*:UNICOS/mp:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=craynv-cray-unicosmp$CRAY_REL
;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
;;
sparc*:BSD/OS:*:*)
GUESS=sparc-unknown-bsdi$UNAME_RELEASE
;;
*:BSD/OS:*:*)
GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
else
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
fi
;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
;;
i*:CYGWIN*:*)
GUESS=$UNAME_MACHINE-pc-cygwin
;;
*:MINGW64*:*)
GUESS=$UNAME_MACHINE-pc-mingw64
;;
*:MINGW*:*)
GUESS=$UNAME_MACHINE-pc-mingw32
;;
*:MSYS*:*)
GUESS=$UNAME_MACHINE-pc-msys
;;
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
*:SerenityOS:*:*)
GUESS=$UNAME_MACHINE-pc-serenity
;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
GUESS=i586-pc-interix$UNAME_RELEASE
;;
authenticamd | genuineintel | EM64T)
GUESS=x86_64-unknown-interix$UNAME_RELEASE
;;
IA64)
GUESS=ia64-unknown-interix$UNAME_RELEASE
;;
esac ;;
i*:UWIN*:*)
GUESS=$UNAME_MACHINE-pc-uwin
;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
GUESS=x86_64-pc-cygwin
;;
prep*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=powerpcle-unknown-solaris2$SUN_REL
;;
*:GNU:*:*)
# the GNU system
GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arm*:Linux:*:*)
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
;;
avr32*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
cris:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
crisv32:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
e2k:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
frv:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
hexagon:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:Linux:*:*)
GUESS=$UNAME_MACHINE-pc-linux-$LIBC
;;
ia64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m68*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
mips:Linux:*:* | mips64:Linux:*:*)
set_cc_for_build
IS_GLIBC=0
test x"${LIBC}" = xgnu && IS_GLIBC=1
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef mips
#undef mipsel
#undef mips64
#undef mips64el
#if ${IS_GLIBC} && defined(_ABI64)
LIBCABI=gnuabi64
#else
#if ${IS_GLIBC} && defined(_ABIN32)
LIBCABI=gnuabin32
#else
LIBCABI=${LIBC}
#endif
#endif
#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa64r6
#else
#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa32r6
#else
#if defined(__mips64)
CPU=mips64
#else
CPU=mips
#endif
#endif
#endif
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
MIPS_ENDIAN=
#else
MIPS_ENDIAN=
#endif
#endif
EOF
cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
eval "$cc_set_vars"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
openrisc*:Linux:*:*)
GUESS=or1k-unknown-linux-$LIBC
;;
or32:Linux:*:* | or1k*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
padre:Linux:*:*)
GUESS=sparc-unknown-linux-$LIBC
;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
GUESS=hppa64-unknown-linux-$LIBC
;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
*) GUESS=hppa-unknown-linux-$LIBC ;;
esac
;;
ppc64:Linux:*:*)
GUESS=powerpc64-unknown-linux-$LIBC
;;
ppc:Linux:*:*)
GUESS=powerpc-unknown-linux-$LIBC
;;
ppc64le:Linux:*:*)
GUESS=powerpc64le-unknown-linux-$LIBC
;;
ppcle:Linux:*:*)
GUESS=powerpcle-unknown-linux-$LIBC
;;
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
s390:Linux:*:* | s390x:Linux:*:*)
GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
;;
sh64*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sh*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sparc:Linux:*:* | sparc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
tile*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
vax:Linux:*:*)
GUESS=$UNAME_MACHINE-dec-linux-$LIBC
;;
x86_64:Linux:*:*)
set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI=${LIBC}x32
fi
fi
GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
;;
xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
GUESS=i386-sequent-sysv4
;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx
;;
i*86:XTS-300:*:STOP)
GUESS=$UNAME_MACHINE-unknown-stop
;;
i*86:atheos:*:*)
GUESS=$UNAME_MACHINE-unknown-atheos
;;
i*86:syllable:*:*)
GUESS=$UNAME_MACHINE-pc-syllable
;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
GUESS=i386-unknown-lynxos$UNAME_RELEASE
;;
i*86:*DOS:*:*)
GUESS=$UNAME_MACHINE-pc-msdosdjgpp
;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv32
fi
;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
GUESS=i586-pc-msdosdjgpp
;;
Intel:Mach:3*:*)
GUESS=i386-pc-mach3
;;
paragon:*:*:*)
GUESS=i860-intel-osf1
;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
;;
mini*:CTIX:SYS*5:*)
# "miniframe"
GUESS=m68010-convergent-sysv
;;
mc68k:UNIX:SYSTEM5:3.51m)
GUESS=m68k-convergent-sysv
;;
M680?0:D-NIX:5.3:*)
GUESS=m68k-diab-dnix
;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
GUESS=m68k-unknown-lynxos$UNAME_RELEASE
;;
mc68030:UNIX_System_V:4.*:*)
GUESS=m68k-atari-sysv4
;;
TSUNAMI:LynxOS:2.*:*)
GUESS=sparc-unknown-lynxos$UNAME_RELEASE
;;
rs6000:LynxOS:2.*:*)
GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
;;
SM[BE]S:UNIX_SV:*:*)
GUESS=mips-dde-sysv$UNAME_RELEASE
;;
RM*:ReliantUNIX-*:*:*)
GUESS=mips-sni-sysv4
;;
RM*:SINIX-*:*:*)
GUESS=mips-sni-sysv4
;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
GUESS=$UNAME_MACHINE-sni-sysv4
else
GUESS=ns32k-sni-sysv
fi
;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
GUESS=i586-unisys-sysv4
;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
GUESS=hppa1.1-stratus-sysv4
;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
GUESS=i860-stratus-sysv4
;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=$UNAME_MACHINE-stratus-vos
;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=hppa1.1-stratus-vos
;;
mc68*:A/UX:*:*)
GUESS=m68k-apple-aux$UNAME_RELEASE
;;
news*:NEWS-OS:6*:*)
GUESS=mips-sony-newsos6
;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if test -d /usr/nec; then
GUESS=mips-nec-sysv$UNAME_RELEASE
else
GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
GUESS=powerpc-be-beos
;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
GUESS=powerpc-apple-beos
;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
GUESS=i586-pc-beos
;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
x86_64:Haiku:*:*)
GUESS=x86_64-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
;;
SX-5:SUPER-UX:*:*)
GUESS=sx5-nec-superux$UNAME_RELEASE
;;
SX-6:SUPER-UX:*:*)
GUESS=sx6-nec-superux$UNAME_RELEASE
;;
SX-7:SUPER-UX:*:*)
GUESS=sx7-nec-superux$UNAME_RELEASE
;;
SX-8:SUPER-UX:*:*)
GUESS=sx8-nec-superux$UNAME_RELEASE
;;
SX-8R:SUPER-UX:*:*)
GUESS=sx8r-nec-superux$UNAME_RELEASE
;;
SX-ACE:SUPER-UX:*:*)
GUESS=sxace-nec-superux$UNAME_RELEASE
;;
Power*:Rhapsody:*:*)
GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
;;
*:Rhapsody:*:*)
GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
;;
arm64:Darwin:*:*)
GUESS=aarch64-apple-darwin$UNAME_RELEASE
;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
;;
*:QNX:*:4*)
GUESS=i386-pc-qnx
;;
NEO-*:NONSTOP_KERNEL:*:*)
GUESS=neo-tandem-nsk$UNAME_RELEASE
;;
NSE-*:NONSTOP_KERNEL:*:*)
GUESS=nse-tandem-nsk$UNAME_RELEASE
;;
NSR-*:NONSTOP_KERNEL:*:*)
GUESS=nsr-tandem-nsk$UNAME_RELEASE
;;
NSV-*:NONSTOP_KERNEL:*:*)
GUESS=nsv-tandem-nsk$UNAME_RELEASE
;;
NSX-*:NONSTOP_KERNEL:*:*)
GUESS=nsx-tandem-nsk$UNAME_RELEASE
;;
*:NonStop-UX:*:*)
GUESS=mips-compaq-nonstopux
;;
BS2000:POSIX*:*:*)
GUESS=bs2000-siemens-sysv
;;
DS/*:UNIX_System_V:*:*)
GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
elif test "x${cputype-}" != x; then
UNAME_MACHINE=$cputype
fi
GUESS=$UNAME_MACHINE-unknown-plan9
;;
*:TOPS-10:*:*)
GUESS=pdp10-unknown-tops10
;;
*:TENEX:*:*)
GUESS=pdp10-unknown-tenex
;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
GUESS=pdp10-dec-tops20
;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
GUESS=pdp10-xkl-tops20
;;
*:TOPS-20:*:*)
GUESS=pdp10-unknown-tops20
;;
*:ITS:*:*)
GUESS=pdp10-unknown-its
;;
SEI:*:*:SEIUX)
GUESS=mips-sei-seiux$UNAME_RELEASE
;;
*:DragonFly:*:*)
DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case $UNAME_MACHINE in
A*) GUESS=alpha-dec-vms ;;
I*) GUESS=ia64-dec-vms ;;
V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
GUESS=i386-pc-xenix
;;
i*86:skyos:*:*)
SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
;;
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
i*86:Fiwix:*:*)
GUESS=$UNAME_MACHINE-pc-fiwix
;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;
x86_64:VMkernel:*:*)
GUESS=$UNAME_MACHINE-unknown-esx
;;
amd64:Isilon\ OneFS:*:*)
GUESS=x86_64-unknown-onefs
;;
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
esac
# Do we have a guess based on uname results?
if test "x$GUESS" != x; then
echo "$GUESS"
exit
fi
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <
#include
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include
#if defined(_SIZE_T_) || defined(SIGLOST)
#include
#endif
#endif
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
#include
#if defined (BSD)
#if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
#else
#if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#endif
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <&2 <&2 </dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = "$UNAME_MACHINE"
UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
fi
exit 1
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
blueman-2.4.3/config.h.in 0000664 0000000 0000000 00000004711 14650545052 0015177 0 ustar 00root root 0000000 0000000 /* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* The gettext package */
#undef GETTEXT_PACKAGE
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
#undef HAVE_CFLOCALECOPYCURRENT
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
blueman-2.4.3/config.rpath 0000775 0000000 0000000 00000044216 14650545052 0015470 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2015 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit , 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
xl* | bgxl* | bgf* | mpixl*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
wl=
;;
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,'
;;
esac
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
haiku*)
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;;
freebsd* | dragonfly*)
library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'
;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
*nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <