-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow running python plugins from build dir (output dir) #286
Conversation
Takes a step forward toward closing http://hub.qgis.org/issues/5879 More work is needed to ensure all python plugins install themselves under the output/python/plugins dir.
@@ -460,13 +457,13 @@ QString QgsPythonUtilsImpl::homePythonPath() | |||
} | |||
else | |||
{ | |||
return '"' + settingsDir + "python\""; | |||
return settingsDir + "python"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to break something.
Have a look at https://github.com/qgis/Quantum-GIS/blob/master/src/python/qgspythonutilsimpl.cpp#L459:
both the if and else statements return a string containing python code,
in your change the else statement returns a path as string while the if is unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Oct 11, 2012 at 06:00:43AM -0700, Giuseppe Sucameli wrote:
@@ -460,13 +457,13 @@ QString QgsPythonUtilsImpl::homePythonPath()
}
else
{
- return '"' + settingsDir + "python"";
- return settingsDir + "python";
This change seems to break something.
Have a look at https://github.com/qgis/Quantum-GIS/blob/master/src/python/qgspythonutilsimpl.cpp#L459:
both the if and else statements return a string containing python code,
in your code the else statement returns a path as string instead.
Yes, but the callers add the quotes when needed, doesn't them ?
But then I guess the xpanduser part wouldn't want to be quoted.
The problem was with https://github.com/qgis/Quantum-GIS/blob/master/src/python/qgspythonutilsimpl.cpp#L86
resulting in a weird sys.path (containing + in it).
AFAICS after your change (and maybe also before it) the if/else is not needed at all, you can just replace it with Here's the code before the change:
that always returns |
On Thu, Oct 11, 2012 at 09:03:31AM -0700, Giuseppe Sucameli wrote:
It depends on the value returned by qgisSettingsDirPath(), doesn't it ? Anyway, if nothing complains I'm happy to see the conditional dropped... --strk; http://www.cartodb.com - Map, analyze and build applications with your data
|
does "~" work on windows? |
On Thu, Oct 11, 2012 at 09:22:51AM -0700, Etienne Tourigny wrote:
Do you mean to say that the conditional is there to avoid using "~" ? |
Let's look: |
The question was - does "~" work on windows? also, why the conditional? Shouldn't QgsApplication::qgisSettingsDirPath() + "python" be enough??? sorry for butting in, I haven't looked into this much. |
Are you talking about
Exactly what I wrote, removing the if/else at all. That block was added in ed0cb5d, maybe there's something we don't know, I'm looking at the related tickets. |
Found, have a look at http://hub.qgis.org/issues/2512. I guess that code need a bigger refactoring than just changing few lines of code. |
On Thu, Oct 11, 2012 at 10:14:29AM -0700, Giuseppe Sucameli wrote:
Do you think we can get to produce a testcase for that issue ? I have to admit I still fail to understand the issue. --strk; http://www.cartodb.com - Map, analyze and build applications with your data
|
It is getting too easy to get lost in the quoting of the paths - IMHO the right solution would be to set the paths using Python C API to ensure that the paths with international characters are still properly passed to python side. |
On Thu, Oct 11, 2012 at 12:07:58PM -0700, Martin Dobias wrote:
I still don't understand what's the problem with international chars. |
I had a chance to try a simpler change, since I think last time I tested I was being confused by a lot more parameters.
It worked fine in loading plugins from output/python/plugin dir. |
No more plus signs (+) in path??? |
Nope, just tried again with master, it's all fine. Only needs plugin in output/python/plugin then. Opening a new pull request with this small patch. |
Takes a step forward toward closing http://hub.qgis.org/issues/5879
More work is needed to ensure all python plugins install themselves
under the output/python/plugins dir.