/
dmCommands.dfm
5209 lines (5098 loc) · 244 KB
/
dmCommands.dfm
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
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
object CommandsDataModule: TCommandsDataModule
OldCreateOrder = False
OnCreate = DataModuleCreate
OnDestroy = DataModuleDestroy
Height = 392
Width = 675
object SynEditPrint: TSynEditPrint
Copies = 1
Header.DefaultFont.Charset = DEFAULT_CHARSET
Header.DefaultFont.Color = clBlack
Header.DefaultFont.Height = -13
Header.DefaultFont.Name = 'Arial'
Header.DefaultFont.Style = []
Footer.DefaultFont.Charset = DEFAULT_CHARSET
Footer.DefaultFont.Color = clBlack
Footer.DefaultFont.Height = -13
Footer.DefaultFont.Name = 'Arial'
Footer.DefaultFont.Style = []
Margins.Left = 25.000000000000000000
Margins.Right = 15.000000000000000000
Margins.Top = 25.000000000000000000
Margins.Bottom = 25.000000000000000000
Margins.Header = 18.000000000000000000
Margins.Footer = 18.000000000000000000
Margins.LeftHFTextIndent = 2.000000000000000000
Margins.RightHFTextIndent = 2.000000000000000000
Margins.HFInternalMargin = 0.500000000000000000
Margins.MirrorMargins = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
TabWidth = 8
Color = clWhite
Left = 188
Top = 68
end
object PrintDialog: TPrintDialog
MaxPage = 10000
Options = [poPageNums]
Left = 187
Top = 22
end
object PrinterSetupDialog: TPrinterSetupDialog
Left = 100
Top = 68
end
object ParameterCompletion: TSynCompletionProposal
Options = [scoLimitToMatchedText, scoUseInsertList, scoUsePrettyText, scoCompleteWithTab, scoCompleteWithEnter]
Width = 350
EndOfTokenChr = '()[]. '
TriggerChars = '.'
Title = 'Parameters'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = []
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clBtnText
TitleFont.Height = -11
TitleFont.Name = 'MS Shell Dlg 2'
TitleFont.Style = [fsBold]
Columns = <
item
ColumnWidth = 120
DefaultFontStyle = [fsBold]
end
item
ColumnWidth = 230
end>
Resizeable = True
OnExecute = ParameterCompletionExecute
ShortCut = 24656
OnCodeCompletion = ParameterCompletionCodeCompletion
Left = 335
Top = 20
end
object ModifierCompletion: TSynCompletionProposal
Options = [scoLimitToMatchedText, scoUseInsertList, scoUsePrettyText, scoCompleteWithTab, scoCompleteWithEnter]
Width = 400
EndOfTokenChr = '()[].- '
TriggerChars = '.'
Title = 'Modifiers'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clBtnText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = [fsBold]
Columns = <
item
ColumnWidth = 120
DefaultFontStyle = [fsBold]
end
item
ColumnWidth = 280
end>
Resizeable = True
OnExecute = ModifierCompletionExecute
ShortCut = 24653
OnCodeCompletion = ModifierCompletionCodeCompletion
Left = 335
Top = 66
end
object CodeTemplatesCompletion: TSynAutoComplete
AutoCompleteList.Strings = (
'hdr'
'|Python Module header'
'=#--------------------------------------------------------------' +
'-----------------'
'=# Name: $[ActiveDoc-Name]'
'=# Purpose: |'
'=#'
'=# Author: $[UserName]'
'=#'
'=# Created: $[DateTime-'#39'DD/MM/YYYY'#39'-DateFormat]'
'=# Copyright: (c) $[UserName] $[DateTime-'#39'YYYY'#39'-DateFormat]'
'=# Licence: <your licence>'
'=#--------------------------------------------------------------' +
'-----------------'
'cl'
'|Comment Line'
'=#--------------------------------------------------------------' +
'-----------------'
'=|'
'pyapp'
'|Python application'
'=def main():'
'= |pass'
'='
'=if __name__ == '#39'__main__'#39':'
'= main()'
'cls'
'|Python class'
'=class |(object):'
'= """'
'='#9#9'class comment'
'= """'
'='
'= def __init__(self):'
'= pass'
'fec'
'|File encoding comment'
'=# -*- coding: UTF-8 -*-'
'=|'
'she'
'|Sheband'
'=#!/usr/bin/env python$[($[PythonVersion]>='#39'3.0'#39')'#39'3'#39':'#39#39']'
'=|')
EndOfTokenChr = '()[]. '
ShortCut = 0
Options = [scoLimitToMatchedText, scoUseInsertList, scoCompleteWithTab, scoCompleteWithEnter]
Left = 335
Top = 108
end
object ShellImages: TImageList
DrawingStyle = dsTransparent
ShareImages = True
Left = 32
Top = 208
end
object SynEditSearch: TSynEditSearch
Left = 195
Top = 123
end
object SynEditRegexSearch: TSynEditRegexSearch
Left = 105
Top = 124
end
object ProgramVersionCheck: TJvProgramVersionCheck
AllowedReleaseType = prtAlpha
AppStoragePath = 'Check for Updates'
CheckFrequency = 0
LocalDirectory = 'Updates'
LocalVersionInfoFileName = 'versioninfo.ini'
LocationHTTP = ProgramVersionHTTPLocation
LocationType = pvltHTTP
UserOptions = [uoCheckFrequency, uoLocalDirectory, uoAllowedReleaseType, uoLocationHTTP]
VersionHistoryFileOptions.INIOptions.BooleanStringTrueValues = 'TRUE, YES, Y'
VersionHistoryFileOptions.INIOptions.BooleanStringFalseValues = 'FALSE, NO, N'
VersionHistoryFileOptions.INIOptions.SetAsString = True
VersionHistoryFileOptions.INIOptions.FloatAsString = True
VersionHistoryFileOptions.INIOptions.DefaultIfReadConvertError = True
VersionHistoryFileOptions.XMLOptions.BooleanStringTrueValues = 'TRUE, YES, Y'
VersionHistoryFileOptions.XMLOptions.BooleanStringFalseValues = 'FALSE, NO, N'
VersionHistoryFileOptions.XMLOptions.SetAsString = True
VersionHistoryFileOptions.XMLOptions.FloatAsString = True
VersionHistoryFileOptions.XMLOptions.DefaultIfReadConvertError = True
VersionHistoryFileOptions.XMLOptions.UseOldItemNameFormat = False
VersionHistoryFileOptions.XMLOptions.WhiteSpaceReplacement = '_'
VersionHistoryFileOptions.XMLOptions.InvalidCharReplacement = '_'
Left = 435
Top = 183
end
object ProgramVersionHTTPLocation: TJvProgramVersionHTTPLocation
OnLoadFileFromRemote = ProgramVersionHTTPLocationLoadFileFromRemote
VersionInfoLocationPathList.Strings = (
'https://raw.githubusercontent.com/pyscripter/pyscripter/master')
VersionInfoFileName = 'PyScripterVersionInfo.ini'
Left = 566
Top = 184
end
object SynIniSyn: TSynIniSyn
Options.AutoDetectEnabled = False
Options.AutoDetectLineLimit = 0
Options.Visible = False
Left = 344
Top = 324
end
object JvMultiStringHolder: TJvMultiStringHolder
MultipleStrings = <
item
Name = 'InitScript'
Strings.Strings = (
'import sys'
'import code'
''
'class PythonInteractiveInterpreter(code.InteractiveInterpreter):'
' debugIDE = __import__("DebugIDE")'
''
' class IDEDebugger(__import__('#39'bdb'#39').Bdb):'
' debugIDE = __import__("DebugIDE")'
''
' def do_clear(self, arg):'
' numberlist = arg.split()'
' for i in numberlist:'
' self.clear_bpbynumber(i)'
''
' def stop_here(self, frame):'
' import bdb'
' if not self.InitStepIn:'
' self.InitStepIn = True'
' self.set_continue()'
' return 0'
' return bdb.Bdb.stop_here(self, frame)'
''
' def user_call(self, frame, args):'
' self.debugIDE.user_call(frame, args)'
''
' def user_line(self, frame):'
' self.debugIDE.user_line(frame)'
''
' def user_exception(self, frame, exc_stuff):'
' self.debugIDE.user_exception(frame, exc_stuff)'
''
' def trace_dispatch(self, frame, event, arg):'
' self.tracecount += 1'
' if self.tracecount == 30: #yield processing every 3' +
'0 steps'
' self.tracecount = 0'
' self.debugIDE.user_yield()'
' if self.quitting: raise __import__('#39'bdb'#39').BdbQui' +
't'
' return __import__('#39'bdb'#39').Bdb.trace_dispatch(self, fr' +
'ame, event, arg)'
''
' def run(self, cmd, globals=None, locals=None):'
' import bdb'
' import sys'
' import types'
''
' if globals is None:'
' globals = self.locals'
''
' self.saveStdio = (sys.stdin, sys.stdout, sys.stderr)'
''
' if locals is None:'
' locals = globals'
''
' globals["__name__"] = '#39'__main__'#39
' if isinstance(cmd, types.CodeType):'
' globals["__file__"] = cmd.co_filename'
' else:'
' cmd = cmd+'#39'\n'#39
''
' try:'
' try:'
' bdb.Bdb.run(self, cmd, globals, locals)'
' except SystemExit as e:'
' if isinstance(e.code, str):'
' print(e.code)'
' elif isinstance(e.code, int):'
' print("Exit code: ", e.code)'
' finally:'
' sys.stdin, sys.stdout, sys.stderr = self.saveStd' +
'io'
' if '#39'__file__'#39' in globals:'
' del globals['#39'__file__'#39']'
' __import__("gc").collect()'
''
' class IDETestResult(__import__('#39'unittest'#39').TestResult):'
' debugIDE = __import__("DebugIDE")'
''
' def startTest(self, test):'
' __import__('#39'unittest'#39').TestResult.startTest(self, te' +
'st)'
' self.debugIDE.testResultStartTest(test)'
''
' def stopTest(self, test):'
' __import__('#39'unittest'#39').TestResult.stopTest(self, tes' +
't)'
' self.debugIDE.testResultStopTest(test)'
''
' def addError(self, test, err):'
' __import__('#39'unittest'#39').TestResult.addError(self, tes' +
't, err)'
' self.debugIDE.testResultAddError(test, self._exc_inf' +
'o_to_string(err, test))'
''
' def addFailure(self, test, err):'
' __import__('#39'unittest'#39').TestResult.addFailure(self, t' +
'est, err)'
' self.debugIDE.testResultAddFailure(test, self._exc_i' +
'nfo_to_string(err, test))'
''
' def addSuccess(self, test):'
' self.debugIDE.testResultAddSuccess(test)'
' __import__('#39'unittest'#39').TestResult.addSuccess(self, t' +
'est)'
''
' def __init__(self, locals = None):'
' code.InteractiveInterpreter.__init__(self, locals)'
' self.locals["__name__"] = "__main__"'
''
' self.debugger = self.IDEDebugger()'
' self.debugger.InitStepIn = False'
' self.debugger.tracecount = 0'
' self.debugger.currentframe = None'
' self.debugger.locals = self.locals'
''
' try:'
' pyrepr = __import__('#39'repr'#39').Repr()'
' except:'
' pyrepr = __import__('#39'reprlib'#39').Repr()'
' pyrepr.maxstring = 60'
' pyrepr.maxother = 60'
' self._repr = pyrepr.repr'
''
' self.commontypes = frozenset(['
' '#39'NoneType'#39','
' '#39'NotImplementedType'#39','
' '#39'bool'#39','
' '#39'buffer'#39','
' '#39'builtin_function_or_method'#39','
' '#39'code'#39','
' '#39'complex'#39','
' '#39'dict'#39','
' '#39'dictproxy'#39','
' '#39'ellipsis'#39','
' '#39'file'#39','
' '#39'float'#39','
' '#39'frame'#39','
' '#39'function'#39','
' '#39'generator'#39','
' '#39'getset_descriptor'#39','
' '#39'instancemethod'#39','
' '#39'int'#39','
' '#39'list'#39','
' '#39'long'#39','
' '#39'member_descriptor'#39','
' '#39'method-wrapper'#39','
' '#39'object'#39','
' '#39'slice'#39','
' '#39'str'#39','
' '#39'traceback'#39','
' '#39'tuple'#39','
' '#39'unicode'#39','
' '#39'xrange'#39'])'
''
' def _import(self, name, code):'
' import imp'
' import sys'
' mod = imp.new_module(name)'
' mod.__file__ = code.co_filename'
''
' try:'
' exec(code, mod.__dict__)'
' sys.modules[name] = mod'
' return mod'
' except SystemExit:'
' pass'
''
' def run_nodebug(self, cmd, globals=None, locals=None):'
' import types'
' import sys'
''
' if globals is None:'
' globals = self.locals'
''
' self.saveStdio = (sys.stdin, sys.stdout, sys.stderr)'
''
' if locals is None:'
' locals = globals'
''
' globals["__name__"] = '#39'__main__'#39
' if isinstance(cmd, types.CodeType):'
' globals["__file__"] = cmd.co_filename'
' else:'
' cmd = cmd+'#39'\n'#39
''
' try:'
' try:'
' exec(cmd, globals, locals)'
' except SystemExit as e:'
' if isinstance(e.code, str):'
' print(e.code)'
' elif isinstance(e.code, int):'
' print("Exit code: ", e.code)'
' finally:'
' sys.stdin, sys.stdout, sys.stderr = self.saveStdio'
' if '#39'__file__'#39' in globals:'
' del globals['#39'__file__'#39']'
' __import__("gc").collect()'
''
' def objecttype(self, ob):'
' try:'
' try:'
' return ob.__class__.__name__'
' except:'
' return type(ob).__name__'
' except:'
' return "Unknown type"'
''
' def objectinfo(self, ob):'
' res = 1'
' try:'
' import inspect'
' if hasattr(ob, "__dict__") and isinstance(ob.__dict_' +
'_, dict):'
' res = res | 2'
' if inspect.ismodule(ob):'
' res = res | 4'
' elif inspect.ismethod(ob) or inspect.ismethoddescrip' +
'tor(ob):'
' res = res | 8'
' elif inspect.isfunction(ob) or inspect.isbuiltin(ob)' +
':'
' res = res | 16'
' elif inspect.isclass(ob):'
' res = res | 32'
' elif isinstance(ob, dict):'
' res = res | 64'
' return res'
' except:'
' return res'
''
' def saferepr(self, x):'
' try:'
' return self._repr(x)'
' except:'
' return '#39'<unprintable %s object>'#39' % type(x).__name__'
''
' def membercount(self, ob, dictitems = False, expandcommontyp' +
'es = True, sequenceitems = False):'
' # dictitems will be True when used in the Variables win' +
'dow'
' # expandcommontypes will be False when used in the Vari' +
'ables window'
' try:'
' if sequenceitems and isinstance(ob, (list, tuple)):'
' return len(ob)'
' elif dictitems and isinstance(ob, dict):'
' return len(ob)'
' elif not expandcommontypes and (self.objecttype(ob) ' +
'in self.commontypes):'
' return 0'
' else:'
' return len(set(dir(ob)))'
' except:'
' return 0'
''
' def _getmembers(self, ob, dictitems = False, expandcommontyp' +
'es = True, sequenceitems = False):'
' result = {}'
' if sequenceitems and isinstance(ob, (list, tuple)):'
' for i in range(len(ob)):'
' result[str(i)] = ob[i]'
' elif dictitems and isinstance(ob, dict):'
' for (i,j) in ob.items():'
' result[self.safestr(i)] = j'
' elif not expandcommontypes and (self.objecttype(ob) in s' +
'elf.commontypes):'
' pass'
' else:'
' for i in dir(ob):'
' try :'
' result[self.safestr(i)] = getattr(ob, i)'
' except:'
' result[self.safestr(i)] = None'
' return result'
''
' def safegetmembers(self, ob, dictitems = False, expandcommon' +
'types = True, sequenceitems = False):'
' try:'
' return self._getmembers(ob, dictitems, expandcommont' +
'ypes, sequenceitems)'
' except:'
' return {}'
''
' def safegetmembersfullinfo(self, ob, dictitems = False, expa' +
'ndcommontypes = True, sequenceitems = False):'
' try:'
' members = self._getmembers(ob, dictitems, expandcomm' +
'ontypes, sequenceitems)'
' d = {}'
' for (i,j) in members.items():'
' d[i] = (j, self.objecttype(j), self.objectinfo(j' +
'))'
' if sequenceitems and isinstance(ob, (list, tuple)):'
' return tuple(sorted(d.items(), key = lambda r: i' +
'nt(r[0])))'
' else:'
' return tuple(d.items())'
' except:'
' return ()'
''
' def safestr(self, value):'
' try:'
' return str(value)'
' except:'
' return self.saferepr(value)'
''
' def find_dotted_module(self, name, path=None):'
' import imp'
' segs = name.split('#39'.'#39')'
' file = None'
' while segs:'
' if file: file.close()'
' file, filename, desc = imp.find_module(segs[0], path' +
')'
' del segs[0]'
' path = [filename]'
' return file, filename, desc'
''
''
' def findModuleOrPackage(self, modName, path=None):'
' if path is None:'
' import sys'
' path = sys.path'
' try:'
' f, filename, (ext, mode, type) = self.find_dotted_m' +
'odule(modName, path)'
' except ImportError as err:'
' return None'
''
' if f is not None:'
' f.close()'
' if filename:'
' import imp, os'
' if type == imp.PKG_DIRECTORY:'
' return os.path.join(filename, '#39'__init__.py'#39')'
' elif type in (imp.PY_SOURCE, imp.C_EXTENSION):'
' return filename'
''
' def getmodules(self, path=None):'
' import sys'
' try:'
' import pkgutil'
' l = [i[1] for i in pkgutil.iter_modules(path)]'
' except:'
' l = []'
' if path is None:'
' l.extend(sys.builtin_module_names)'
' return l'
''
' def runcode(self, code):'
' import sys'
' self.saveStdio = (sys.stdin, sys.stdout, sys.stderr)'
' try:'
' if self.debugger.currentframe:'
' exec(code, self.debugger.currentframe.f_globals,' +
' self.debugger.currentframe.f_locals)'
' # save locals'
' try:'
' import ctypes'
' ctypes.pythonapi.PyFrame_LocalsToFast(ctypes' +
'.py_object(self.debugger.currentframe), 0)'
' except :'
' pass'
' else:'
' exec(code, self.locals)'
' except SystemExit as e:'
' if isinstance(e.code, str):'
' print(e.code)'
' elif isinstance(e.code, int):'
' print("Exit code: ", e.code)'
' except:'
' self.showtraceback()'
' sys.stdin, sys.stdout, sys.stderr = self.saveStdio'
''
' def evalcode(self, code):'
' # may raise exceptions'
' try:'
' if self.debugger.currentframe:'
' return eval(code, self.debugger.currentframe.f_g' +
'lobals, self.debugger.currentframe.f_locals)'
' else:'
' return eval(code, self.locals)'
' except SystemExit:'
' return None'
''
' def get_arg_text(self, ob):'
' "Get a string describing the arguments for the given obj' +
'ect - From IDLE"'
' import types'
' from inspect import isclass, isroutine, signature, getdo' +
'c'
' argText = ""'
' if ob is not None:'
' argOffset = 0'
' if isclass(ob) and (ob.__module__ != '#39'builtins'#39'):'
' # Look for the highest __init__ in the class cha' +
'in.'
' fob = getattr(ob, '#39'__init__'#39', ob)'
' argOffset = 1'
' elif type(ob)==types.MethodType:'
' # bit of a hack for methods - turn it into a fun' +
'ction'
' # but we drop the "self" param.'
' fob = ob.__func__'
' argOffset = 1'
' else:'
' fob = ob'
' # Try and build one for Python defined functions'
' if isroutine(fob):'
' try:'
' argText = str(signature(fob))[1:]'
' idx = argText.rfind(") ->")'
' if idx < 0:'
' idx = argText.rfind(")")'
' argText = argText[0:idx]'
' except:'
' pass'
' return (argText, getdoc(fob))'
''
' def Win32RawInput(self, prompt=None):'
' "Provide raw_input() for gui apps"'
' # flush stderr/out first.'
' debugIDE = __import__("DebugIDE")'
' import sys'
' try:'
' sys.stdout.flush()'
' sys.stderr.flush()'
' except:'
' pass'
' if prompt is None:'
' prompt = ""'
' else:'
' sys.stdout.write(prompt)'
' sys.stdout.flush'
' ret = debugIDE.InputBox('#39'Python input'#39', str(prompt),"")'
' if ret is not None:'
' sys.stdout.write(ret)'
' sys.stdout.write("\n")'
' sys.stdout.flush'
' if ret is None:'
' raise KeyboardInterrupt("Operation cancelled")'
' return ret'
''
' def setupdisplayhook(self):'
' import sys, pprint, builtins'
' def pphook(value, show=pprint.pprint, bltin=builtins):'
' if value is not None:'
' bltin._ = value'
' show(value)'
' sys.displayhook = pphook'
''
' def system_command(self, cmd):'
' import subprocess'
' process = subprocess.Popen(cmd, stdout=subprocess.PIPE, ' +
'shell=True)'
' print(process.communicate()[0].decode())'
' if process.returncode != 0:'
' print('#39'Error code: '#39', process.returncode)'
''
'_II = PythonInteractiveInterpreter(globals())'
''
'sys.modules['#39'builtins'#39'].input=_II.Win32RawInput'
''
'import os'
'try:'
' sys.path.remove(os.path.dirname(sys.executable))'
' sys.path.remove(os.path.dirname(sys.executable))'
'except:'
' pass'
'sys.path.insert(0, "")'
''
'import warnings'
'warnings.simplefilter("ignore", DeprecationWarning)'
''
'del DebugOutput'
'del code'
'del PythonInteractiveInterpreter'
'del sys'
'del os'
'del warnings')
end
item
Name = 'RpyC_Init'
Strings.Strings = (
'import sys'
'import code'
'import threading'
'import logging'
''
'##logging.basicConfig(level=logging.DEBUG,'
'## filename = "c:/users/kiriakos/desktop/test' +
'.log",'
'## filemode = "a",'
'## format='#39'(%(threadName)-10s) %(message)s'#39')'
''
'class RemotePythonInterpreter(code.InteractiveInterpreter):'
' class DebugManager:'
' # Debugger commands'
' dcNone, dcRun, dcStepInto, dcStepOver, dcStepOut, dcRunT' +
'oCursor, dcPause, dcAbort = range(8)'
' debug_command = dcNone'
''
' _threading = threading'
' # IDE synchronization lock'
' user_lock = threading.Lock()'
''
' # Thread status'
' thrdRunning, thrdBroken, thrdFinished = range(3)'
' main_thread_id = threading.current_thread().ident'
''
' # module for communication with the IDE'
' debugIDE = None #will be set to P4D module'
''
' # shared debugger breakpoints'
' breakpoints = {}'
''
' # main debugger will be set below'
' main_debugger = None'
''
' #active debugger objects'
' active_thread = active_frame = None'
''
' #sleep function'
' import time'
' _sleep = time.sleep'
''
' @classmethod'
' def thread_status(cls, ident, name, status):'
' with cls.user_lock:'
' cls.debugIDE.user_thread(ident, name, status)'
''
' class ThreadWrapper(threading.Thread):'
' """ Wrapper class for threading.Thread. """'
' def _bootstrap(self):'
' self._set_ident()'
' self.debug_manager.thread_status(self.ident, self.na' +
'me, self.debug_manager.thrdRunning)'
''
' self.debugger = self.debug_manager.main_debugger.__c' +
'lass__()'
' self.debugger.reset()'
' self.debugger._sys.settrace(self.debugger.trace_disp' +
'atch)'
''
' try:'
' self._bootstrap_inner()'
' finally:'
' self.debugger._sys.settrace(None)'
' self.debug_manager.thread_status(self.ident, sel' +
'f.name, self.debug_manager.thrdFinished)'
' self.debugger = None'
' ThreadWrapper.debug_manager = DebugManager'
''
' class IDEDebugger(__import__('#39'bdb'#39').Bdb):'
' def __init__(self):'
' super().__init__()'
' self.locals = globals()'
' self.breaks = self.debug_manager.breakpoints'
' self.InitStepIn = False'
' self.tracecount = 0'
' self._sys = __import__("sys")'
''
' def showtraceback(self):'
' """Display the exception that just occurred.'
' We remove the first two stack items because it is ou' +
'r own code.'
' """'
' import sys, traceback'
' try:'
' sys.last_type, sys.last_value, last_tb = ei = sy' +
's.exc_info()'
' tblist = traceback.extract_tb(ei[2])'
' del tblist[:2]'
' lines = traceback.format_list(tblist)'
' if lines:'
' lines.insert(0, "Traceback (most recent call' +
' last):\n")'
' lines.extend(traceback.format_exception_only(ei[' +
'0], ei[1]))'
' finally:'
' tblist = tb = None'
' sys.stderr.write('#39#39'.join(lines))'
''
' def do_clear(self, arg):'
' numberlist = arg.split()'
' for i in numberlist:'
' self.clear_bpbynumber(i)'
''
' def stop_here(self, frame):'
' if not self.InitStepIn:'
' self.InitStepIn = True'
' self.set_continue()'
' return 0'
' return super().stop_here(frame)'
''
' def user_line(self, frame):'
' dbg_manager = self.debug_manager'
' thread_id = dbg_manager._threading.current_thread().' +
'ident'
''
' with dbg_manager.user_lock:'
' if not dbg_manager.debugIDE.user_line(thread_id,' +
' frame, self.botframe):'
' self.set_return(frame)'
' return'
''
' dbg_manager.debug_command = dbg_manager.dcNone'
' conn = object.__getattribute__(dbg_manager.debugIDE,' +
' "____conn__")'
''
' while (((thread_id != dbg_manager.active_thread) or'
' (dbg_manager.debug_command == dbg_manager.dc' +
'None)) and'
' (dbg_manager.debug_command != dbg_manager.dc' +
'Run)):'
' with dbg_manager.user_lock:'
' conn.poll_all(0.01)'
' if thread_id != dbg_manager.active_thread:'
' dbg_manager._sleep(0.1)'
''
' if dbg_manager.debug_command == dbg_manager.dcRun:'
' self.set_continue()'
' elif dbg_manager.debug_command == dbg_manager.dcStep' +
'Into:'
' self.set_step()'
' elif dbg_manager.debug_command == dbg_manager.dcStep' +
'Over:'
' self.set_next(frame)'
' elif dbg_manager.debug_command == dbg_manager.dcStep' +
'Out:'
' self.set_return(frame)'
' elif dbg_manager.debug_command == dbg_manager.dcRunT' +
'oCursor:'
' self.set_continue()'
' elif dbg_manager.debug_command == dbg_manager.dcPaus' +
'e:'
' self.set_step()'
' elif dbg_manager.debug_command == dbg_manager.dcAbor' +
't:'
' self.set_quit()'
''
' if dbg_manager.debug_command != dbg_manager.dcRun:'
' dbg_manager.debug_command = dbg_manager.dcNone'
' dbg_manager.thread_status(thread_id, "", dbg_manager' +
'.thrdRunning)'
''
' def dispatch_call(self, frame, arg):'
' self.tracecount += 1'
' #check for Pause'
' if self.tracecount > 20000:'
' self.tracecount = 0'
' with self.debug_manager.user_lock:'
' cmd = self.debug_manager.debugIDE.user_yield' +
'()'
' if cmd == self.debug_manager.dcPause:'
' self.set_step()'
' return self.trace_dispatch'
''
' res = super().dispatch_call(frame, arg)'
' if res:'
' if not frame.f_globals.get('#39'__traceable__'#39', True' +
'):'
' return'
' #logging.debug("dispatch_call " + frame.f_code.c' +
'o_filename + " " + frame.f_code.co_name)'
' return res'
''
'## def trace_dispatch(self, frame, event, arg):'
'## logging.debug(frame.f_code.co_filename + " " + eve' +
'nt+ " " + frame.f_code.co_name)'
'## return super().trace_dispatch(frame, event, arg)'
''
' def run(self, cmd, globals=None, locals=None):'
' import bdb'
' import types'
' import sys'
' import threading'
''
' if globals is None:'
' globals = self.locals'
''
' saveStdio = (sys.stdin, sys.stdout, sys.stderr)'
''
' if locals is None:'
' locals = globals'
''
' globals["__name__"] = '#39'__main__'#39
' if isinstance(cmd, types.CodeType):'
' globals["__file__"] = cmd.co_filename'
' else:'
' cmd = cmd+'#39'\n'#39
''
' old_thread_class = threading.Thread'
' threading.Thread = self.thread_wrapper'
''
' self.exc_info = None'
' try:'
' try:'
' bdb.Bdb.run(self, cmd, globals, locals)'
' except SystemExit as e:'
' if isinstance(e.code, str):'
' print(e.code)'
' elif isinstance(e.code, int):'
' print("Exit code: ", e.code)'
' except:'
' self.showtraceback()'
' exc_info = sys.exc_info()'
' if hasattr(exc_info[0], "__name__"):'
' name = exc_info[0].__name__'
' elif type(exc_info[0]) == str:'
' name = exc_info[0]'
' else:'
' name = ""'