distutils installation script, draft
This commit is contained in:
parent
0a72186117
commit
ff07dfb2b8
28 changed files with 141 additions and 45 deletions
|
|
@ -54,7 +54,7 @@ from optparse import OptionParser
|
|||
import pdb
|
||||
from tools.jid import JID
|
||||
import gobject
|
||||
from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService
|
||||
from sat_frontends.bridge.DBus import DBusBridgeFrontend,BridgeExceptionNoService
|
||||
import tarfile
|
||||
try:
|
||||
from progressbar import ProgressBar, Percentage, Bar, ETA, FileTransferSpeed
|
||||
|
|
|
|||
0
frontends/src/primitivus/__init__.py
Normal file
0
frontends/src/primitivus/__init__.py
Normal file
|
|
@ -20,10 +20,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
import urwid
|
||||
from tools.games import TarotCard
|
||||
from quick_frontend.quick_card_game import QuickCardGame
|
||||
from xmlui import XMLUI
|
||||
from urwid_satext import sat_widgets
|
||||
from sat.tools.games import TarotCard
|
||||
from sat_frontends.quick_frontend.quick_card_game import QuickCardGame
|
||||
from sat_frontends.primitivus.xmlui import XMLUI
|
||||
|
||||
class CardDisplayer(urwid.Text):
|
||||
"""Show a card"""
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
import urwid
|
||||
from quick_frontend.quick_contact_list import QuickContactList
|
||||
from quick_frontend.quick_chat import QuickChat
|
||||
from urwid_satext import sat_widgets
|
||||
import time
|
||||
from tools.jid import JID
|
||||
from card_game import CardGame
|
||||
from urwid_satext.files_management import FileDialog
|
||||
from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
|
||||
from sat_frontends.quick_frontend.quick_chat import QuickChat
|
||||
from sat_frontends.primitivus.card_game import CardGame
|
||||
import time
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class ChatText(urwid.FlowWidget):
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
import urwid
|
||||
from quick_frontend.quick_contact_list import QuickContactList
|
||||
from tools.jid import JID
|
||||
from urwid_satext import sat_widgets
|
||||
from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class ContactList(urwid.WidgetWrap, QuickContactList):
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from tools.jid import JID
|
||||
from quick_frontend.quick_gateways import QuickGatewaysManager
|
||||
from sat_frontends.quick_frontend.quick_gateways import QuickGatewaysManager
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class GatewaysManager(urwid.WidgetWrap, QuickGatewaysManager):
|
||||
|
|
|
|||
|
|
@ -20,22 +20,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
|
||||
from quick_frontend.quick_app import QuickApp
|
||||
from quick_frontend.quick_chat_list import QuickChatList
|
||||
from quick_frontend.quick_contact_list import QuickContactList
|
||||
from quick_frontend.quick_contact_management import QuickContactManagement
|
||||
import urwid
|
||||
from profile_manager import ProfileManager
|
||||
from contact_list import ContactList
|
||||
from chat import Chat
|
||||
from gateways import GatewaysManager
|
||||
from urwid_satext import sat_widgets
|
||||
from sat_frontends.quick_frontend.quick_app import QuickApp
|
||||
from sat_frontends.quick_frontend.quick_chat_list import QuickChatList
|
||||
from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
|
||||
from sat_frontends.quick_frontend.quick_contact_management import QuickContactManagement
|
||||
from sat_frontends.primitivus.profile_manager import ProfileManager
|
||||
from sat_frontends.primitivus.contact_list import ContactList
|
||||
from sat_frontends.primitivus.chat import Chat
|
||||
from sat_frontends.primitivus.gateways import GatewaysManager
|
||||
from sat_frontends.primitivus.xmlui import XMLUI
|
||||
from sat_frontends.primitivus.progress import Progress
|
||||
import logging
|
||||
from logging import debug, info, error
|
||||
import sys, os
|
||||
from tools.jid import JID
|
||||
from xmlui import XMLUI
|
||||
from progress import Progress
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
### logging configuration FIXME: put this elsewhere ###
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
import urwid
|
||||
from urwid_satext.sat_widgets import Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class ProfileManager(urwid.WidgetWrap):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class Progress(urwid.WidgetWrap):
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
import urwid
|
||||
from logging import debug, info, warning, error
|
||||
from urwid_satext import sat_widgets
|
||||
from logging import debug, info, warning, error
|
||||
from xml.dom import minidom
|
||||
|
||||
class Pairs(urwid.WidgetWrap):
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService
|
||||
from sat.tools.jid import JID
|
||||
from sat_frontends.bridge.DBus import DBusBridgeFrontend,BridgeExceptionNoService
|
||||
from optparse import OptionParser
|
||||
import pdb
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
from logging import debug, info, warning, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class QuickChatList(dict):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class QuickContactList():
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
from logging import debug, info, warning, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
import pdb
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import wx
|
|||
import os.path, glob
|
||||
import pdb
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
from tools.games import TarotCard
|
||||
from quick_frontend.quick_card_game import QuickCardGame
|
||||
from xmlui import XMLUI
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import os.path
|
|||
import time
|
||||
import pdb
|
||||
from logging import debug, info, error, warning
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
from quick_frontend.quick_chat import QuickChat
|
||||
from contact_list import ContactList
|
||||
from card_game import CardPanel
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import wx
|
|||
from quick_frontend.quick_contact_list import QuickContactList
|
||||
from logging import debug, info, error
|
||||
from cgi import escape
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class Group(unicode):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import wx
|
|||
import pdb
|
||||
from xml.dom import minidom
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
from quick_frontend.quick_gateways import QuickGatewaysManager
|
||||
|
||||
class GatewaysManager(wx.Frame,QuickGatewaysManager):
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from profile_manager import ProfileManager
|
|||
import gobject
|
||||
import os.path
|
||||
import pdb
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
from logging import debug, info, warning, error
|
||||
import constants
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import wx
|
|||
import pdb
|
||||
from xml.dom import minidom
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class Param(wx.Frame):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
import wx
|
||||
import pdb
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class Profile(wx.Frame):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
import wx
|
||||
import pdb
|
||||
from logging import debug, info, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
import pdb
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import wx
|
|||
import pdb
|
||||
from xml.dom import minidom
|
||||
from logging import debug, info, warning, error
|
||||
from tools.jid import JID
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
class XMLUI(wx.Frame):
|
||||
|
|
|
|||
83
setup.py
Normal file
83
setup.py
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from distutils.command.install import install
|
||||
from distutils.core import setup
|
||||
from distutils.file_util import copy_file
|
||||
import os,sys,subprocess
|
||||
from stat import ST_MODE
|
||||
from glob import glob
|
||||
|
||||
NAME = 'sat'
|
||||
LAUNCH_DAEMON_COMMAND = 'sat'
|
||||
|
||||
|
||||
class custom_install(install):
|
||||
|
||||
def custom_auto_options(self):
|
||||
"""Change options for twistd in the shell script
|
||||
Mainly change the paths"""
|
||||
sh_buffer = ""
|
||||
run_dir = os.path.dirname(self.sh_script_path)
|
||||
with open(self.sh_script_path,'r') as sh_file:
|
||||
for ori_line in sh_file:
|
||||
if ori_line.startswith('DAEMON='):
|
||||
dest_line = 'DAEMON=""\n' #we want to launch sat as a daemon
|
||||
elif ori_line.startswith('TAP_PATH='):
|
||||
dest_line = 'TAP_PATH="%s/"\n' % run_dir
|
||||
else:
|
||||
dest_line = ori_line
|
||||
sh_buffer += dest_line
|
||||
|
||||
with open(self.sh_script_path,'w') as sh_file:
|
||||
sh_file.write(sh_buffer)
|
||||
|
||||
|
||||
def custom_create_links(self):
|
||||
"""Create symbolic links to executables"""
|
||||
#the script which launch the daemon
|
||||
links = [(self.sh_script_path,LAUNCH_DAEMON_COMMAND),]
|
||||
for source,dest in links:
|
||||
dest_name, copied = copy_file(source, os.path.join(self.install_scripts, dest), link='sym')
|
||||
assert (copied)
|
||||
#we change the perm in the same way as in the original install_scripts
|
||||
mode = ((os.stat(dest_name)[ST_MODE]) | 0555) & 07777
|
||||
os.chmod(dest_name, mode)
|
||||
|
||||
def run(self):
|
||||
install.run(self)
|
||||
print ('running post installation stuff')
|
||||
self.sh_script_path = os.path.join(self.install_lib,'sat','sat.sh')
|
||||
self.primitivus_path = os.path.join(self.install_lib,'sat_frontends','primitivus')
|
||||
self.custom_auto_options()
|
||||
self.custom_create_links()
|
||||
|
||||
|
||||
|
||||
setup(name=NAME,
|
||||
version='0.1.0',
|
||||
description=u'Salut à Toi multi-frontend XMPP client',
|
||||
long_description=u'Salut à Toi (SàT) is a XMPP client based on a daemon/frontend architecture. You can use it with the desktop frontend (wix - WxPython based), console ui frontend (Primitivus, Urwid based), or command line frontend (jp), and others are coming. ',
|
||||
author='Goffi (Jérôme Poisson)',
|
||||
author_email='goffi@goffi.org',
|
||||
url='http://wiki.goffi.org/wiki/Salut_%C3%A0_Toi',
|
||||
classifiers=['Development Status :: 3 - Alpha',
|
||||
'Environment :: Console',
|
||||
'Environment :: X11 Applications :: GTK',
|
||||
'Framework :: Twisted',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Topic :: Communications :: Chat'],
|
||||
package_dir = {'sat':'src', 'sat_frontends':'frontends/src'},
|
||||
packages=['sat','sat.tools','sat.bridge', 'sat.plugins',
|
||||
'sat_frontends', 'sat_frontends.bridge', 'sat_frontends.quick_frontend',
|
||||
'sat_frontends.primitivus'],
|
||||
package_data = {'sat': ['sat.tac','sat.sh']},
|
||||
data_files=[(os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['i18n/fr/LC_MESSAGES/sat.mo']),
|
||||
(os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['frontends/i18n/fr/LC_MESSAGES/sat_frontend.mo']),
|
||||
(os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['frontends/src/jp/i18n/fr/LC_MESSAGES/jp.mo']),
|
||||
('share/doc/%s' % NAME, ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS'])],
|
||||
scripts=['frontends/src/jp/jp', 'frontends/src/primitivus/primitivus'],
|
||||
cmdclass=dict(install=custom_install),
|
||||
)
|
||||
|
||||
15
src/sat.sh
15
src/sat.sh
|
|
@ -1,3 +1,16 @@
|
|||
#!/bin/sh
|
||||
twistd -noy sat.tac
|
||||
|
||||
NAME='sat'
|
||||
|
||||
PID_FILE="/tmp/$NAME.pid"
|
||||
DAEMON="n"
|
||||
MAIN_OPTIONS="-${DAEMON}oy"
|
||||
TAP_PATH="./"
|
||||
TAP_FILE="$NAME.tac"
|
||||
|
||||
#Don't change the next line
|
||||
AUTO_OPTIONS=""
|
||||
ADDITIONAL_OPTIONS="--pidfile $PID_FILE $AUTO_OPTIONS"
|
||||
|
||||
echo "autogenere == >" twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS
|
||||
twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ class SAT(service.Service):
|
|||
plug_lst = [os.path.splitext(plugin)[0] for plugin in map(os.path.basename,glob ("plugins/plugin*.py"))]
|
||||
|
||||
for plug in plug_lst:
|
||||
plug_path = 'plugins.'+plug
|
||||
plug_path = 'sat.plugins.'+plug
|
||||
__import__(plug_path)
|
||||
mod = sys.modules[plug_path]
|
||||
plug_info = mod.PLUGIN_INFO
|
||||
|
|
|
|||
Loading…
Reference in a new issue