forked from WorldsOfBabylon/erk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
erk.py
738 lines (628 loc) · 22 KB
/
erk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
#
# Erk IRC Client
# Copyright (C) 2019 Daniel Hetrick
# _ _ _
# | | (_) | |
# _ __ _ _| |_ _ ___ | |__
# | '_ \| | | | __| |/ _ \| '_ \
# | | | | |_| | |_| | (_) | |_) |
# |_| |_|\__,_|\__| |\___/|_.__/ _
# | | | | _/ | | |
# | | __ _| |__ |__/_ _ __ __ _| |_ ___ _ __ _ _
# | |/ _` | '_ \ / _ \| '__/ _` | __/ _ \| '__| | | |
# | | (_| | |_) | (_) | | | (_| | || (_) | | | |_| |
# |_|\__,_|_.__/ \___/|_| \__,_|\__\___/|_| \__, |
# __/ |
# |___/
# https://github.com/nutjob-laboratories
#
# This program 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.
# This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
import argparse
import string
import shutil
import sys
import os
from zipfile import ZipFile
import urllib.parse
import posixpath
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import QtCore
app = QApplication([])
import qt5reactor
qt5reactor.install()
from twisted.internet import reactor
from erk.dialogs import ComboDialogBanner
from erk.main import Erk
from erk.files import *
from erk.objects import *
from erk.strings import *
import erk.config
from erk.common import *
from erk.dialogs.settings import Dialog as Settings
from erk.dialogs.scriptedit import Window as ErkScriptEditor
from erk.dialogs.export_log import Dialog as ExportLog
from erk.dialogs.format import Dialog as FormatText
# Handle commandline arguments
parser = argparse.ArgumentParser(
prog=f"python {PROGRAM_FILENAME}",
formatter_class=argparse.RawDescriptionHelpFormatter,
description=f'''
██████╗ ██████╗ ██╗ ██╗
╚═══╗██╗██╔══██╗██║ ██╔╝ ╔═══════════════╗
███████║██████╔╝█████╔╝ ║ {APPLICATION_NAME} {APPLICATION_VERSION} ║
██╔══██║██╔══██╗██╔═██╗ ╚═══════════════╝
█████╔╝██║ ██║██║ ██╗
╚════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
An open source, cross-platform IRC client
https://github.com/nutjob-laboratories/erk
https://github.com/nutjob-laboratories/erk-plugins
''',
)
congroup = parser.add_argument_group('Connection')
congroup.add_argument("server", type=str,help="Server to connect to", metavar="SERVER", nargs='?')
congroup.add_argument("port", type=int,help="Server port to connect to (6667)", default=6667, nargs='?', metavar="PORT")
congroup.add_argument( "--ssl", help=f"Use SSL to connect to IRC", action="store_true")
congroup.add_argument( "--reconnect", help=f"Reconnect to servers on disconnection", action="store_true")
congroup.add_argument("-p","--password", type=str,help="Use server password to connect", metavar="PASSWORD", default='')
congroup.add_argument("-c","--channel", type=str,help="Join channel on connection", metavar="CHANNEL[:KEY]", action='append')
congroup.add_argument("-l","--last", help=f"Automatically connect to the last server connected to", action="store_true")
congroup.add_argument("-u","--url", type=str,help="Use an IRC URL to connect", metavar="URL", default='')
congroup.add_argument("-a","--autoscript", help=f"Execute connection script (if one exists)", action="store_true")
congroup.add_argument("-s","--script", type=str,help="Execute a custom script on connection", metavar="FILE", action='append')
displaygroup = parser.add_argument_group('Display')
displaygroup.add_argument("-f","--fullscreen", help="Open in fullscreen mode", action="store_true")
displaygroup.add_argument("-o","--ontop", help="Application window is always on top", action="store_true")
displaygroup.add_argument("-W","--width", type=int,help="Set initial window width", default=None, metavar="WIDTH")
displaygroup.add_argument("-H","--height", type=int,help="Set initial window height", default=None, metavar="HEIGHT")
miscgroup = parser.add_argument_group('Configuration')
miscgroup.add_argument("-C","--config", type=str,help="Use an alternate configuration file", metavar="FILE", default=SETTINGS_FILE)
miscgroup.add_argument("-U","--user", type=str,help="Use an alternate user file", metavar="FILE", default=USER_FILE)
miscgroup.add_argument("-Y","--style", type=str,help="Use an alternate text style file", metavar="FILE", default=STYLE_FILE)
miscgroup.add_argument("-L","--logs", type=str,help="Use an alternate log storage location", metavar="DIRECTORY", default=LOG_DIRECTORY)
miscgroup.add_argument("-S","--scripts", type=str,help="Use an alternate script storage location", metavar="DIRECTORY", default=SCRIPTS_DIRECTORY)
miscgroup.add_argument("-T","--styles", type=str,help="Use an alternate style storage location", metavar="DIRECTORY", default=STYLES_DIRECTORY)
miscgroup.add_argument("-M","--macros", type=str,help="Use an alternate macro save file", metavar="FILE", default=MACRO_SAVE_FILE)
miscgroup.add_argument("-P","--plugins", type=str,help="Add a directory to load plugins from", metavar="DIRECTORY", action='append',default=[])
devgroup = parser.add_argument_group('Tools')
devgroup.add_argument("-e","--edit", dest="scripter",nargs='?',type=str,help="Launch the script editor", metavar="FILE",const=1)
devgroup.add_argument("--settings","--preferences", dest="settings", nargs='?', type=str,help="Launch the preferences editor", metavar="FILE",const=1)
devgroup.add_argument("--generate", nargs='?', type=str,help="Create a \"blank\" plugin for editing", metavar="FILE",const=1)
devgroup.add_argument("--edit-style", dest="styler", help="Launch the style editor", action="store_true")
devgroup.add_argument("--export", dest="xlog", help="Launch the log export tool", action="store_true")
disgroup = parser.add_argument_group('Disable functionality')
disgroup.add_argument( "--noask", help=f"Don't ask for a server to connect to on start", action="store_true")
disgroup.add_argument( "--nosettings", help=f"Disable the \"Settings\" menu", action="store_true")
disgroup.add_argument( "--nomenus", help=f"Disable all menus", action="store_true")
disgroup.add_argument( "--noconnect", help=f"Disable connection commands", action="store_true")
disgroup.add_argument( "--noscripts", help=f"Disable scripting", action="store_true")
disgroup.add_argument( "--nodisplay", help=f"Disable connection display", action="store_true")
disgroup.add_argument( "--nostyles", help=f"Disables style loading and editing", action="store_true")
disgroup.add_argument( "--noedit", help=f"Disables the script editor", action="store_true")
disgroup.add_argument( "--noplugins", help=f"Disables plugins", action="store_true")
disgroup.add_argument( "--nocommands", help=f"Disables user input commands", action="store_true")
disgroup.add_argument( "--noextensions", help=f"Disables plugins, scripts, and styles", action="store_true")
disgroup.add_argument( "--nologs", help=f"Disables reading and writing logs", action="store_true")
disgroup.add_argument( "--noload", help=f"Disables log loading", action="store_true")
disgroup.add_argument( "--nowrite", help=f"Disables log writing", action="store_true")
disgroup.add_argument( "--nosystray", help=f"Disables system tray icon", action="store_true")
disgroup.add_argument( "--notraymenu", help=f"Disables system tray menu", action="store_true")
disgroup.add_argument( "--qt5menu", help=f"Disable menu toolbar, and use normal menus", action="store_true")
args = parser.parse_args()
loaded_config_file = False
if __name__ == '__main__':
app = QApplication([])
# "Generate" a blank plugin
if args.generate:
if args.generate==1:
# No argument, so print to STDOUT
f = open(BLANK_PLUGIN_FILE,'r+')
x = f.read()
f.close()
print(x)
sys.exit(0)
else:
if os.path.isfile(args.generate):
print("File \""+args.generate+"\" already exists.")
sys.exit(1)
# Copy the blank plugin in the data directory
# to the new location
shutil.copy(BLANK_PLUGIN_FILE,args.generate)
print("Plugin generated!")
sys.exit(0)
# If --noextensions is enabled, turn off stuff
if args.noextensions:
args.noscripts = True
args.noplugins = True
args.nostyles = True
# If the user has passed an alternate configuration file,
# and the file doesn't exist, create a new config file
# where the user indicated, with default values
if args.config:
if not os.path.isfile(args.config):
erk.config.load_settings(args.config)
loaded_config_file = True
print("\""+args.config+"\" created!")
if args.style:
if not os.path.isfile(args.style):
f = get_text_format_settings(None)
write_style_file(f,args.style)
print("\""+args.style+"\" created!")
if args.user:
if not os.path.isfile(args.user):
u = get_user(args.user)
save_user(u,args.user)
print("\""+args.user+"\" created!")
if args.logs:
if not os.path.isdir(args.logs):
os.mkdir(args.logs)
print("\""+args.logs+"\" directory created!")
if args.scripts:
if not os.path.isdir(args.scripts):
os.mkdir(args.scripts)
print("\""+args.scripts+"\" directory created!")
if args.styles:
if not os.path.isdir(args.styles):
os.mkdir(args.styles)
print("\""+args.styles+"\" directory created!")
if args.plugins:
for p in args.plugins:
if not os.path.isdir(p):
print("Can't load plugins from \""+p+"\", directory doesn't exist")
sys.exit(1)
# Handle the log export dialog
if args.xlog:
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
x = ExportLog(args.logs,None,app)
info = x.get_name_information(args.logs,None,app)
if info:
elog = info[0]
dlog = info[1]
llog = info[2]
do_json = info[3]
do_epoch = info[4]
if not do_json:
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
fileName, _ = QFileDialog.getSaveFileName(None,"Export Log As...",INSTALL_DIRECTORY,"Text File (*.txt)", options=options)
if fileName:
efl = len("txt")+1
if fileName[-efl:].lower()!=f".txt": fileName = fileName+f".txt"
dump = dumpLog(elog,dlog,llog,do_epoch)
code = open(fileName,mode="w",encoding="utf-8")
code.write(dump)
code.close()
else:
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
fileName, _ = QFileDialog.getSaveFileName(None,"Export Log As...",INSTALL_DIRECTORY,"JSON File (*.json)", options=options)
if fileName:
efl = len("json")+1
if fileName[-efl:].lower()!=f".json": fileName = fileName+f".json"
dump = dumpLogJson(elog,do_epoch)
code = open(fileName,mode="w",encoding="utf-8")
code.write(dump)
code.close()
app.exit()
else:
sys.exit(0)
# Handle opening the style editor
elif args.styler:
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
x = FormatText(None,None,None,args.style,app,args.styles)
x.show()
# Handle opening the settings dialog
elif args.settings:
if args.settings==1:
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
SETTINGS = Settings(args.config,None,app)
SETTINGS.show()
else:
if not os.path.isfile(args.settings):
erk.config.load_settings(args.settings)
else:
erk.config.load_settings(args.settings)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
SETTINGS = Settings(args.settings,None,app)
SETTINGS.show()
# Handle launching the script editor
elif args.scripter:
if args.scripter==1:
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
EDITOR = ErkScriptEditor(None,None,args.config,args.scripts,app)
EDITOR.resize(int(erk.config.DEFAULT_APP_WIDTH),int(erk.config.DEFAULT_APP_HEIGHT))
EDITOR.show()
else:
file = args.scripter
if not os.path.isfile(file):
print("\""+file+"\" doesn't exist. Please use --edit to create a new file.")
sys.exit(1)
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
EDITOR = ErkScriptEditor(file,None,args.config,args.scripts,app)
EDITOR.resize(int(erk.config.DEFAULT_APP_WIDTH),int(erk.config.DEFAULT_APP_HEIGHT))
EDITOR.show()
else:
if not loaded_config_file:
erk.config.load_settings(args.config)
if erk.config.DISPLAY_FONT=='':
id = QFontDatabase.addApplicationFont(DEFAULT_FONT)
for f in OTHER_FONTS:
QFontDatabase.addApplicationFont(f)
_fontstr = QFontDatabase.applicationFontFamilies(id)[0]
font = QFont(_fontstr,DEFAULT_FONT_SIZE)
else:
f = QFont()
f.fromString(erk.config.DISPLAY_FONT)
font = f
app.setFont(font)
# Handle disabling connect commands
if args.noconnect: erk.config.DISABLE_CONNECT_COMMANDS = True
# Disable scripting, if it's disabled in the config file
is_scripting_enabled = args.noscripts
if not erk.config.ENABLE_SCRIPTS:
is_scripting_enabled = True
# Handle IRC URLs
if args.url!='':
u = urllib.parse.urlparse(args.url)
if u.scheme=='irc':
if u.password:
args.password = u.password
if u.hostname:
args.server = u.hostname
if u.port:
args.port = u.port
if u.path!='':
p = urllib.parse.unquote(u.path)
p = posixpath.normpath(p)
l = posixpath.split(p)
if len(l)>0:
if l[0]=='/':
if l[1]!='':
c = str(l[1])
if ',' in c:
channel = c.split(',')
if len(channel)==2:
if channel[0][:1]!='#': channel[0] = '#'+channel[0]
if args.channel:
args.channel.append([channel[0],channel[1]])
else:
args.channel = []
args.channel.append([channel[0],channel[1]])
else:
if c[1:]!='#': c = '#'+c
if args.channel:
args.channel.append([c,''])
else:
args.channel = []
args.channel.append([c,''])
# Handle connecting to a server if one has been provided
if args.server:
if args.noscripts:
if args.autoscript:
print("Connection script cannot execute: scripting has been disabled")
sys.exit(1)
if args.script!=None:
print("Script cannot execute: scripting has been disabled")
sys.exit(1)
autoscript = None
if args.autoscript:
autoscript = load_auto_script(args.server,args.port,args.scripts)
if args.script:
for s in args.script:
sfile = find_script_file(s,args.scripts)
if sfile==None:
print("Script not found: "+s)
sys.exit(1)
if os.path.isfile(sfile):
f=open(sfile, "r")
cscript = f.read()
f.close()
if len(cscript)>0:
if cscript[-1]!="\n": cscript = cscript + "\n"
if autoscript!=None:
autoscript = autoscript + cscript
else:
autoscript = cscript
if args.password=='':
pword = None
else:
pword = args.password
chans = []
if args.channel:
for c in args.channel:
if type(c)==list:
chans.append(c)
else:
p = c.split(':')
if len(p)==2:
chans.append(p)
else:
chans.append( [c,''] )
u = get_user(args.user)
i = ConnectInfo(
args.server,
args.port,
pword,
args.ssl,
u["nickname"],
u["alternate"],
u["username"],
u["realname"],
args.reconnect,
chans,
u["failreconnect"],
False,
autoscript,
)
GUI = Erk(
app,
i,
args.nosettings,
args.nomenus,
args.config,
args.style,
args.user,
args.fullscreen,
args.width,
args.height,
args.logs,
is_scripting_enabled,
args.scripts,
args.nodisplay,
args.ontop,
args.qt5menu,
args.styles,
args.nostyles,
args.noedit,
args.macros,
args.noplugins,
args.plugins,
args.nocommands,
args.nologs,
args.noload,
args.nowrite,
args.nosystray,
args.notraymenu,
)
GUI.show()
else:
# Handle launching without the connection dialog
if args.noask:
GUI = Erk(
app,
None,
args.nosettings,
args.nomenus,
args.config,
args.style,
args.user,
args.fullscreen,
args.width,
args.height,
args.logs,
is_scripting_enabled,
args.scripts,
args.nodisplay,
args.ontop,
args.qt5menu,
args.styles,
args.nostyles,
args.noedit,
args.macros,
args.noplugins,
args.plugins,
args.nocommands,
args.nologs,
args.noload,
args.nowrite,
args.nosystray,
args.notraymenu,
)
GUI.show()
# Handle connecting to the last server
elif args.last:
u = get_user(args.user)
if args.noscripts:
if args.autoscript:
print("Server script cannot execute: scripting has been disabled")
sys.exit(1)
if args.script!=None:
print("Server script cannot execute: scripting has been disabled")
sys.exit(1)
autoscript = None
# If the user has the autoscript option enabled in
# their user file, then load the appropriate connection script
if u["auto_script"]:
autoscript = load_auto_script(u["last_server"],u["last_port"],args.scripts)
# If the connection script isn't already loaded (or isn't going to be loaded)
# and the user turned on autoscript with the commandline flag, then
# load the appropriate connection script
if autoscript==None:
if args.autoscript:
autoscript = load_auto_script(u["last_server"],u["last_port"],args.scripts)
if args.script:
for s in args.script:
sfile = find_script_file(s,args.scripts)
if sfile==None:
print("Script not found: "+s)
sys.exit(1)
if os.path.isfile(sfile):
f=open(sfile, "r")
cscript = f.read()
f.close()
if len(cscript)>0:
if cscript[-1]!="\n": cscript = cscript + "\n"
if autoscript!=None:
autoscript = autoscript + cscript
else:
autoscript = cscript
if u["last_password"] == '':
pword = None
else:
pword = u["last_password"]
if args.channel:
for ch in args.channel:
p = ch.split(':')
if len(p)==2:
c.append(p)
else:
c.append( [ch,''] )
i = ConnectInfo(
u["last_server"],
int(u["last_port"]),
pword,
u["ssl"],
u["nickname"],
u["alternate"],
u["username"],
u["realname"],
u["reconnect"],
[],
u["failreconnect"],
False,
autoscript,
)
GUI = Erk(
app,
i,
args.nosettings,
args.nomenus,
args.config,
args.style,
args.user,
args.fullscreen,
args.width,
args.height,
args.logs,
is_scripting_enabled,
args.scripts,
args.nodisplay,
args.ontop,
args.qt5menu,
args.styles,
args.nostyles,
args.noedit,
args.macros,
args.noplugins,
args.plugins,
args.nocommands,
args.nologs,
args.noload,
args.nowrite,
args.nosystray,
args.notraymenu,
)
GUI.show()
else:
# Launch normally, showing the connection dialog first
info = ComboDialogBanner(args.user,is_scripting_enabled,args.scripts,args.config)
if info!=None:
GUI = Erk(
app,
info,
args.nosettings,
args.nomenus,
args.config,
args.style,
args.user,
args.fullscreen,
args.width,
args.height,
args.logs,
is_scripting_enabled,
args.scripts,
args.nodisplay,
args.ontop,
args.qt5menu,
args.styles,
args.nostyles,
args.noedit,
args.macros,
args.noplugins,
args.plugins,
args.nocommands,
args.nologs,
args.noload,
args.nowrite,
args.nosystray,
args.notraymenu,
)
GUI.show()
else:
app.quit()
reactor.run()