-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
1209 lines (1050 loc) · 49.2 KB
/
setup.py
File metadata and controls
1209 lines (1050 loc) · 49.2 KB
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
import pygame,time
import sys,platform
from pygame.locals import *
from button import Button
from PIL import Image, ImageSequence
import pygame.image
import os
pygame.init()
pygame.display.set_caption("PythonOS 安装程序")
vm_info="Pyvm1.1"
booter="Py legends"
os_name = platform.system()
os_version = platform.version()
cpu_info = platform.processor()
ram_info = platform.machine()
WIDTH=1000
HEIGHT=562
bg_install=pygame.image.load("./running logo/background.png")
is_white=False
if is_white==False:
bg=pygame.image.load("./images/background_black.png")
python_os = pygame.image.load('./images/pythonos_white.png')
python_os_rect = python_os.get_rect()
pylegends=pygame.image.load("./images/pylegends2.png")
pylegends_rect=pylegends.get_rect()
pylegends_rect.topleft=(WIDTH/10,HEIGHT/10)
font = pygame.font.Font("./font/font.ttf", 10)
#this is the startup screen
startup=True
os = font.render("vm os:"+str(os_name), True, (255, 255, 255))
os_rect=os.get_rect()
os_rect.topleft=(7,100)
#"os_ver:"+str(os_version)
os_ver = font.render("vm os version:"+str(os_version), True, (255, 255, 255))
osver_rect=os_ver.get_rect()
osver_rect.topleft=(7,115)
#"cpu_info:"+str(cpu_info)
cpu_information = font.render("cpu_info:"+str(cpu_info), True, (255, 255, 255))
cpuinfo_rect=cpu_information.get_rect()
cpuinfo_rect.topleft=(7,130)
#"ram_info:"+str(ram_info)
ram_information = font.render("ram_info:"+str(ram_info), True, (255, 255, 255))
raminfo_rect=ram_information.get_rect()
raminfo_rect.topleft=(7,145)
#"vm version:"+str(vm_info)
vm_ver = font.render("vm version:"+str(vm_info), True, (255, 255, 255))
vm_info_rect=vm_ver.get_rect()
vm_info_rect.topleft=(7,160)
#"booter:"+str(booter)
booter_ver = font.render("booter:"+str(booter), True, (255, 255, 255))
booter_info_rect=vm_ver.get_rect()
booter_info_rect.topleft=(7,175)
#"python version:"+str(py_ver)
python_ver=font.render("python version:"+str(sys.version),True,(255,255,255))
python_ver_rect=python_ver.get_rect()
python_ver_rect.topleft=(7,190)
#loading 1 million modules(not really)
mimodules=font.render("loading 1 M modules--complete",True,(255,255,255))
mimodules_rect=mimodules.get_rect()
mimodules_rect.topleft=(7,205)
screen = pygame.display.set_mode((WIDTH, HEIGHT),RESIZABLE)
running = True
def get_font(size): # Returns Press-Start-2P in the desired size
return pygame.font.Font("font/font.ttf", size)
def get_calibri_font(size):
return pygame.font.Font("font/calibri.ttf",size)
def get_hanzi_font(size):
return pygame.font.Font("font/usehanzi.ttf",size)
def get_hanzijianti_font(size):
return pygame.font.Font("font/jianti (1).ttc",size)
def g1():
global python_os,python_os_rect
global pylegends, pylegends_rect
global os,os_rect
global os_ver,osver_rect
global cpu_information,cpuinfo_rect
global ram_information,raminfo_rect
global vm_ver,vm_info_rect
global booter_ver,booter_info_rect
if startup==True:
screen.blit(python_os, python_os_rect)
screen.blit(pylegends, pylegends_rect)
screen.blit(os,os_rect)
screen.blit(os_ver,osver_rect)
screen.blit(cpu_information,cpuinfo_rect)
screen.blit(ram_information,raminfo_rect)
screen.blit(vm_ver,vm_info_rect)
screen.blit(booter_ver,booter_info_rect)
screen.blit(python_ver,python_ver_rect)
screen.blit(mimodules,mimodules_rect)
return
def restart_2():
global running, bg_install
get = False
startuplist=[]
for i in range(1,90):
startuplist.append(pygame.image.load(f"./images/startup/startup_{i}.png"))
print(startuplist)
crraima=0
screen.fill((0, 0, 0))
#windows logo
windows_leftup=pygame.image.load("./running logo/win1.png")
windows_rightup=pygame.image.load("./running logo/win2.png")
windows_leftdown=pygame.image.load("./running logo/win3.png")
windows_rightdown=pygame.image.load("./running logo/win4.png")
clock = pygame.time.Clock()
for i in range(100):
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(windows_leftup,(364,54)) #305,15
screen.blit(windows_rightup,(499,54)) #440,15
screen.blit(windows_leftdown,(364,189)) #314,154
screen.blit(windows_rightdown,(499,189)) #449,153
screen.blit(startuplist[crraima], (430, 400)) #370
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
def hman_next():
global running,bg_install
get=False
globe=pygame.image.load("./running logo/human.svg")
g1=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(350,200),
text_input=" 自动设置",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
networking=Button(image=pygame.image.load("./running logo/networkgood.png"),pos=(300,200),text_input="",font=get_font(0),base_color="black",hovering_color="black")
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(35).render("如何设置?", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(500, 30))
networking.changeColor(OPTIONS_MOUSE_POS)
networking.update(screen)
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="下一步",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if g1.checkForInput(OPTIONS_MOUSE_POS):
g1.image=pygame.image.load("./running logo/global white selected.png")
if next.checkForInput(OPTIONS_MOUSE_POS):
#restart_2()
import os
os.system("python shell_startup.py")
pygame.quit()
#return
pygame.display.update()
if get:
return
def hmanask():
global running, bg_install
get = False
startuplist=[]
for i in range(1,35):
startuplist.append(pygame.image.load(f"./images/startupv/startupv_{i}.png"))
print(startuplist)
crraima=0
globe=pygame.image.load("./running logo/human.svg")
clock = pygame.time.Clock()
for i in range(100):
screen.fill((0, 0, 0))
screen.blit(bg_install,(0,0))
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(globe,(100,100))
screen.blit(startuplist[crraima], (370, 200))
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
hman_next()
def wifi_next():
global running,bg_install
get=False
globe=pygame.image.load("./running logo/network.svg")
g1=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(350,200),
text_input=" 以太网",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
networking=Button(image=pygame.image.load("./running logo/networkgood.png"),pos=(300,200),text_input="",font=get_font(0),base_color="black",hovering_color="black")
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("让我们为你连接网络", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(300, 30))
networking.changeColor(OPTIONS_MOUSE_POS)
networking.update(screen)
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="下一步",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if g1.checkForInput(OPTIONS_MOUSE_POS):
g1.image=pygame.image.load("./running logo/global white selected.png")
if next.checkForInput(OPTIONS_MOUSE_POS):
hmanask()
#return
pygame.display.update()
if get:
return
def wifiask():
global running, bg_install
get = False
startuplist=[]
for i in range(1,35):
startuplist.append(pygame.image.load(f"./images/startupv/startupv_{i}.png"))
print(startuplist)
crraima=0
globe=pygame.image.load("./running logo/network.svg")
clock = pygame.time.Clock()
for i in range(100):
screen.fill((0, 0, 0))
screen.blit(bg_install,(0,0))
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(globe,(100,100))
screen.blit(startuplist[crraima], (370, 200))
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
wifi_next()
def keyboard_next():
global running,bg_install
get=False
globe=pygame.image.load("./running logo/keyboard.svg")
g1=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(350,200),
text_input="微软拼音输入法/ENG/微软五笔输入法",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("请选择键盘格式:", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(300, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="下一步",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if g1.checkForInput(OPTIONS_MOUSE_POS):
g1.image=pygame.image.load("./running logo/global white selected.png")
if next.checkForInput(OPTIONS_MOUSE_POS):
wifiask()
#return
pygame.display.update()
if get:
return
def keyboardask():
global running, bg_install
get = False
startuplist=[]
for i in range(1,35):
startuplist.append(pygame.image.load(f"./images/startupv/startupv_{i}.png"))
print(startuplist)
crraima=0
globe=pygame.image.load("./running logo/keyboard.svg")
clock = pygame.time.Clock()
for i in range(100):
screen.fill((0, 0, 0))
screen.blit(bg_install,(0,0))
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(globe,(100,100))
screen.blit(startuplist[crraima], (370, 200))
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
keyboard_next()
def asking_next():
global running,bg_install
get=False
globe=pygame.image.load("./running logo/globe.svg")
g1=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(340,215),
text_input=" 中国大陆",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g2=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(660,215),
text_input=" 中国台湾",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g3=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(340,280),
text_input=" 中国香港",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g4=Button(image=pygame.image.load("./running logo/global white un select.png"),pos=(660,280),
text_input=" 中国澳门",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("请选择您所在的国家:", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(300, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
g2.changeColor(OPTIONS_MOUSE_POS)
g2.update(screen)
g3.changeColor(OPTIONS_MOUSE_POS)
g3.update(screen)
g4.changeColor(OPTIONS_MOUSE_POS)
g4.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="下一步",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if g1.checkForInput(OPTIONS_MOUSE_POS):
g1.image=pygame.image.load("./running logo/global white selected.png")
if g2.checkForInput(OPTIONS_MOUSE_POS):
g2.image=pygame.image.load("./running logo/global white selected.png")
if g3.checkForInput(OPTIONS_MOUSE_POS):
g3.image=pygame.image.load("./running logo/global white selected.png")
if g4.checkForInput(OPTIONS_MOUSE_POS):
g4.image=pygame.image.load("./running logo/global white selected.png")
if next.checkForInput(OPTIONS_MOUSE_POS):
keyboardask()
#return
pygame.display.update()
if get:
return
def asking():
global running, bg_install
get = False
startuplist=[]
for i in range(1,35):
startuplist.append(pygame.image.load(f"./images/startupv/startupv_{i}.png"))
print(startuplist)
crraima=0
globe=pygame.image.load("./running logo/globe.svg")
clock = pygame.time.Clock()
for i in range(100):
screen.fill((0, 0, 0))
screen.blit(bg_install,(0,0))
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(globe,(100,100))
screen.blit(startuplist[crraima], (370, 200))
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
asking_next()
def restart():
global running, bg_install
get = False
startuplist=[]
for i in range(1,90):
startuplist.append(pygame.image.load(f"./images/startup/startup_{i}.png"))
print(startuplist)
crraima=0
screen.fill((0, 0, 0))
#windows logo
windows_leftup=pygame.image.load("./running logo/win1.png")
windows_rightup=pygame.image.load("./running logo/win2.png")
windows_leftdown=pygame.image.load("./running logo/win3.png")
windows_rightdown=pygame.image.load("./running logo/win4.png")
clock = pygame.time.Clock()
for i in range(100):
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
screen.blit(windows_leftup,(364,54)) #305,15
screen.blit(windows_rightup,(499,54)) #440,15
screen.blit(windows_leftdown,(364,189)) #314,154
screen.blit(windows_rightdown,(499,189)) #449,153
screen.blit(startuplist[crraima], (430, 400)) #370
pygame.display.flip()
clock.tick(25)
crraima = (crraima + 1) % len(startuplist)
pygame.display.update()
asking()
def finishing_installation():
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("PythonOS安装程序", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(170, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" 安装已完成,请重启。",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="重启",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
restart()
#return
pygame.display.update()
if get:
return
def compressfileproc():
global running,bg_install,max_value,value
get=False
#progress_color = (0, 0, 255) # blue
max_value = 100
value = 0
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("安装程序正在压缩文件,请稍后...", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(550, 30))
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
#ji ni tai mei~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~
draw_progress_bar(value)
if value!=34.900000000000226:
value += 0.1
else:
finishing_installation()
def compressfile():
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("PythonOS安装程序", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(170, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" 安装程序正在压缩文件,请稍后...",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
img_image=pygame.image.load("./running logo/folder.png")
imgbt=Button(image=img_image,pos=(270,300),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
imgbt.changeColor(OPTIONS_MOUSE_POS)
imgbt.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
compressfileproc()
#return
pygame.display.update()
if get:
return
def gettingiso():
global running,bg_install,max_value,value
get=False
#progress_color = (0, 0, 255) # blue
max_value = 100
value = 0
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("安装程序正在准备镜像,请稍后...", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(550, 30))
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
#ji ni tai mei~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~
draw_progress_bar(value)
if value!=12:
value += 1
else:
compressfile()
def prepareiso():
#准备镜像
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("PythonOS安装程序", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(170, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" 安装程序正在准备镜像,请稍后...",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
img_image=pygame.image.load("./running logo/folder-box.png")
imgbt=Button(image=img_image,pos=(270,300),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
imgbt.changeColor(OPTIONS_MOUSE_POS)
imgbt.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
gettingiso()
#return
pygame.display.update()
if get:
return
def delfileproc():
global running,bg_install,max_value,value
get=False
#progress_color = (0, 0, 255) # blue
max_value = 100
value = 0
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("安装程序正在删除文件,请稍后...", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(550, 30))
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
#ji ni tai mei~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~~~~
draw_progress_bar(value)
if value!=34.900000000000226:
value += 0.1
else:
prepareiso()
def delfile():
#删除文件
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("PythonOS安装程序", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(170, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" 安装程序正在删除旧文件,请稍后...",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
img_image=pygame.image.load("./running logo/flie.png")
imgbt=Button(image=img_image,pos=(270,300),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
imgbt.changeColor(OPTIONS_MOUSE_POS)
imgbt.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
delfileproc()
#return
pygame.display.update()
if get:
return
def checkdisk():
global running,bg_install,max_value,value
get=False
#progress_color = (0, 0, 255) # blue
max_value = 100
value = 0
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("安装程序正在检查硬盘,请稍后...", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(550, 30))
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
draw_progress_bar(value)
if value!=12: #34.900000000000226
value += 1 #0.1
else:
delfile()
def install():
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("PythonOS安装程序", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(170, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" 安装程序正在检查硬盘,请稍后...",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
img_image=pygame.image.load("./running logo/Disk2.png")
imgbt=Button(image=img_image,pos=(270,300),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
imgbt.changeColor(OPTIONS_MOUSE_POS)
imgbt.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
checkdisk()
#return
pygame.display.update()
if get:
return
def choosedisk():
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("请选择硬盘:", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(150, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
disk=Button(image=pygame.image.load("./running logo/disk.png"),pos=(190,200),text_input="",font=get_font(0),base_color="black",hovering_color="black")
disk.changeColor(OPTIONS_MOUSE_POS)
disk.update(screen)
g1=Button(image=None,pos=(300,200),
text_input=" C:/系统 共100TB,72.5TB可用)",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
install()
#return
pygame.display.update()
if get:
return
def select_ver():
global running,bg_install
get=False
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
ins_image=pygame.image.load("./running logo/setup-icon.png")
insbt=Button(image=ins_image,pos=(30,30),
text_input=" ",font=get_font(1),base_color="white",hovering_color="white")
insbt.changeColor(OPTIONS_MOUSE_POS)
insbt.update(screen)
OPTIONS_TEXT = get_hanzijianti_font(25).render("请选择版本:", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(140, 30))
system_choose=Button(image=pygame.image.load("./running logo/system choose white.png"),pos=(500,281),text_input="",font=get_font(0),base_color="black",hovering_color="black")
system_choose.changeColor(OPTIONS_MOUSE_POS)
system_choose.update(screen)
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
g1=Button(image=None,pos=(300,200),
text_input=" PythonOS 测试版(build-1.5.2)",font=get_hanzijianti_font(20),base_color="Black",hovering_color="Black")
g1.changeColor(OPTIONS_MOUSE_POS)
g1.update(screen)
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)
next=Button(image=pygame.image.load("./running logo/next_button.png"),pos=(800,450),
text_input="确定",font=get_hanzijianti_font(30),base_color="Black",hovering_color="White")
next.changeColor(OPTIONS_MOUSE_POS)
next.update(screen)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if next.checkForInput(OPTIONS_MOUSE_POS):
choosedisk()
#return
pygame.display.update()
if get:
return
def draw_progress_bar(value):
global max_value
progress_color = (0, 0, 255) # blue
progress_width = int(value / max_value * 400)
pygame.draw.rect(screen, progress_color, [10, 10, progress_width, 18], 0)
def running_backup_files():
global running,bg_install,max_value,value
get=False
#progress_color = (0, 0, 255) # blue
max_value = 100
value = 0
while running:
OPTIONS_MOUSE_POS = pygame.mouse.get_pos()
#screen.fill("cyan")
screen.fill("black")
screen.blit(bg_install,(0,0))
OPTIONS_TEXT = get_hanzijianti_font(25).render("安装程序正在加载文件,请稍后...", True, "Black")
OPTIONS_RECT = OPTIONS_TEXT.get_rect(center=(500, 30))
screen.blit(OPTIONS_TEXT, OPTIONS_RECT)
ji=[
pygame.image.load("./running logo/bar1.png"),
pygame.image.load("./running logo/bar2.png"),
pygame.image.load("./running logo/bar3.png"),
pygame.image.load("./running logo/bar4.png"),
pygame.image.load("./running logo/bar5.png"),
]
draw_progress_bar(value)
if value!=34.900000000000226:
value += 0.1
else:
select_ver()
copyright=Button(image=None,pos=(160,510),
text_input="© Github-Huangshaoqi 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright.changeColor(OPTIONS_MOUSE_POS)
copyright.update(screen)
copyright2=Button(image=None,pos=(120,535),
text_input="© happyleibniz 2023",font=get_hanzijianti_font(20),base_color="Black",hovering_color="black")
copyright2.changeColor(OPTIONS_MOUSE_POS)
copyright2.update(screen)