mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 11:18:08 -06:00
Remove hardcoded app names.
This commit is contained in:
parent
be0253815f
commit
00d5b88b8d
@ -2,15 +2,16 @@
|
||||
import argparse
|
||||
import paths
|
||||
import logging
|
||||
import application
|
||||
log = logging.getLogger("commandlineLauncher")
|
||||
|
||||
parser = argparse.ArgumentParser(description="TW Blue command line launcher")
|
||||
parser = argparse.ArgumentParser(description=application.name+" command line launcher")
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument("-p", "--portable", help="Use TW Blue as a portable application.", action="store_true", default=True)
|
||||
group.add_argument("-i", "--installed", help="Use TW Blue as an installed application. Config files will be saved in the user data directory", action="store_true")
|
||||
parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where TW Blue saves userdata.")
|
||||
group.add_argument("-p", "--portable", help="Use " + application.name + " as a portable application.", action="store_true", default=True)
|
||||
group.add_argument("-i", "--installed", help="Use " + application.name + " as an installed application. Config files will be saved in the user data directory", action="store_true")
|
||||
parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where " + application.name + " saves userdata.")
|
||||
args = parser.parse_args()
|
||||
log.debug("Starting TWBlue with the following arguments: installed = %s, portable = %s and directory = %s" % (args.installed, args.portable, args.directory))
|
||||
log.debug("Starting " + application.name + " with the following arguments: installed = %s, portable = %s and directory = %s" % (args.installed, args.portable, args.directory))
|
||||
if args.installed == True: paths.mode = "installed"
|
||||
elif args.portable == True:
|
||||
paths.mode = "portable"
|
||||
|
@ -5,6 +5,7 @@ import os
|
||||
import exceptions
|
||||
import dropbox
|
||||
import logging
|
||||
import application
|
||||
from keys import keyring
|
||||
from utils import *
|
||||
from dropbox.rest import ErrorResponse
|
||||
@ -51,7 +52,7 @@ class dropboxLogin(object):
|
||||
return self.flow.start()
|
||||
|
||||
def authorise(self, code):
|
||||
log.debug("Authorising TWBlue in Dropbox...")
|
||||
log.debug("Authorising " + application.name + " to Dropbox...")
|
||||
access_token, user_id = self.flow.finish(code)
|
||||
log.debug("Saving tokens...")
|
||||
self.config["services"]["dropbox_token"] = access_token
|
||||
@ -64,7 +65,7 @@ class dropboxUploader(object):
|
||||
self.client = dropbox.client.DropboxClient(config["services"]["dropbox_token"])
|
||||
else:
|
||||
log.error("Dropbox is not authorised for this session.")
|
||||
raise UnauthorisedError("You need authorise TWBlue")
|
||||
raise UnauthorisedError("You need to authorise " + application.name)
|
||||
self.filename = filename
|
||||
self.short_url = short_url
|
||||
self.file = open(self.filename, "rb")
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
import widgetUtils
|
||||
|
||||
import application
|
||||
class autocompletionSettingsDialog(widgetUtils.BaseDialog):
|
||||
def __init__(self):
|
||||
super(autocompletionSettingsDialog, self).__init__(parent=None, id=-1, title=_(u"Autocomplete users’ settings"))
|
||||
@ -23,4 +23,4 @@ class autocompletionSettingsDialog(widgetUtils.BaseDialog):
|
||||
self.SetClientSize(sizer.CalcMin())
|
||||
|
||||
def show_success_dialog():
|
||||
wx.MessageDialog(None, _(u"TWBlue's database of users has been updated."), _(u"Done"), wx.OK).ShowModal()
|
||||
wx.MessageDialog(None, _(uapplication.name+"'s database of users has been updated."), _(u"Done"), wx.OK).ShowModal()
|
@ -14,13 +14,13 @@ class general(wx.Panel, baseDialog.BaseWXDialog):
|
||||
langBox.Add(language, 0, wx.ALL, 5)
|
||||
langBox.Add(self.language, 0, wx.ALL, 5)
|
||||
sizer.Add(langBox, 0, wx.ALL, 5)
|
||||
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting TwBlue?"))
|
||||
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting " + application.name))
|
||||
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
|
||||
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _(u"Use invisible interface's keyboard shorcuts on the GUI"))
|
||||
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _(u"Use invisible interface's keyboard shortcuts while GUI is visible"))
|
||||
sizer.Add(self.use_invisible_shorcuts, 0, wx.ALL, 5)
|
||||
self.disable_sapi5 = wx.CheckBox(self, -1, _(u"Activate Sapi5 when any other screen reader is not being run"))
|
||||
sizer.Add(self.disable_sapi5, 0, wx.ALL, 5)
|
||||
self.hide_gui = wx.CheckBox(self, -1, _(u"Activate the auto-start of the invisible interface"))
|
||||
self.hide_gui = wx.CheckBox(self, -1, _(u"Hide GUI on launch"))
|
||||
sizer.Add(self.hide_gui, 0, wx.ALL, 5)
|
||||
self.SetSizer(sizer)
|
||||
|
||||
|
@ -99,8 +99,8 @@ class mainFrame(Gtk.Window):
|
||||
self.changelog = Gtk.MenuItem(label="What's new in this version?")
|
||||
self.check_for_updates = Gtk.MenuItem(label="Check for updates")
|
||||
self.reportError = Gtk.MenuItem(label="Report an error")
|
||||
self.visit_website = Gtk.MenuItem(label="TWBlue's website")
|
||||
self.about = Gtk.MenuItem(label="ABout TWBlue")
|
||||
self.visit_website = Gtk.MenuItem(label=application.name+"'s website")
|
||||
self.about = Gtk.MenuItem(label="ABout "+application.name)
|
||||
self.append_to_menu(help, self.doc, self.sounds_tutorial, self.changelog, self.check_for_updates, self.reportError, self.visit_website, self.about)
|
||||
help_menu = Gtk.MenuItem(label="Help")
|
||||
help_menu.set_submenu(help)
|
||||
|
@ -44,7 +44,7 @@ class reportBug(object):
|
||||
try:
|
||||
client = Client(application.report_bugs_url)
|
||||
issue = client.factory.create('IssueData')
|
||||
issue.project.name = "TWBlue"
|
||||
issue.project.name = application.name
|
||||
issue.project.id = 0
|
||||
issue.summary = self.dialog.get("summary"),
|
||||
issue.description = "Reported by @%s\n\n" % (self.user_name) + self.dialog.get("description")
|
||||
|
@ -49,7 +49,7 @@ if system == "Linux":
|
||||
log = logging.getLogger("main")
|
||||
|
||||
def setup():
|
||||
log.debug("Starting TWBlue %s" % (application.version,))
|
||||
log.debug("Starting " + application.name + " %s" % (application.version,))
|
||||
config.setup()
|
||||
log.debug("Using %s %s" % (platform.system(), platform.architecture()[0]))
|
||||
log.debug("Application path is %s" % (paths.app_path(),))
|
||||
|
@ -12,7 +12,7 @@ import platform
|
||||
import output
|
||||
system = platform.system()
|
||||
from mysc.repeating_timer import RepeatingTimer
|
||||
|
||||
import application
|
||||
URLPlayer = None
|
||||
|
||||
def setup():
|
||||
@ -46,7 +46,7 @@ class soundSystem(object):
|
||||
self.path = paths.sound_path("default")
|
||||
self.soundpack_OK = True
|
||||
else:
|
||||
log.error("Path for the current soundpack does not exist and the default soundpack is deleted, TWBlue will not play sounds.")
|
||||
log.error("The current soundpack could not be found and the default soundpack has been deleted, " + application.name + " will not play sounds.")
|
||||
self.soundpack_OK = False
|
||||
|
||||
def __init__(self, soundConfig):
|
||||
|
Loading…
Reference in New Issue
Block a user