[geoclue-properties] Add setup.py



commit 8721817d9b55eef3de1d5739869c0da64d158d2f
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Mon Jun 22 23:25:35 2009 -0400

    Add setup.py

 MANIFEST.in                                        |    2 +
 geoclue-properties                                 |    9 ++++++
 geoclue-properties.desktop                         |   11 +++++++
 {src => geoclueproperties}/address-dialog.ui       |    0
 {src => geoclueproperties}/address_dialog.py       |    4 ++-
 {src => geoclueproperties}/geoclue-properties.ui   |    0
 {src => geoclueproperties}/geoclue.py              |    0
 .../geoclue_properties.py                          |   11 +++++---
 {src => geoclueproperties}/localnet-preferences.ui |    0
 {src => geoclueproperties}/localnet_preferences.py |    3 +-
 {src => geoclueproperties}/manual-preferences.ui   |    0
 {src => geoclueproperties}/manual_preferences.py   |    3 +-
 setup.py                                           |   29 ++++++++++++++++++++
 13 files changed, 65 insertions(+), 7 deletions(-)
---
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..0cd9197
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include AUTHORS COPYING README MAINTAINERS geoclue-properties.desktop geoclue-properties
+recursive-include geoclueproperties *.ui
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/geoclue-properties b/geoclue-properties
new file mode 100755
index 0000000..75fd703
--- /dev/null
+++ b/geoclue-properties
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+# -*- coding:utf-8 -*-
+
+import sys, geoclueproperties.geoclue_properties
+
+try:
+    sys.exit(geoclueproperties.geoclue_properties.main())
+except KeyboardInterrupt:
+    sys.exit(1)
diff --git a/geoclue-properties.desktop b/geoclue-properties.desktop
new file mode 100644
index 0000000..a21a008
--- /dev/null
+++ b/geoclue-properties.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Version=1.0
+Name=Location Awareness Configuration
+Icon=geoclue-properties
+Comment=Configuration of location awareness library Geoclue
+Exec=/usr/bin/geoclue-properties %F
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Settings;
+StartupNotify=true
+Name[en_US]=Location Awareness Configuration
diff --git a/geoclueproperties/__init__.py b/geoclueproperties/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/address-dialog.ui b/geoclueproperties/address-dialog.ui
similarity index 100%
rename from src/address-dialog.ui
rename to geoclueproperties/address-dialog.ui
diff --git a/src/address_dialog.py b/geoclueproperties/address_dialog.py
similarity index 95%
rename from src/address_dialog.py
rename to geoclueproperties/address_dialog.py
index b7b6da5..2c6e6ba 100644
--- a/src/address_dialog.py
+++ b/geoclueproperties/address_dialog.py
@@ -14,12 +14,14 @@ except:
     sys.exit(1)
 
 import geoclue
+import os
 
 class AddressDialog:
 
     def __init__(self, title, description, address = None):
 
-        self.uifile = "address-dialog.ui"
+        path = os.path.dirname(os.path.abspath(__file__))
+        self.uifile = os.path.join(path, "address-dialog.ui")
 
         builder = gtk.Builder()
         builder.add_from_file(self.uifile)
diff --git a/src/geoclue-properties.ui b/geoclueproperties/geoclue-properties.ui
similarity index 100%
rename from src/geoclue-properties.ui
rename to geoclueproperties/geoclue-properties.ui
diff --git a/src/geoclue.py b/geoclueproperties/geoclue.py
similarity index 100%
rename from src/geoclue.py
rename to geoclueproperties/geoclue.py
diff --git a/src/geoclue-properties.py b/geoclueproperties/geoclue_properties.py
old mode 100755
new mode 100644
similarity index 98%
rename from src/geoclue-properties.py
rename to geoclueproperties/geoclue_properties.py
index d00b22d..0b559d7
--- a/src/geoclue-properties.py
+++ b/geoclueproperties/geoclue_properties.py
@@ -1,6 +1,4 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
-
 # Copyright (C) 2009 Pierre-Luc Beaudoin
 
 # This program is free software; you can redistribute it and/or
@@ -50,7 +48,8 @@ class GeocluePropertiesDialog:
 
         self.bus = dbus.SessionBus()
 
-        self.uifile = "geoclue-properties.ui"
+        path = os.path.dirname(os.path.abspath(__file__))
+        self.uifile = os.path.join(path, "geoclue-properties.ui")
 
         builder = gtk.Builder()
         builder.add_from_file(self.uifile)
@@ -258,6 +257,10 @@ class GeocluePropertiesDialog:
         if fields & geoclue.POSITION_FIELDS_ALTITUDE:
             self.position_store.append(["Altitude", "%0.5f" % altitude])
 
-if __name__ == "__main__":
+def main():
     dialog = GeocluePropertiesDialog()
     gtk.main()
+
+if __name__ == "__main__":
+    main()
+
diff --git a/src/localnet-preferences.ui b/geoclueproperties/localnet-preferences.ui
similarity index 100%
rename from src/localnet-preferences.ui
rename to geoclueproperties/localnet-preferences.ui
diff --git a/src/localnet_preferences.py b/geoclueproperties/localnet_preferences.py
similarity index 98%
rename from src/localnet_preferences.py
rename to geoclueproperties/localnet_preferences.py
index f528cd8..b87435e 100644
--- a/src/localnet_preferences.py
+++ b/geoclueproperties/localnet_preferences.py
@@ -47,7 +47,8 @@ class LocalnetPreferencesDialog:
 
         self.bus = dbus.SessionBus()
 
-        self.uifile = "localnet-preferences.ui"
+        path = os.path.dirname(os.path.abspath(__file__))
+        self.uifile = os.path.join(path, "localnet-preferences.ui")
 
         builder = gtk.Builder()
         builder.add_from_file(self.uifile)
diff --git a/src/manual-preferences.ui b/geoclueproperties/manual-preferences.ui
similarity index 100%
rename from src/manual-preferences.ui
rename to geoclueproperties/manual-preferences.ui
diff --git a/src/manual_preferences.py b/geoclueproperties/manual_preferences.py
similarity index 96%
rename from src/manual_preferences.py
rename to geoclueproperties/manual_preferences.py
index 5980319..2738c97 100644
--- a/src/manual_preferences.py
+++ b/geoclueproperties/manual_preferences.py
@@ -47,7 +47,8 @@ class ManualPreferencesDialog:
 
         self.bus = dbus.SessionBus()
 
-        self.uifile = "manual-preferences.ui"
+        path = os.path.dirname(os.path.abspath(__file__))
+        self.uifile = os.path.join(path, "manual-preferences.ui")
 
         builder = gtk.Builder()
         builder.add_from_file(self.uifile)
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..9937cc6
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+
+def create_data_files():
+    data_files = []
+
+    # misc
+    data_files.append(('share/applications', ['geoclue-properties.desktop']))
+    return data_files
+
+setup(name='Geoclue Properties',
+      version='0.1',
+      url='http://blog.pierlux.com/',
+      description='A Geoclue configuration tool',
+      author='Pierre-Luc Beaudoin',
+      author_email='pierre-luc pierlux com',
+      packages=['geoclueproperties'],
+      package_data = {
+         'geoclueproperties': [
+            'geoclue-properties.ui',
+            'address-dialog.ui',
+            'localnet-preferences.ui',
+            'manual-preferences.ui']
+         },
+      data_files = create_data_files(),
+      scripts=['geoclue-properties',],
+    )
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]