I'm trying to figure out how to make my program installable via distutils. My end goal is to make a .deb installer for ubuntu users. The main issue is getting a "one-click" launcher file to work.
My program uses pygtk and sqlite3 for the gui and database. I've used glade to help build my gui and so my program ties into a couple of glade files. and then I also store data in a .sqlite3 file. Here is my package structure so far...
root/
|_ src/
| |_ RTcore/
| |_ data/
| | |_ data.sqlite3
| |_ ui/
| | |_ main.glade
| | |_ addRecipe.glade
| |_ __init__.py
| |_ main.py #this is where I store the meat of my program
| |_ module.py #recipetrack is supposed to run this module which ties into the main.py
|_ setup.py
|_ manifest.in
|_ README
|_ recipetrack #this is my launcher script
this is my current setup.py file...
#!/usr/bin/env python
from distutils.core import setup
files = ["Data/*", "ui/*"]
setup(
name = "RecipeTrack",
version = "0.6",
description = "Store cooking recipes and make shopping lists",
author = "Heber Madsen",
author_email = "mad.programs@gmail.com",
url = "none at this time",
packages = ["RTcore", "RTcore/Data","RTcore/ui"],
package_data = {"RTcore": files},
scripts = ["recipetrack"],
long_description = """Something long and descriptive""",
)
the code for my "recipetrack" script is...
#!/usr/bin/env python #it appears that if I don't add this then following 2 lines won't work.
#the guide I was following did not use that first line which I found odd.
import RTcore.module
RTcore.module.start()
So the recipetrack get's installed outside of the root directory and has it's permissions changed to 755, so that all users on the system can launch the file. Once started recipetrack should start module which is in the root folder and then starts the main.py from there everything should run as normal. But it doesn't. "recipetrack" does start module which then imports main.py class but it's at this point the program tries to load data files (ie. data.sqlite3, main.glad, or addRecipe.glad.) and then just hangs unable to locate them.
If I cd into the root of the program and run "recipetrack" the program runs normally. But I want to be able to run "recipetrack" from any location on the system.
I believe the problem lies in the setup.py file with the package_data line. I have tried using data_files instead but this doesn't work it hangs during install unable to locate the data files.
I hope this has been clear, and someone out there can help.
Thanks, Heber
changed setup.py file...
setup(
packages = ["RTcore"],
package_dir = {"src": "RTcore"},
package_data = {"RTcore": ["Rui/*"]},
data_files = [("Data", ["data.sqlite3"])],
)
But now setup isn't installing my data.sqlite3 file.