Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RainOS / Version: 0.3.1 / Linux Version / Python version: 3.x / BASH
- import time,os,sys,datetime,ros_demo
- from time import gmtime,strftime
- from re import sub
- class fc_Standart():
- BLACK = '\033[0;30m'
- RED = '\033[0;31m'
- GREEN = '\033[0;32m'
- YELLOW = '\033[0;33m'
- BLUE = '\033[0;34m'
- MAGENTA = '\033[0;35m'
- LBLUE = '\033[0;36m'
- WHITE = '\033[0;37m'
- class fc_Fat():
- BLACK = '\033[1;30m'
- RED = '\033[1;31m'
- GREEN = '\033[1;32m'
- YELLOW = '\033[1;33m'
- BLUE = '\033[1;34m'
- MAGENTA = '\033[1;35m'
- LBLUE = '\033[1;36m'
- WHITE = '\033[1;37m'
- class bg_Color():
- BLACK = '\033[40m'
- RED = '\033[41m'
- GREEN = '\033[42m'
- YELLOW = '\033[43m'
- BLUE = '\033[44m'
- MAGENTA = '\033[45m'
- LBLUE = '\033[46m'
- WHITE = '\033[47m'
- class end_Color():
- ENDC = '\033[0m'
- #LOGOS
- logo_0 = (fc_Fat.RED+ '''
- ----
- ------
- --- ---
- ----------
- ---- ----
- [ ARKON.F BIOP | Version is 2.6 | Wizzard-Texas Inc. ]
- ======================================================
- *114 (KB) is free of 120 (KB)
- *CPU have 33 (HZ)
- *CPU is x8 (BIT)
- *Cache equal 100 (BIT)
- ======================================================
- <Load operation system | Load method is the SHELL-LOAD>
- Please wait . . .
- '''+end_Color.ENDC)
- logo_1 = (fc_Standart.GREEN+ '''
- ###########
- ##################
- #####################
- ######----------------######
- ######-------------------######
- ######---------------------######
- ######---------------------######
- ######---------------------######
- ######-------------------######
- ######----------------######
- #####################
- ##################
- #########\t\t''',fc_Fat.RED+'''OpenBPA LAN program
- '''+end_Color.ENDC)
- logo_2 = (fc_Standart.LBLUE+ '''
- \t #
- \t ##
- \t ###
- \t #####
- \t ######
- \t ########
- \t ##########
- \t ###########
- \t ###########
- \t #########
- \t #######
- \t\t\t''',fc_Fat.GREEN+'"Rain" Operation System | Version 0.1.3'+end_Color.ENDC)
- #MENUES
- menu_0 = ('''
- 1 [ Information about your PC ]
- 2 [ Information about your OS ]
- 3 [ Open Rain OS scripts ]
- 4 [ Go to User folder ]
- 5 [ Reboot your PC ]
- 6 [ Shutdown your PC ]
- 9 [ Open RainOS command line ]
- 0 [ Refresh your screen ]
- ''')
- #INFORMATION
- info_0 = ('''
- 1 [ Mother board : computer-mother-14 / gElectronics ]
- 2 [ CPU : zero-one-brain-2 / gElectronics ]
- 3 [ Socket : ge-420 ]
- 4 [ Video : El-Graphics-simple / electro-Me ]
- 5 [ Audio : MIDIonly-g2 / SoundsJohnson ]
- 6 [ LAN-connecter: openBPA-model-2 / BPA-electronics ]\33[0m''')
- info_1 = ('''
- Kernel version: 0.7
- Programming language: LightScript (version - 2.1)
- Command interpreter: JoStar-CommandShell (version - 1.3)
- Interpreter zero: rIOP-command
- InputOutput controller: rIOP-io
- Power controller: rIOP-power
- StandardFilesFormat: GEOSL
- Graphics controller: xGraph
- LAN virtual controller: Open-BluePineapple-LAN
- HDD virtual controller: Open-BluePineapple-HDD
- Floppy disk controller: JSFloppyController
- ''')
- #HELP
- help_1 = (fc_Standart.YELLOW+'''
- <-------------------------------------------->
- <-------------------HELP--------------------->
- <-------------------------------------------->
- cscr -- clear screen
- exit -- exit from the terminal
- date -- show current date
- time -- show current time
- date_time -- show date and time together
- msg -- open SimpleTextEditor
- lnetw -- open lan-network
- pres -- power reboot
- poff -- power shutdown
- pcinfo -- pc information
- osinfo -- os information
- osdemo -- show rain os demo-scripts
- oslogo -- show os logotype
- <-------------------------------------------->
- <-------------------------------------------->
- <-------------------------------------------->
- \n'''+end_Color.ENDC)
- help_2 = (fc_Standart.YELLOW+ '''
- <-------------------------------------------->
- <-------------------HELP--------------------->
- <-------------------------------------------->
- Command:
- write -- start writing message
- exit -- for exit
- help -- this help text
- smsg -- secret message
- cscr -- clear screen
- When you will writing in text editor:
- *press <ENTER> for next line
- *<CTRL> + <D> to exit from text editor
- --------------------------------------------
- --------------------------------------------
- --------------------------------------------
- \n'''+end_Color.ENDC)
- help_3 = (fc_Standart.YELLOW+'''
- Я не знаю, что делать. Пытаюсь всё поменять в своей жизни, но плохо.
- Пусто, никакой искры. Ты убиваешь молчанием. Я понимаю, что ты устроила
- настоящее испытание, которое убивает... Я это заслужил.
- Если ты нашла кого-то другого -- я пойму. Такой я тебе не нужен.
- Если же я тебя встречу, то я буду "туманным".
- '''+end_Color.ENDC)
- #FUNCTIONS
- def ShowIt(currentLogo,fts):
- for x in range(len(currentLogo)):
- print(currentLogo[x],end="")
- time.sleep(fts)
- inp = 0
- if (inp == 1):
- input("\n\nPress any key to continue . . .")
- def whats_timedate():
- print(fc_Fat.BLUE+bg_Color.WHITE+" Year: 1983",strftime("Month: %m Day: %d | Time: %H:%M:%S",gmtime())," "+end_Color.ENDC)
- def whats_time():
- print(fc_Fat.BLUE+bg_Color.WHITE+strftime("Time: %H:%M:%S",gmtime())," "+end_Color.ENDC)
- def whats_date():
- print(fc_Fat.BLUE+bg_Color.WHITE+" Year: 1983",strftime("Month: %m Day: %d",gmtime())," "+end_Color.ENDC)
- def ROSscripts(choice):
- os.system('clear')
- print(fc_Fat.WHITE+bg_Color.BLUE+" Year: 1983",strftime("Month: %m Day: %d | %H:%M:%S",gmtime()),''' '''+end_Color.ENDC,
- "\n",fc_Standart.YELLOW+'''[ Path: disk0/system/user/userfolder/ ]'''+end_Color.ENDC,'''
- 1 [ Show how alphabet is working ]
- 2 [ Show how keyCheck is working ]
- 3 [ Show how menuGen is working ]
- 4 [ Show how powerCon is working ]
- ''')
- choice = input("\nChoose: ")
- if ( choice == '1' ):
- This = ros_demo.ROS_Alphabete
- print(ros_demo.rosShow(This))
- input("\n\nPress any key to continue . . .")
- if ( choice == '2' ):
- This = ros_demo.ROS_Keycheck
- print(ros_demo.rosShow(This))
- input("\n\nPress any key to continue . . .")
- if ( choice == '3' ):
- This = ros_demo.ROS_MenuGen
- print(ros_demo.rosShow(This))
- input("\n\nPress any key to continue . . .")
- if ( choice == '4' ):
- This = ros_demo.ROS_Powercontrol
- print(ros_demo.rosShow(This))
- input("\n\nPress any key to continue . . .")
- else: print (bg_Color.RED+fc_Fat.WHITE+ "< ERROR IN TYPE >" +end_Color.ENDC)
- def UserFolder():
- while( True ):
- print("[ Path: disk0/system/user/userfolder/ ]")
- file_action = input("What do you want to do? Answer: ")
- if ( file_action == "read" ):
- open_filename = str(input("File: "))
- while( len(open_filename) < 1 ):
- open_filename = str(input("File too small! Name: "))
- open_fileformat = str(input("Format: "))
- open_fileformat = open_filename.lower()
- while( len(open_fileformat) < 1 or open_fileformat > 4 ):
- open_fileformat = str(input("Format is wrong! Format: "))
- current_opened_file = open_filename+"."+open_fileformat
- if not os.path.exists(current_opened_file):
- print("I didn't see your file . . .")
- if os.path.exists(current_opened_file):
- openit = open("/userfolder/"+current_opened_file,"r")
- openit.read()
- print(openit)
- if ( file_action == "write" ):
- write_filename = str(input("File: "))
- while( len(write_filename) < 1 ):
- write_filename = str(input("File too small! Name: "))
- write_fileformat = str(input("Format: "))
- write_fileformat = open_fileformat.lower()
- while( len(write_fileformat) < 1 or len(write_fileformat) > 4 ):
- write_fileformat = str(input("Format is wrong! Format: "))
- current_writen_file = write_filename+"."+write_fileformat
- writeit = open("/userfolder/"+current_writen_file,"w")
- chunks = []
- check = 1
- while( True ):
- try:
- print(fc_Standart.GREEN+ "[",check,"]" +end_Color.ENDC)
- chunk = str(input(">"))
- check += 1
- except EOFError:
- break
- chunks.append(chunk)
- return print("\n".join(chunks))
- writeit.write()
- def LoadSF():
- for i in range(101):
- print (fc_Fat.WHITE+bg_Color.BLUE+ "Upload files: [ ",i,"% ]" +end_Color.ENDC)
- time.sleep(0.1)
- os.system("clear")
- if ( i == 101 ):
- print (fc_Fat.WHITE+bg_Color.BLUE+ "All system files was uploaded!" +end_Color.ENDC)
- def Reboot():
- print ("Signal to ''ZEROLEVEL'' with logsSIGNAL = STOP PROCESS")
- time.sleep(4)
- for x in range(201):
- print (fc_Fat.GREEN+"PROCESS...............................#",x,""+end_Color.ENDC)
- time.sleep(0.03)
- if ( x == 167 ):
- print (fc_Fat.MAGENTA+bg_Color.BLACK+ "< ERROR: CAN'T STOP ''STRM-BREAK'', ''POFF-DO''" +end_Color.ENDC)
- time.sleep(4)
- if ( x == 207 ):
- print (fc_Fat.WHITE+bg_Color.BLUE+"System reboot!"+end_Color.ENDC)
- def Shutdown():
- print ("Signal to ''ZEROLEVEL'' with logsSIGNAL = STOP PROCESS, HALT PC")
- time.sleep(4)
- print ("Goodbye! :)")
- for x in range(218):
- print (fc_Fat.GREEN+"PROCESS...............................#",x,""+end_Color.ENDC)
- time.sleep(0.1)
- def ProgressBar():
- progress = 0
- #while(progress!=101):
- for progress in range(101):
- print(fc_Fat.BLUE+'\r{0}{1}%'.format('█' * progress * 1+end_Color.ENDC, progress),end='%')
- time.sleep(0.2)
- #progress+=1
- def SimpleTextEditor():
- chunks = []
- check = 1
- while True:
- try:
- print(fc_Standart.GREEN+ "[",check,"]" +end_Color.ENDC);
- chunk = str(input(">"))
- check += 1
- except EOFError:
- break
- chunks.append(chunk)
- return print('\n '.join(chunks))
- #PROGRAM CONSTRUCTION#
- os.system('clear')
- currentLogo = logo_0
- gts = fts = 0.03
- inpg = inp = 0
- ShowIt(currentLogo,fts)
- print(ProgressBar())
- #print(LoadSF())
- os.system("clear")
- while ( True ):
- print (whats_timedate(),"\t")
- currentLogo = menu_0
- inpg = inp = 0
- gts = fts = 0.01
- ShowIt(currentLogo,fts)
- cmdCh = input("Choose "+fc_Fat.BLUE+">>> "+end_Color.ENDC)
- if ( cmdCh == "1" ):
- currentLogo = info_0
- inpg = inp = 1
- gts = fts = 0.01
- ShowIt(currentLogo,fts)
- if ( cmdCh == "2" ):
- currentLogo = info_1
- inpg = inp = 1
- gts = fts = 0.02
- ShowIt(currentLogo,fts)
- if ( cmdCh == "3" ):
- choice = cmdCh
- ROSscripts(choice)
- if ( cmdCh == "4" ):
- print(UserFolder())
- if ( cmdCh == "5" ):
- cmdCh = input("You realy want to reboot your PC? [y/n]")
- if ( cmdCh == "y" ):
- print (Reboot(),loadSF())
- if ( cmdCh == "n" ):
- print (fc_Fat.BLUE+bg_Color.WHITE+ "Okay, let's continue this session! :)" +end_Color.ENDC)
- time.sleep(2)
- os.system("clear")
- continue
- else:
- print (bg_Color.RED+fc_Fat.WHITE+ "< ERROR IN TYPE >" +end_Color.ENDC)
- if ( cmdCh == "6" ):
- cmdCh = input("You realy want to shutdown your PC? [y/n]")
- if ( cmdCh == "y" ):
- print (Shutdown())
- exit()
- if ( cmdCh == "n" ):
- print (fc_Fat.BLUE+bg_Color.WHITE+ "Okay, let's continue this session! :)" +end_Color.ENDC)
- os.system("clear")
- continue
- else:
- print (bg_Color.RED+fc_Fat.WHITE+ "< ERROR IN TYPE >" +end_Color.ENDC)
- if ( cmdCh == "9" ):
- cmdVar = 'open'
- x = 0
- while( x != 1 ):
- print(fc_Fat.BLUE+ "\n[ RainOS command shell | version 0.2 ] \n" +end_Color.ENDC)
- cmdAnswer = input("\nShell command "+fc_Fat.BLUE+">>> "+end_Color.ENDC)
- if (cmdAnswer == 'help'):
- print(help_1)
- if (cmdAnswer == 'cscr'):
- os.system("clear")
- if (cmdAnswer == 'date_time'):
- print(whats_timedate())
- if (cmdAnswer == 'time'):
- print(whats_time())
- if (cmdAnswer == 'date'):
- print(whats_date())
- if (cmdAnswer == 'msg'):
- print(fc_Fat.BLUE+bg_Color.WHITE+ "Simple text editor" +end_Color.ENDC,"\n")
- while( True ):
- msgAnswer = input("What do you want?: ")
- msgAnswer = msgAnswer.lower()
- if ( msgAnswer == "exit" ):
- break
- if ( msgAnswer == 'help' ):
- print(help_2)
- if (msgAnswer == 'smsg'):
- print(help_3)
- if ( msgAnswer == 'cscr' ):
- os.system('clear')
- if ( msgAnswer == 'write' ):
- print(SimpleTextEditor())
- if (cmdAnswer == 'lnetw'):
- print(fc_Fat.GREEN+ "Please wait . . ." +end_Color.ENDC)
- time.sleep(5)
- #print(ProgressBar())
- time.sleep(2)
- print(logo_1)
- time.sleep(1)
- print("Please, wait... I trying to connect")
- time.sleep(5)
- print(fc_Fat.RED+ "ERROR TO CONNECT. CODE < 1 >" +end_Color.ENDC)
- if (cmdAnswer == 'exit'):
- x += 1
- if (cmdAnswer == 'pres'):
- print(Reboot())
- x+=1
- if (cmdAnswer == 'poff'):
- print(Shutdown())
- exit()
- if (cmdAnswer == 'pcinfo'):
- currentLogo = info_0
- inpg = inp = 0
- gts = fts = 0.01
- ShowIt(currentLogo,fts)
- if (cmdAnswer == 'osinfo'):
- currentLogo = info_1
- inpg = inp = 0
- gts = fts = 0.01
- ShowIt(currentLogo,fts)
- if (cmdAnswer == 'osdemo'):
- choice = cmdCh
- ROSscripts(choice)
- if (cmdAnswer == 'oslogo'):
- currentLogo = logo_2
- inpg = inp = 0
- gts = fts = 0.01
- ShowIt(currentLogo,fts)
- if ( cmdCh == "0" ):
- os.system("clear")
- continue
- else:
- print (bg_Color.RED+fc_Fat.WHITE+ "< ERROR IN TYPE >" +end_Color.ENDC)
- time.sleep(2)
- os.system('clear')
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement