コード例 #1
0
ファイル: pyfa.py プロジェクト: thorr18/Pyfa
def main():
    # Configure paths
    if options.rootsavedata is True:
        config.saveInRoot = True

    config.debug = options.debug
    config.defPaths()

    # Basic logging initialization
    import logging
    logging.basicConfig()

    # Import everything
    import os

    import eos.db
    import service.prefetch
    from gui.mainFrame import MainFrame

    #Make sure the saveddata db exists
    if not os.path.exists(config.savePath):
        os.mkdir(config.savePath)

    eos.db.saveddata_meta.create_all()

    pyfa = wx.App(False)
    MainFrame()
    pyfa.MainLoop()
コード例 #2
0
ファイル: chrome_tabs.py プロジェクト: zwparchman/Pyfa
        mdc.DrawBitmap(self.bitmap, 0, 16)

        mdc.SetPen(wx.Pen("#000000", width=1))
        mdc.SetBrush(wx.TRANSPARENT_BRUSH)

        mdc.DrawRectangle(0, 16, rect.width, rect.height - 16)


if __name__ == "__main__":

    # need to set up some paths, since bitmap loader requires config to have things
    # Should probably change that so that it's not dependant on config
    import os
    os.chdir('..')
    import config
    config.defPaths(None)

    class Frame(wx.Frame):
        def __init__(self, title):
            super().__init__(None, title=title, size=(1000, 500))

            if 'wxMSW' in wx.PlatformInfo:
                color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)
                self.SetBackgroundColour(color)

            main_sizer = wx.BoxSizer(wx.HORIZONTAL)
            splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
            main_sizer.Add(splitter, 1, wx.EXPAND | wx.ALL, 2)

            # Main test notebook
            self.notebook = ChromeNotebook(splitter)
コード例 #3
0
ファイル: pyfa.py プロジェクト: fj/Pyfa
    
    # check also for dateutil module installed.
    try:
        import dateutil.parser  # Copied import statement from service/update.py
    except ImportError:
        print("Cannot find python-dateutil.\nYou can download python-dateutil from https://pypi.python.org/pypi/python-dateutil")
        sys.exit(1)


if __name__ == "__main__":
    # Configure paths
    if options.rootsavedata is True:
        config.saveInRoot = True

    config.debug = options.debug
    config.defPaths()

    # Basic logging initialization
    import logging
    logging.basicConfig()

    # Import everything
    import wx
    import os
    import os.path

    import eos.db
    import service.prefetch
    from gui.mainFrame import MainFrame

    #Make sure the saveddata db exists
コード例 #4
0
ファイル: pyfa.py プロジェクト: thauser/Pyfa
    from logbook import Logger
    pyfalog = Logger(__name__)

    from gui.errorDialog import ErrorHandler

    # Replace the uncaught exception handler with our own handler.
    sys.excepthook = ErrorHandler.HandleException

    if options.rootsavedata is True:
        config.saveInRoot = True

    config.debug = options.debug
    config.loggingLevel = config.LOGLEVEL_MAP.get(options.logginglevel.lower(),
                                                  config.LOGLEVEL_MAP['error'])
    config.defPaths(options.savepath)
    config.defLogging()

    with config.logging_setup.threadbound():

        pyfalog.info("Starting Pyfa")
        pyfalog.info(version_block)

        pyfalog.info("Writing log file to: {0}", config.logPath)

        if hasattr(sys, 'frozen'):
            pyfalog.info("Running in a frozen state.")
        else:
            pyfalog.info("Running in a thawed state.")

        # Lets get to the good stuff, shall we?
コード例 #5
0
ファイル: pyfa.py プロジェクト: Ebag333/Pyfa

if __name__ == "__main__":
    # Configure paths
    if options.rootsavedata is True:
        config.saveInRoot = True

    # set title if it wasn't supplied by argument
    if options.title is None:
        options.title = "pyfa %s%s - Python Fitting Assistant" % (config.version, "" if config.tag.lower() != 'git' else " (git)")

    config.debug = options.debug
    # convert to unicode if it is set
    if options.savepath is not None:
        options.savepath = unicode(options.savepath)
    config.defPaths(options.savepath)

    # Basic logging initialization
    import logging
    logging.basicConfig()

    # Import everything
    import wx
    import os
    import os.path

    import eos.db
    import service.prefetch
    from gui.mainFrame import MainFrame

    # Make sure the saveddata db exists
コード例 #6
0
ファイル: itemAttributes.py プロジェクト: pyfa-org/Pyfa
        elif isinstance(value, (int, float)) and rounding == 'dec':
            fvalue = roundDec(value, digits)
        else:
            fvalue = value
        return "%s %s" % (fvalue, unit)


if __name__ == "__main__":

    import eos.db
    # need to set up some paths, since bitmap loader requires config to have things
    # Should probably change that so that it's not dependant on config
    import os
    os.chdir('..')
    import config
    config.defPaths(None)
    config.debug = True
    class Frame(wx.Frame):
        def __init__(self, ):
            # item = eos.db.getItem(23773)  # Ragnarok
            item = eos.db.getItem(23061)  # Einherji I
            #item = eos.db.getItem(24483)  # Nidhoggur
            #item = eos.db.getItem(587)    # Rifter
            #item = eos.db.getItem(2486)   # Warrior I
            #item = eos.db.getItem(526)    # Stasis Webifier I
            item = eos.db.getItem(486)  # 200mm AutoCannon I
            #item = eos.db.getItem(200)  # Phased Plasma L

            super().__init__(None, title="Test Attribute Window | {} - {}".format(item.ID, item.name), size=(1000, 500))

            if 'wxMSW' in wx.PlatformInfo:
コード例 #7
0
    # check also for dateutil module installed.
    try:
        import dateutil.parser  # Copied import statement from service/update.py
    except ImportError:
        print(
            "Cannot find python-dateutil.\nYou can download python-dateutil from https://pypi.python.org/pypi/python-dateutil"
        )
        sys.exit(1)

if __name__ == "__main__":
    # Configure paths
    if options.rootsavedata is True:
        config.saveInRoot = True

    config.debug = options.debug
    config.defPaths()

    # Basic logging initialization
    import logging
    logging.basicConfig()

    # Import everything
    import wx
    import os
    import os.path

    import eos.db
    import service.prefetch
    from gui.mainFrame import MainFrame

    #Make sure the saveddata db exists
コード例 #8
0
ファイル: db_create.py プロジェクト: psolyca/eveDB_for_pytt
# Copyright (C) 2020 Damien Psolyca Gaignon
#
# This file is part of pytt.
#
# pyte is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pytt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pytt.  If not, see <http://www.gnu.org/licenses/>.
# ==============================================================================

import sys

from config import defPaths
from evedata import create_db

if __name__ == "__main__":

    print("Starting pytt DB creation")
    defPaths()

    create_db()
    sys.exit()