Adding custom Python files to Quickly app

Asked by Tan Kah Ping

If I write my own Python code in separate files (not generated by Quickly) how do I add it into my Quickly app? Where should I place them?

Question information

Language:
English Edit question
Status:
Solved
For:
Quickly Edit question
Assignee:
No assignee Edit question
Solved by:
Tan Kah Ping
Solved:
Last query:
Last reply:
Revision history for this message
Tan Kah Ping (kahping) said :
#1

Never mind. I think I just answered my own question.

Revision history for this message
onlineaddy (onlineaddy) said :
#2

Would you mind sharing your answer? :)

Revision history for this message
Tan Kah Ping (kahping) said :
#3

Sure. Here's what I did.

I placed my .py file in a folder that has the same name as my project (eg., a project called foo will have a subfolder called foo in it). It's easy to spot. You'll find .py files generated by Quickly for your About dialog, Preferences dialog, etc...

Then I added the import into the file in bin/. Again, the file uses the same name as your project.

Find the following (or similar lines):

from galleria import (
    AboutGalleriaDialog, PreferencesGalleriaDialog)
from galleria.helpers import get_builder

#Try adding AppIndicator. Will work after "qucikly add indicator"
try:
    from galleria import indicator
except:
    indicator = False

Add your import between "from galleria.helpers import get_builder" and "#Try adding AppIndicator. Will work after "qucikly add indicator" ".

Hope that's clear enough to understand :-)