mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Added the 'ubuntu-store' configuration option to build a package that is already registered for the Ubuntu Store.
This commit is contained in:
parent
8ac035c8a9
commit
ab6e0945a7
16
build.py
16
build.py
@ -131,16 +131,18 @@ def build_cocoa(edition, dev):
|
|||||||
run_contents = tmpl.replace('{{app_path}}', app.dest)
|
run_contents = tmpl.replace('{{app_path}}', app.dest)
|
||||||
open('run.py', 'wt').write(run_contents)
|
open('run.py', 'wt').write(run_contents)
|
||||||
|
|
||||||
def build_qt(edition, dev):
|
def build_qt(edition, dev, conf):
|
||||||
print("Building localizations")
|
print("Building localizations")
|
||||||
build_localizations('qt', edition)
|
build_localizations('qt', edition)
|
||||||
print("Building Qt stuff")
|
print("Building Qt stuff")
|
||||||
print_and_do("pyrcc4 -py3 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
print_and_do("pyrcc4 -py3 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
||||||
fix_qt_resource_file(op.join('qt', 'base', 'dg_rc.py'))
|
fix_qt_resource_file(op.join('qt', 'base', 'dg_rc.py'))
|
||||||
print("Creating the run.py file")
|
print("Creating the run.py file")
|
||||||
tmpl = open(op.join('qt', 'run_template.py'), 'rt').read()
|
if conf.get('ubuntu_store'):
|
||||||
run_contents = tmpl.replace('{{edition}}', edition)
|
ubuntu_store_setup = "dgapp.model.registered = True; dgapp.model.registration_email = \"Ubuntu Store\""
|
||||||
open('run.py', 'wt').write(run_contents)
|
else:
|
||||||
|
ubuntu_store_setup = ""
|
||||||
|
filereplace(op.join('qt', 'run_template.py'), 'run.py', edition=edition, ubuntu_store_setup=ubuntu_store_setup)
|
||||||
|
|
||||||
def build_help(edition):
|
def build_help(edition):
|
||||||
print("Generating Help")
|
print("Generating Help")
|
||||||
@ -310,7 +312,7 @@ def build_pe_modules(ui):
|
|||||||
move_all('_block*', 'core_pe')
|
move_all('_block*', 'core_pe')
|
||||||
move_all('_cache*', 'core_pe')
|
move_all('_cache*', 'core_pe')
|
||||||
|
|
||||||
def build_normal(edition, ui, dev):
|
def build_normal(edition, ui, dev, conf):
|
||||||
print("Building dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
print("Building dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
||||||
add_to_pythonpath('.')
|
add_to_pythonpath('.')
|
||||||
build_help(edition)
|
build_help(edition)
|
||||||
@ -320,7 +322,7 @@ def build_normal(edition, ui, dev):
|
|||||||
if ui == 'cocoa':
|
if ui == 'cocoa':
|
||||||
build_cocoa(edition, dev)
|
build_cocoa(edition, dev)
|
||||||
elif ui == 'qt':
|
elif ui == 'qt':
|
||||||
build_qt(edition, dev)
|
build_qt(edition, dev, conf)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = parse_args()
|
options = parse_args()
|
||||||
@ -355,7 +357,7 @@ def main():
|
|||||||
build_cocoalib_xibless()
|
build_cocoalib_xibless()
|
||||||
build_xibless(edition)
|
build_xibless(edition)
|
||||||
else:
|
else:
|
||||||
build_normal(edition, ui, dev)
|
build_normal(edition, ui, dev, conf)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
25
configure.py
25
configure.py
@ -12,17 +12,18 @@ import json
|
|||||||
|
|
||||||
from hscommon.plat import ISOSX
|
from hscommon.plat import ISOSX
|
||||||
|
|
||||||
def main(edition, ui, dev):
|
def main(options):
|
||||||
if edition not in {'se', 'me', 'pe'}:
|
if options.edition not in {'se', 'me', 'pe'}:
|
||||||
edition = 'se'
|
options.edition = 'se'
|
||||||
if ui not in {'cocoa', 'qt'}:
|
if options.ui not in {'cocoa', 'qt'}:
|
||||||
ui = 'cocoa' if ISOSX else 'qt'
|
options.ui = 'cocoa' if ISOSX else 'qt'
|
||||||
build_type = 'Dev' if dev else 'Release'
|
build_type = 'Dev' if options.dev else 'Release'
|
||||||
print("Configuring dupeGuru {0} for UI {1} ({2})".format(edition.upper(), ui, build_type))
|
print("Configuring dupeGuru {0} for UI {1} ({2})".format(options.edition.upper(), options.ui, build_type))
|
||||||
conf = {
|
conf = {
|
||||||
'edition': edition,
|
'edition': options.edition,
|
||||||
'ui': ui,
|
'ui': options.ui,
|
||||||
'dev': dev,
|
'dev': options.dev,
|
||||||
|
'ubuntu_store': options.ubuntu_store,
|
||||||
}
|
}
|
||||||
json.dump(conf, open('conf.json', 'w'))
|
json.dump(conf, open('conf.json', 'w'))
|
||||||
|
|
||||||
@ -35,5 +36,7 @@ if __name__ == '__main__':
|
|||||||
help="Type of UI to build. 'qt' or 'cocoa'. Default is determined by your system.")
|
help="Type of UI to build. 'qt' or 'cocoa'. Default is determined by your system.")
|
||||||
parser.add_option('--dev', action='store_true', dest='dev', default=False,
|
parser.add_option('--dev', action='store_true', dest='dev', default=False,
|
||||||
help="If this flag is set, will configure for dev builds.")
|
help="If this flag is set, will configure for dev builds.")
|
||||||
|
parser.add_option('--ubuntu-store', action='store_true', dest='ubuntu_store', default=False,
|
||||||
|
help="Set registration for the Ubuntu Store.")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
main(options.edition, options.ui, options.dev)
|
main(options)
|
||||||
|
@ -17,7 +17,7 @@ from qtlib.error_report_dialog import install_excepthook
|
|||||||
from qtlib.util import setupQtLogging
|
from qtlib.util import setupQtLogging
|
||||||
from qt.base import dg_rc
|
from qt.base import dg_rc
|
||||||
from qt.base.platform import BASE_PATH
|
from qt.base.platform import BASE_PATH
|
||||||
from core_{{edition}} import __version__, __appname__
|
from core_{edition} import __version__, __appname__
|
||||||
|
|
||||||
if ISWINDOWS:
|
if ISWINDOWS:
|
||||||
import qt.base.cxfreeze_fix
|
import qt.base.cxfreeze_fix
|
||||||
@ -34,8 +34,9 @@ if __name__ == "__main__":
|
|||||||
install_gettext_trans_under_qt(locale_folder, lang)
|
install_gettext_trans_under_qt(locale_folder, lang)
|
||||||
# Many strings are translated at import time, so this is why we only import after the translator
|
# Many strings are translated at import time, so this is why we only import after the translator
|
||||||
# has been installed
|
# has been installed
|
||||||
from qt.{{edition}}.app import DupeGuru
|
from qt.{edition}.app import DupeGuru
|
||||||
app.setWindowIcon(QIcon(QPixmap(":/{0}".format(DupeGuru.LOGO_NAME))))
|
app.setWindowIcon(QIcon(QPixmap(":/{0}".format(DupeGuru.LOGO_NAME))))
|
||||||
dgapp = DupeGuru()
|
dgapp = DupeGuru()
|
||||||
|
{ubuntu_store_setup}
|
||||||
install_excepthook()
|
install_excepthook()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user