示例#1
0
        def __init__(self, master):
            try:
                sys.frozen	# don't want to try updating python.exe
                self.updater = ctypes.cdll.WinSparkle
                self.updater.win_sparkle_set_appcast_url('http://marginal.org.uk/edmarketconnector.xml')	# py2exe won't let us embed this in resources

                # set up shutdown callback
                global root
                root = master
                self.callback_t = ctypes.CFUNCTYPE(None)	# keep reference
                self.callback_fn = self.callback_t(shutdown_request)
                self.updater.win_sparkle_set_shutdown_request_callback(self.callback_fn)

                # Translations require winsparkle 0.5
                try:
                    import l10n
                    langs = l10n.Translations().preferred()
                    if langs:
                        self.updater.win_sparkle_set_lang(langs[0])
                except:
                    pass

                self.updater.win_sparkle_init()

            except:
                from traceback import print_exc
                print_exc()
                self.updater = None
示例#2
0
#!/usr/bin/python
#
# Command-line interface. Requires prior setup through the GUI.
#

import argparse
import json
import requests
import sys
import os
from os.path import dirname, getmtime, join
from time import time, sleep
from xml.etree import ElementTree

import l10n
l10n.Translations().install_dummy()

import collate
import companion
import commodity
from commodity import COMMODITY_DEFAULT
import outfitting
import loadout
import edshipyard
import coriolis
import shipyard
import eddb
import eddn
import stats
import prefs
from config import appcmdname, appversion, update_feed, config
import Tkinter as tk
import ttk
import tkFont
from ttkHyperlinkLabel import HyperlinkLabel

if __debug__:
    from traceback import print_exc

from config import appname, applongname, config
if platform == 'win32' and getattr(sys, 'frozen', False):
    # By default py2exe tries to write log to dirname(sys.executable) which fails when installed
    import tempfile
    sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')

import l10n
l10n.Translations().install()

import companion
import bpc
import td
import eddn
import edsm
import loadout
import coriolis
import flightlog
import eddb
import stats
import prefs
from hotkey import hotkeymgr
from monitor import monitor