Python plugin development

Discussion about user contributed plugins

Moderator: Moderator

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Fri Dec 28, 2007 1:10 pm

Uatschitchun wrote:With newer compiler (4.2.2) I do get lots of these:

Code: Select all

warning: deprecated conversion from string constant to 'char*'


Could you please post which line of code and which file triggered that? I have a bad feeling about the new 4.2.2 gcc....
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

esprit
master
Posts: 503
Joined: Tue Dec 06, 2005 5:50 pm
Location: France
Contact:

Postby esprit » Fri Dec 28, 2007 5:09 pm

That's not only in python plugin, got this one with current revision :

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O3 -march=pentium3 -ffast-math -funroll-loops -fomit-frame-pointer -D_GNU_SOURCE -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I./plugins -I./plugins/feature/ -I./plugins/input -I./plugins/output -c notify.cpp
notify.cpp: In member function ‘virtual void Notify::run()’:
notify.cpp:112: warning: deprecated conversion from string constant to ‘char*’

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Fri Dec 28, 2007 5:56 pm

esprit wrote:That's not only in python plugin, got this one with current revision :

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O3 -march=pentium3 -ffast-math -funroll-loops -fomit-frame-pointer -D_GNU_SOURCE -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I./plugins -I./plugins/feature/ -I./plugins/input -I./plugins/output -c notify.cpp
notify.cpp: In member function ‘virtual void Notify::run()’:
notify.cpp:112: warning: deprecated conversion from string constant to ‘char*’


That's great, now even the classic C "Hello world" program would trigger that warning. :?
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

esprit
master
Posts: 503
Joined: Tue Dec 06, 2005 5:50 pm
Location: France
Contact:

Postby esprit » Fri Dec 28, 2007 6:15 pm

It's just a deprecation warning, not a big problem :lol:

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Fri Dec 28, 2007 6:20 pm

esprit wrote:It's just a deprecation warning, not a big problem :lol:


It's a warning that should not be there IMHO.

Warnings are there, as the name implies, to warn you of a potential problem. If, however, a few important warnings are lost in a flood of pointless and silly warnings, then they can't serve their purpose.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

esprit
master
Posts: 503
Joined: Tue Dec 06, 2005 5:50 pm
Location: France
Contact:

Postby esprit » Fri Dec 28, 2007 6:45 pm

-Wwrite-strings
When compiling C, give string constants the type "const char[length]" so that copying the address of one into a non-"const" "char *" pointer will get a warning; when
compiling C++, warn about the deprecated conversion from string literals to "char *". This warning, by default, is enabled for C++ programs. These warnings will
help you find at compile time code that can try to write into a string constant, but only if you have been very careful about using "const" in declarations and pro‐
totypes. Otherwise, it will just be a nuisance; this is why we did not make -Wall request these warnings.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Jan 21, 2008 6:10 am

Hi,
here comes a feature request
(please excuse, if it's possible already, but I'm not that familiar with this plugin).

Request: Possibility to enter Text (Input-Box) with keyboard or remote (lirc)

Would be good to have it for the YouTube plugin.

Thanks,
Regards

PS: Really nice work this python plugin.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Python plugin development

Postby acmelabs » Sat Feb 23, 2008 1:01 pm

General Fedora Installation Issue
pls skip this post, read the next one. Thanks.

REVNO 1448: python-plugin doesn't compile. (FC8; python-devel 2.5.1)

Here's the output

http://mms.mymediasystem.net/mms110/mms ... g-1448.txt

Thanks,
Regards,
Andreas
Last edited by acmelabs on Sat Feb 23, 2008 1:26 pm, edited 1 time in total.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Python plugin development

Postby acmelabs » Sat Feb 23, 2008 1:22 pm

The Python-Plugin doesn't compile on Fedora.

I've installed commoncpp2-devel.i386 0:1.5.0-1.fc7 from the FC-packages, but MMS doesn't compile with it, because Fedora doesn't have ZLIB compiled in commoncpp2. Whereas the libcommoncpp2 package that I've installed manually seems to be used by MMS but not by the python-plugin. I'm not expert enough to fix that. Please help.

Thanks
Regards,
Andreas

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sat Feb 23, 2008 1:52 pm

Your compiler seems to be quite pendantic about what it's compiling.

guiwindow.cpp:1: error: stray ‘#’ in program <- error

Looking at the source code it doesn't really make sense.

Try compiling without debug enabled.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Sat Feb 23, 2008 2:39 pm

arj wrote:Your compiler seems to be quite pendantic about what it's compiling.

guiwindow.cpp:1: error: stray ‘#’ in program <- error

Looking at the source code it doesn't really make sense.

Try compiling without debug enabled.

Thanks for your help, but the error remains the same:

http://mms.mymediasystem.net/mms110/mms ... odebug.txt

Regards,
Andreas

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Postby Fredde » Sat Feb 23, 2008 3:59 pm

This seems like some encoding error.

Code: Select all

‘#’


The above indicates that there are some more characters then # in the file.

Have you tried to open it in some text editor like xemacs? Try the file plugins/feature/python/libgui/guiwindow.cpp.

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sat Feb 23, 2008 4:11 pm

I made him do a head on the file and that looks ok. He says its a fresh checkout. Fedora :x

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Sat Feb 23, 2008 4:38 pm

Fredde wrote:This seems like some encoding error.

Code: Select all

‘#’


The above indicates that there are some more characters then # in the file.
output:
Have you tried to open it in some text editor like xemacs? Try the file plugins/feature/python/libgui/guiwindow.cpp.

Don't know where this sign are coming from. Here's cut&paste from terminal:

Code: Select all

make -C plugins/feature/python/ 2>&1 | more

output:

Code: Select all

make: Entering directory `/usr/src/mms-1.1.0/plugins/feature/python'
make -C libgui
make[1]: Entering directory `/usr/src/mms-1.1.0/plugins/feature/python/libgui'
g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O0 -g -Wall -W -Wno-sign-compare -Wold-style-cast -Wundef -Wshadow -Wno-long-long -
D_GNU_SOURCE -I/usr/include/cc++2   -isystem/usr/include/boost-1_34_1/ -isystem/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../..
/ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp
In file included from guiwindow.hpp:7,
                 from guiwindow.cpp:1:
/usr/include/cc++2/cc++/thread.h:490:9: warning: "HAVE_GCC_BITS_ATOMIC" is not defined
guiwindow.cpp:1: error: stray ‘#’ in program
In file included from guiwindow.cpp:2:
guiwindow.hpp:4: error: stray ‘#’ in program
In file included from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:65: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:66,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/functexcept.h:41: error: stray ‘#’ in program
In file included from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:66: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,

so it's a browser and/or apache stuff - I don't know where there are coming from.

Regards,
Andreas

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Sat Feb 23, 2008 5:47 pm

OK - let's get the beast...

Code: Select all

guiwindow.cpp:1: error: stray ‘#’ in program
guiwindow.cpp

Code: Select all

#include "guicontrolfactory.hpp"
#include "guiwindowmanager.hpp"
#include "libfspp.hpp"
#include "config.hpp"
#include <algorithm>
#include <functional>
#include "guiwindow.hpp"
#include <iostream>

using std::vector;
using std::string;
using std::for_each;

As far as I know a "#" IS a absolutele valid char in front of an include, and just to be sure, here's the hexdump output of the first to bytes, which show, that there is no escape-sequence bullshit is around.

hexdump:

Code: Select all

0000000 6923 636e 756c 6564 2220 7567 6369 6e6f
0000010 7274 6c6f 6166 7463 726f 2e79 7068 2270
0000020 230a 6e69 6c63 6475 2065 6722 6975 6977
0000030 646e 776f 616d 616e 6567 2e72 7068 2270
0000040 230a 6e69 6c63 6475 2065 6c22 6269 7366
0000050 7070 682e 7070 0a22 6923 636e 756c 6564
0000060 2220 6f63 666e 6769 682e 7070 0a22 6923
0000070 636e 756c 6564 3c20 6c61 6f67 6972 6874
0000080 3e6d 230a 6e69 6c63 6475 2065 663c 6e75


So, if the simpliest things doesn't work here, and I'm far from being an expert, and only python plugin is affected, I will leave this problem for now.

Regards,
Andreas


Return to “user plugins”

Who is online

Users browsing this forum: No registered users and 2 guests