-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper_startup.html
608 lines (592 loc) · 26.4 KB
/
helper_startup.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>helper_startup.html</title>
<style type="text/css">
.end-element { fill : #FFCCFF; }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.17.1/flowchart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.bundle.min.js"></script>
<!-- <script src="../release/flowchart.min.js"></script> -->
<script>
window.onload = function () {
var btn = document.getElementById("run"),
cd = document.getElementById("code"),
chart;
(btn.onclick = function () {
var code = cd.value;
if (chart) {
chart.clean();
}
chart = flowchart.parse(code);
chart.drawSVG('canvas', {
'x': 0,
'y': 0,
'line-width': 3,
//'maxWidth': 15,//ensures the flowcharts fits within a certain width
'line-length': 50,
'text-margin': 10,
'font-size': 14,
'font': 'normal',
'font-family': 'Helvetica',
'font-weight': 'normal',
'font-color': 'black',
'line-color': 'black',
'element-color': 'black',
'fill': 'white',
'yes-text': 'yes',
'no-text': 'no',
'arrow-end': 'block',
'scale': 1,
'symbols': {
'start': {
'font-size': 14,
'font-color': 'yellow',
'element-color': 'blue',
'fill': 'green',
'class': 'start-element'
},
'inputoutput': {
'font-color': 'black',
'element-color': 'black',
'fill': 'bisque'
},
'operation': {
'font-color': 'black',
'element-color': 'black',
'fill': 'linen'
},
'subroutine': {
'font-color': 'black',
'element-color': 'blue',
'fill': 'lightgreen'
},
'condition': {
'font-color': 'red',
'element-color': 'black',
'fill': 'yellow'
},
'end':{
'font-size': 20,
'class': 'end-element'
}
},
'flowstate' : {
//'past' : { 'fill' : '#CCCCCC', 'font-size' : 12},
//'current' : {'fill' : 'yellow', 'font-color' : 'red', 'font-weight' : 'bold'},
//'future' : { 'fill' : '#FFFF99'},
'request' : { 'fill' : 'blue'},
'invalid': {'fill' : '#444444'},
'approved' : { 'fill' : '#58C4A3', 'font-size' : 12, 'yes-text' : 'APPROVED', 'no-text' : 'n/a' },
'rejected' : { 'fill' : '#C45879', 'font-size' : 12, 'yes-text' : 'n/a', 'no-text' : 'REJECTED' }
}
});
//create base64 encoding of SVG to generate download link for title(without html or htm).SVG
var currentCanvasDIV = document.getElementById('canvas')
var currentDrawSVG = currentCanvasDIV.innerHTML.replaceAll('ë','e');
const OUTsvgBASE64 = btoa(currentDrawSVG)
doctitle = document.title.replace('.html','');
doctitle = doctitle.replace('.htm','');
var currentCanvasDIV = document.getElementById('canvas')
var currentDrawSVG = currentCanvasDIV.innerHTML.replaceAll('ë','e');
svgSource = currentDrawSVG
svgXML = currentDrawSVG;
// Use SVG Height and Width from the SVG XML to set canvas size
svgXMLsubstringHeight = svgXML.substring(svgXML.indexOf('height='), svgXML.indexOf('version='));
svgXMLsubstringWidth = svgXML.substring(svgXML.indexOf('width='), svgXML.indexOf('xmlns='));
HeightValue = svgXMLsubstringHeight.substring(svgXMLsubstringHeight.indexOf('"')+1,svgXMLsubstringHeight.lastIndexOf('"'));
WidthValue = svgXMLsubstringWidth.substring(svgXMLsubstringWidth.indexOf('"')+1,svgXMLsubstringWidth.lastIndexOf('"'));
HeightValueInt = Math.round(HeightValue)
WidthValueInt = Math.round(WidthValue)
// setup input for base64SvgToBase64Png
let svgSrc = "data:image/svg+xml;base64,"+OUTsvgBASE64;
var pngBase
imageUtil.base64SvgToBase64Png(svgSrc, WidthValueInt, HeightValueInt).then(pngSrc => {
pngBase = pngSrc
// output download link for base64 PNG converted on download from base64
var pngOutHtml = `<a href="${pngBase}" download="${doctitle}.png">PNG - Click here to download current rendered flowchart as ${doctitle}.png</a>`
document.getElementById("pngbase64").innerHTML=pngOutHtml;
});
// output download link for base64 SVG converted on download from base64
var svgOutHtml = `<a href="data:image/svg+xml;base64,${OUTsvgBASE64}" download=${doctitle}.svg>SVG - Click here to download current rendered flowchart as ${doctitle}.svg</a> `
document.getElementById("svgbase64").innerHTML=svgOutHtml;
})();
};
// derived from https://stackoverflow.com/a/64800570
// we need to use web browser canvas to generate a image. In this case png
let imageUtil = {};
/**
* converts a base64 encoded data url SVG image to a PNG image
* @param originalBase64 data url of svg image
* @param width target width in pixel of PNG image
* @param secondTry used internally to prevent endless recursion
* @return {Promise<unknown>} resolves to png data url of the image
*/
imageUtil.base64SvgToBase64Png = function (originalBase64, width, height, secondTry) {
return new Promise(resolve => {
let img = document.createElement('img');
img.onload = function () {
if (!secondTry && (img.naturalWidth === 0 || img.naturalHeight === 0)) {
let svgDoc = base64ToSvgDocument(originalBase64);
let fixedDoc = fixSvgDocumentFF(svgDoc);
return imageUtil.base64SvgToBase64Png(svgDocumentToBase64(fixedDoc), width, height, true).then(result => {
resolve(result);
});
}
//document.body.appendChild(img);
let canvas2 = document.createElement("canvas");
//document.body.removeChild(img);
canvas2.width = width;
canvas2.height = height;
let ctx = canvas2.getContext("2d");
ctx.drawImage(img, 0, 0, canvas2.width, canvas2.height);
try {
let data = canvas2.toDataURL('image/png');
resolve(data);
} catch (e) {
resolve(null);
}
};
img.src = originalBase64;
});
}
//needed because Firefox doesn't correctly handle SVG with size = 0, see https://bugzilla.mozilla.org/show_bug.cgi?id=700533
function fixSvgDocumentFF(svgDocument) {
try {
let widthInt = parseInt(svgDocument.documentElement.width.baseVal.value) || 500;
let heightInt = parseInt(svgDocument.documentElement.height.baseVal.value) || 500;
svgDocument.documentElement.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, widthInt);
svgDocument.documentElement.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, heightInt);
return svgDocument;
} catch (e) {
return svgDocument;
}
}
function svgDocumentToBase64(svgDocument) {
try {
let base64EncodedSVG = btoa(new XMLSerializer().serializeToString(svgDocument));
return 'data:image/svg+xml;base64,' + base64EncodedSVG;
} catch (e) {
return null;
}
}
function base64ToSvgDocument(base64) {
let svg = atob(base64.substring(base64.indexOf('base64,') + 7));
svg = svg.substring(svg.indexOf('<svg'));
let parser = new DOMParser();
return parser.parseFromString(svg, "image/svg+xml");
}
</script>
<script>
function HelpText() {
var x = document.getElementById("HelpTextBlock");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
</head>
<body>
<div><textarea id="code" style="width: 100%;" rows="11">op2=>operation: '\nStartup operations.\n'
op4=>operation: import ctypes
op6=>operation: import logging
op8=>operation: import os
op10=>operation: import platform
op12=>operation: import socket
op14=>operation: import sys
op16=>operation: import time
op18=>operation: from distutils.version import StrictVersion
op20=>operation: from struct import pack
op22=>operation: from six.moves import configparser
op24=>operation: try:
import defaults
import helper_random
import paths
import state
from bmconfigparser import config, config_ready
except ImportError:
from . import defaults, helper_random, paths, state
from .bmconfigparser import config, config_ready
op26=>operation: try:
from plugins.plugin import get_plugin
except ImportError:
get_plugin = None
op28=>operation: logger = logging.getLogger('default')
op30=>operation: StoreConfigFilesInSameDirectoryAsProgramByDefault = False
st33=>start: start loadConfig
io35=>inputoutput: input:
op38=>operation: 'Load the config'
cond41=>condition: if state.appdata
sub45=>subroutine: config.read((state.appdata + 'keys.dat'))
op47=>operation: needToCreateKeysFile = (config.safeGet('bitmessagesettings', 'settingsversion') is None)
cond50=>operation: logger.info('Loading config files from directory specified on startup: %s', state.appdata) if (not needToCreateKeysFile)
cond97=>condition: if needToCreateKeysFile
sub101=>subroutine: config.read()
sub103=>subroutine: config.set('bitmessagesettings', 'settingsversion', '10')
cond106=>condition: if ('linux' in sys.platform)
sub110=>subroutine: config.set('bitmessagesettings', 'minimizetotray', 'false')
sub117=>subroutine: config.set('bitmessagesettings', 'defaultnoncetrialsperbyte', str(defaults.networkDefaultProofOfWorkNonceTrialsPerByte))
sub119=>subroutine: config.set('bitmessagesettings', 'defaultpayloadlengthextrabytes', str(defaults.networkDefaultPayloadLengthExtraBytes))
sub121=>subroutine: config.set('bitmessagesettings', 'dontconnect', 'true')
cond124=>condition: if StoreConfigFilesInSameDirectoryAsProgramByDefault
op128=>operation: state.appdata = ''
sub130=>subroutine: logger.info('Creating new config files in same directory as program.')
cond149=>operation: os.umask(63) if (not sys.platform.startswith('win'))
sub159=>subroutine: config.save()
sub166=>subroutine: config_ready.set()
e168=>end: end loadConfig
st172=>start: start updateConfig
io174=>inputoutput: input:
op177=>operation: 'Save the config'
op179=>operation: settingsversion = config.getint('bitmessagesettings', 'settingsversion')
cond182=>condition: if (settingsversion == 1)
sub186=>subroutine: config.set('bitmessagesettings', 'socksproxytype', 'none')
sub188=>subroutine: config.set('bitmessagesettings', 'sockshostname', 'localhost')
sub190=>subroutine: config.set('bitmessagesettings', 'socksport', '9050')
sub192=>subroutine: config.set('bitmessagesettings', 'socksauthentication', 'false')
sub194=>subroutine: config.set('bitmessagesettings', 'socksusername', '')
sub196=>subroutine: config.set('bitmessagesettings', 'sockspassword', '')
sub198=>subroutine: config.set('bitmessagesettings', 'sockslisten', 'false')
sub200=>subroutine: config.set('bitmessagesettings', 'keysencrypted', 'false')
sub202=>subroutine: config.set('bitmessagesettings', 'messagesencrypted', 'false')
op204=>operation: settingsversion = 2
cond224=>condition: if (settingsversion == 5)
sub228=>subroutine: config.set('bitmessagesettings', 'maxacceptablenoncetrialsperbyte', '0')
sub230=>subroutine: config.set('bitmessagesettings', 'maxacceptablepayloadlengthextrabytes', '0')
op232=>operation: settingsversion = 7
cond238=>operation: config.set('bitmessagesettings', 'sockslisten', 'false') if (not config.has_option('bitmessagesettings', 'sockslisten'))
cond249=>operation: config.set('bitmessagesettings', 'userlocale', 'system') if (not config.has_option('bitmessagesettings', 'userlocale'))
cond260=>operation: config.set('bitmessagesettings', 'sendoutgoingconnections', 'True') if (not config.has_option('bitmessagesettings', 'sendoutgoingconnections'))
cond271=>operation: config.set('bitmessagesettings', 'useidenticons', 'True') if (not config.has_option('bitmessagesettings', 'useidenticons'))
cond282=>operation: config.set('bitmessagesettings', 'identiconsuffix', ''.join((helper_random.randomchoice('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz') for x in range(12)))) if (not config.has_option('bitmessagesettings', 'identiconsuffix'))
cond293=>condition: if (settingsversion == 7)
sub297=>subroutine: config.set('bitmessagesettings', 'stopresendingafterxdays', '')
sub299=>subroutine: config.set('bitmessagesettings', 'stopresendingafterxmonths', '')
op301=>operation: settingsversion = 8
cond307=>condition: if (settingsversion == 8)
sub311=>subroutine: config.set('bitmessagesettings', 'defaultnoncetrialsperbyte', str(defaults.networkDefaultProofOfWorkNonceTrialsPerByte))
sub313=>subroutine: config.set('bitmessagesettings', 'defaultpayloadlengthextrabytes', str(defaults.networkDefaultPayloadLengthExtraBytes))
op315=>operation: previousTotalDifficulty = (int(config.getint('bitmessagesettings', 'maxacceptablenoncetrialsperbyte')) / 320)
op317=>operation: previousSmallMessageDifficulty = (int(config.getint('bitmessagesettings', 'maxacceptablepayloadlengthextrabytes')) / 14000)
sub319=>subroutine: config.set('bitmessagesettings', 'maxacceptablenoncetrialsperbyte', str((previousTotalDifficulty * 1000)))
sub321=>subroutine: config.set('bitmessagesettings', 'maxacceptablepayloadlengthextrabytes', str((previousSmallMessageDifficulty * 1000)))
op323=>operation: settingsversion = 9
cond329=>condition: if (settingsversion == 9)
cond334=>operation: try:
previousTotalDifficulty = (float(config.getint(addressInKeysFile, 'noncetrialsperbyte')) / 320)
previousSmallMessageDifficulty = (float(config.getint(addressInKeysFile, 'payloadlengthextrabytes')) / 14000)
if (previousTotalDifficulty <= 2):
previousTotalDifficulty = 1
if (previousSmallMessageDifficulty < 1):
previousSmallMessageDifficulty = 1
config.set(addressInKeysFile, 'noncetrialsperbyte', str(int((previousTotalDifficulty * 1000))))
config.set(addressInKeysFile, 'payloadlengthextrabytes', str(int((previousSmallMessageDifficulty * 1000))))
except (ValueError, TypeError, configparser.NoSectionError, configparser.NoOptionError):
continue while addressInKeysFile in config.addresses()
sub346=>subroutine: config.set('bitmessagesettings', 'maxdownloadrate', '0')
sub348=>subroutine: config.set('bitmessagesettings', 'maxuploadrate', '0')
op350=>operation: settingsversion = 10
cond356=>operation: config.set('bitmessagesettings', 'maxacceptablenoncetrialsperbyte', str((defaults.ridiculousDifficulty * defaults.networkDefaultProofOfWorkNonceTrialsPerByte))) if (config.safeGetInt('bitmessagesettings', 'maxacceptablenoncetrialsperbyte') == 0)
cond367=>operation: config.set('bitmessagesettings', 'maxacceptablepayloadlengthextrabytes', str((defaults.ridiculousDifficulty * defaults.networkDefaultPayloadLengthExtraBytes))) if (config.safeGetInt('bitmessagesettings', 'maxacceptablepayloadlengthextrabytes') == 0)
cond378=>operation: config.set('bitmessagesettings', 'onionport', '8444') if (not config.has_option('bitmessagesettings', 'onionport'))
cond389=>operation: config.set('bitmessagesettings', 'onionbindip', '127.0.0.1') if (not config.has_option('bitmessagesettings', 'onionbindip'))
cond400=>operation: config.set('bitmessagesettings', 'smtpdeliver', '') if (not config.has_option('bitmessagesettings', 'smtpdeliver'))
cond411=>operation: config.set('bitmessagesettings', 'hidetrayconnectionnotifications', 'false') if (not config.has_option('bitmessagesettings', 'hidetrayconnectionnotifications'))
cond422=>condition: if (config.safeGetInt('bitmessagesettings', 'maxoutboundconnections') < 1)
sub426=>subroutine: config.set('bitmessagesettings', 'maxoutboundconnections', '8')
sub428=>subroutine: logger.warning('Your maximum outbound connections must be a number.')
cond434=>operation: config.set('bitmessagesettings', 'ttl', '367200') if (not config.has_option('bitmessagesettings', 'ttl'))
sub444=>subroutine: config.set('bitmessagesettings', 'settingsversion', str(settingsversion))
sub446=>subroutine: config.save()
e448=>end: end updateConfig
st452=>start: start adjustHalfOpenConnectionsLimit
io454=>inputoutput: input:
op457=>operation: 'Check and satisfy half-open connections limit (mainly XP and Vista)'
cond460=>condition: if (config.safeGet('bitmessagesettings', 'socksproxytype', 'none') != 'none')
op464=>operation: state.maximumNumberOfHalfOpenConnections = 4
e467=>end: end function return
op473=>operation: is_limited = False
op475=>operation: try:
if (sys.platform[0:3] == 'win'):
VER_THIS = StrictVersion(platform.version())
is_limited = ((StrictVersion('5.1.2600') <= VER_THIS) and (StrictVersion('6.0.6000') >= VER_THIS))
except ValueError:
pass
op477=>operation: state.maximumNumberOfHalfOpenConnections = (9 if is_limited else 64)
e479=>end: end adjustHalfOpenConnectionsLimit
st483=>start: start fixSocket
io485=>inputoutput: input:
op488=>operation: 'Add missing socket options and methods mainly on Windows'
cond491=>operation: socket.SO_BINDTODEVICE = 25 if sys.platform.startswith('linux')
cond502=>condition: if (not sys.platform.startswith('win'))
e507=>end: end function return
cond514=>condition: if (not hasattr(socket, 'inet_ntop'))
op518=>operation: addressToString = ctypes.windll.ws2_32.WSAAddressToStringA
st521=>start: start inet_ntop
io523=>inputoutput: input: family, host
op526=>operation: 'Converting an IP address in packed\n binary format to string format'
cond529=>condition: if (family == socket.AF_INET)
cond534=>operation: raise ValueError('invalid IPv4 host') if (len(host) != 4)
op544=>operation: host = pack('hH4s8s', socket.AF_INET, 0, host, ('\x00' * 8))
op572=>operation: buf = ('\x00' * 64)
op574=>operation: lengthBuf = pack('I', len(buf))
sub576=>subroutine: addressToString(host, len(host), None, buf, lengthBuf)
io581=>inputoutput: output: buf[0:buf.index('\x00')]
e579=>end: end function return
cond549=>condition: if (family == socket.AF_INET6)
cond554=>operation: raise ValueError('invalid IPv6 host') if (len(host) != 16)
op564=>operation: host = pack('hHL16sL', socket.AF_INET6, 0, 0, host, 0)
op568=>operation: raise ValueError('invalid address family')
cond593=>condition: if (not hasattr(socket, 'inet_pton'))
op597=>operation: stringToAddress = ctypes.windll.ws2_32.WSAStringToAddressA
st600=>start: start inet_pton
io602=>inputoutput: input: family, host
op605=>operation: 'Converting an IP address in string format\n to a packed binary format'
op607=>operation: buf = ('\x00' * 28)
op609=>operation: lengthBuf = pack('I', len(buf))
cond612=>operation: raise socket.error('illegal IP address passed to inet_pton') if (stringToAddress(str(host), int(family), None, buf, lengthBuf) != 0)
cond623=>condition: if (family == socket.AF_INET)
io630=>inputoutput: output: buf[4:8]
e628=>end: end function return
cond636=>condition: if (family == socket.AF_INET6)
io643=>inputoutput: output: buf[8:24]
e641=>end: end function return
op648=>operation: raise ValueError('invalid address family')
e652=>end: end inet_pton
op655=>operation: socket.inet_pton = inet_pton
cond661=>operation: socket.IPPROTO_IPV6 = 41 if (not hasattr(socket, 'IPPROTO_IPV6'))
cond672=>operation: socket.IPV6_V6ONLY = 27 if (not hasattr(socket, 'IPV6_V6ONLY'))
e682=>end: end fixSocket
st686=>start: start start_proxyconfig
io688=>inputoutput: input:
op691=>operation: 'Check socksproxytype and start any proxy configuration plugin'
cond694=>condition: if (not get_plugin)
e699=>end: end function return
sub705=>subroutine: config_ready.wait()
op707=>operation: proxy_type = config.safeGet('bitmessagesettings', 'socksproxytype')
cond710=>operation: try:
proxyconfig_start = time.time()
if (not get_plugin('proxyconfig', name=proxy_type)(config)):
raise TypeError()
except TypeError:
logger.error('Failed to run proxy config plugin %s', proxy_type, exc_info=True)
config.setTemp('bitmessagesettings', 'dontconnect', 'true')
else:
logger.info('Started proxy config plugin %s in %s sec', proxy_type, (time.time() - proxyconfig_start)) if (proxy_type and (proxy_type not in ('none', 'SOCKS4a', 'SOCKS5')))
e720=>end: end start_proxyconfig
cond209=>condition: if (settingsversion == 4)
sub213=>subroutine: config.set('bitmessagesettings', 'defaultnoncetrialsperbyte', str(defaults.networkDefaultProofOfWorkNonceTrialsPerByte))
sub215=>subroutine: config.set('bitmessagesettings', 'defaultpayloadlengthextrabytes', str(defaults.networkDefaultPayloadLengthExtraBytes))
op217=>operation: settingsversion = 5
sub134=>subroutine: logger.info('Creating new config files in %s', state.appdata)
cond137=>operation: os.makedirs(state.appdata) if (not os.path.exists(state.appdata))
sub114=>subroutine: config.set('bitmessagesettings', 'minimizetotray', 'true')
sub163=>subroutine: updateConfig()
sub62=>subroutine: config.read((paths.lookupExeFolder() + 'keys.dat'))
cond65=>condition: if config.safeGet('bitmessagesettings', 'settingsversion')
sub69=>subroutine: logger.info('Loading config files from same directory as program.')
op71=>operation: needToCreateKeysFile = False
op73=>operation: state.appdata = paths.lookupExeFolder()
op77=>operation: state.appdata = paths.lookupAppdataFolder()
sub79=>subroutine: config.read((state.appdata + 'keys.dat'))
op81=>operation: needToCreateKeysFile = (config.safeGet('bitmessagesettings', 'settingsversion') is None)
cond84=>operation: logger.info('Loading existing config files from %s', state.appdata) if (not needToCreateKeysFile)
op2->op4
op4->op6
op6->op8
op8->op10
op10->op12
op12->op14
op14->op16
op16->op18
op18->op20
op20->op22
op22->op24
op24->op26
op26->op28
op28->op30
op30->st33
st33->io35
io35->op38
op38->cond41
cond41(yes)->sub45
sub45->op47
op47->cond50
cond50->cond97
cond97(yes)->sub101
sub101->sub103
sub103->cond106
cond106(yes)->sub110
sub110->sub117
sub117->sub119
sub119->sub121
sub121->cond124
cond124(yes)->op128
op128->sub130
sub130->cond149
cond149->sub159
sub159->sub166
sub166->e168
e168->st172
st172->io174
io174->op177
op177->op179
op179->cond182
cond182(yes)->sub186
sub186->sub188
sub188->sub190
sub190->sub192
sub192->sub194
sub194->sub196
sub196->sub198
sub198->sub200
sub200->sub202
sub202->op204
op204->cond224
cond224(yes)->sub228
sub228->sub230
sub230->op232
op232->cond238
cond238->cond249
cond249->cond260
cond260->cond271
cond271->cond282
cond282->cond293
cond293(yes)->sub297
sub297->sub299
sub299->op301
op301->cond307
cond307(yes)->sub311
sub311->sub313
sub313->op315
op315->op317
op317->sub319
sub319->sub321
sub321->op323
op323->cond329
cond329(yes)->cond334
cond334->sub346
sub346->sub348
sub348->op350
op350->cond356
cond356->cond367
cond367->cond378
cond378->cond389
cond389->cond400
cond400->cond411
cond411->cond422
cond422(yes)->sub426
sub426->sub428
sub428->cond434
cond434->sub444
sub444->sub446
sub446->e448
e448->st452
st452->io454
io454->op457
op457->cond460
cond460(yes)->op464
op464->e467
cond460(no)->op473
op473->op475
op475->op477
op477->e479
e479->st483
st483->io485
io485->op488
op488->cond491
cond491->cond502
cond502(yes)->e507
cond502(no)->cond514
cond514(yes)->op518
op518->st521
st521->io523
io523->op526
op526->cond529
cond529(yes)->cond534
cond534->op544
op544->op572
op572->op574
op574->sub576
sub576->io581
io581->e579
cond529(no)->cond549
cond549(yes)->cond554
cond554->op564
op564->op572
cond549(no)->op568
op568->op572
cond514(no)->cond593
cond593(yes)->op597
op597->st600
st600->io602
io602->op605
op605->op607
op607->op609
op609->cond612
cond612->cond623
cond623(yes)->io630
io630->e628
cond623(no)->cond636
cond636(yes)->io643
io643->e641
cond636(no)->op648
op648->e652
e652->op655
op655->cond661
cond661->cond672
cond672->e682
e682->st686
st686->io688
io688->op691
op691->cond694
cond694(yes)->e699
cond694(no)->sub705
sub705->op707
op707->cond710
cond710->e720
cond593(no)->cond661
cond422(no)->cond434
cond329(no)->cond356
cond307(no)->cond329
cond293(no)->cond307
cond224(no)->cond238
cond182(no)->cond209
cond209(yes)->sub213
sub213->sub215
sub215->op217
op217->cond224
cond209(no)->cond224
cond124(no)->sub134
sub134->cond137
cond137->cond149
cond106(no)->sub114
sub114->sub117
cond97(no)->sub163
sub163->sub166
cond41(no)->sub62
sub62->cond65
cond65(yes)->sub69
sub69->op71
op71->op73
op73->cond97
cond65(no)->op77
op77->sub79
sub79->op81
op81->cond84
cond84->cond97
</textarea></div>
<div><button id="run" type="button">Run</button> <button onclick="HelpText()">Format Help</button></div>
<div id="HelpTextBlock" style="display:none"><br/>Conditions can also be redirected like cond(yes, bottom) or cond(yes, right)
... and the other symbols too... like sub1(right)<br/>
You can also tweak the <b>diagram.drawSVG('diagram', {});</b> script in this file for more changes<br/>
This is based on <a href="https://github.com/adrai/flowchart.js">flowchart.js on github</a> and <a href="http://flowchart.js.org">http://flowchart.js.org</a> more documentation can be found over there.
</div><br/><div id="svgbase64"></div>
<div id="pngbase64"></div>
<div id="canvas"></div>
</body>
</html>