Exemplo n.º 1
0
def new_page(event):
    app.destroy()
    main_page()
Exemplo n.º 2
0
import config
from main_page import main_page

hello = f'Добро пожаловать в онлайн-магазин "{config.MARKET_NAME}"'
print('-' * len(hello))
print(f'*# {hello} #*')
print('-' * (len(hello) + 6))

main_page()
Exemplo n.º 3
0
from utilts import clear_screen


def check_file():
    try:
        f = open('Accounts.txt', 'rb')
        f.close()
    except FileNotFoundError:
        f = open('Accounts.txt', 'wb')
        f.close()


import main_page

clear_screen()
main_page.main_page()
Exemplo n.º 4
0
from graphic import login_pass
from graphic import duud
from login_data import get_login_information
from settings import Settings
from main_page import main_page

se = Settings()

a = get_login_information()
data_sheet = a.data_return()
user_information = ['', '', '']
print(data_sheet)

#data_sheet = [{'Name': 'admin', 'Pass': '******', 'Level': 'admin'}, {'Name': 'camer', 'Pass': '******', 'Level': 'operator'}, {'Name': 'darga', 'Pass': '******', 'Level': 'user'}]

a = login_pass(data_sheet, user_information)
print(a)
b = a.login()
print(b)

#логин хуудсыг x лэхэд дараагийн хуудас гарч ирж байгаа алдааг засах
#print('looop stoped')

#user_information = ['darga','user']
if (user_information[2] is 1):
    #if check_main(user_information[0]):
    a = main_page(se, user_information, data_sheet)
Exemplo n.º 5
0
def main():
    outer_str = ''
    while (1):
        os.system('clear')
        if outer_str:
            print outer_str
        query_key = raw_input(
            '(C) - Check download queue\n(Q) - Quit and will not download anything\nOr Input Query Key Now : '
        )
        if query_key == 'Q' or query_key == 'q' or query_key == 'quit' or query_key == 'Quit':
            leave_fun()
        elif query_key == 'C' or query_key == 'c' or query_key == 'Check' or query_key == 'check':
            outer_str = check_download_queue()
            continue

        query_key = delete_mega_from_query(query_key)
        choice = None
        m = main_page(query_key=query_key)
        warning_str = ''

        while True:
            os.system('clear')
            m.show_page_list()
            print "(S) - Select\n(N) - Next page\n(C) - Check download queue\n(D) - Download files in download queue\n(Q) - Quit the query this time\n"

            if warning_str:
                print warning_str
                warning_str = ''
            else:
                pass

            choice = raw_input('Your choice : ')

            # Select
            if choice == 'S' or choice == 's':
                warning_str = select(m)

            # Next page
            elif choice == 'N' or choice == 'n':
                # There is a next page
                if m.next_main_page_link:
                    m = main_page(url=m.next_main_page_link)
                # There is not
                else:
                    warning_str = ornament("Sorry, this is the last page.")

            # Check download queue
            elif choice == 'C' or choice == 'c':
                check_download_queue()

            # Download files in download queue
            elif choice == 'D' or choice == 'd':
                for page in download_queue:
                    directory_name = replace_bad_char(page['title']) + '/'
                    info_file_name = 'info.txt'
                    passwd = replace_bad_char(page['content_page'].passwd)

                    # os.system("mkdir " + directory_name)
                    print "mkdir " + directory_name
                    # os.system("echo '" + passwd + "' > " + directory_name + info_file_name)
                    print '"' + passwd + '"'
                    print len(passwd)
                    print 'echo ' + passwd + ' >> ' + directory_name + info_file_name
                    for link in page['content_page'].links:
                        # os.system("megadl " + directory_name + " '" + link + "' > /dev/null &")
                        print("megadl --path " + directory_name + " '" + link +
                              "' > /dev/null &")
                empty_download_queue()
                warning_str = ornament(
                    "Downloading files now and empty the download queue")

            # Quit the query this time
            elif choice == 'Q' or choice == 'q':
                break

            # Wrong input
            else:
                warning_str = ornament("[ERR] - Wrong Choice !")
Exemplo n.º 6
0
 def get(self, url):
   self.response.headers['Content-Type'] = 'text/html'
   self.response.out.write(main_page(url))
Exemplo n.º 7
0
def main():
	outer_str = ''
	while(1):
		os.system('clear')
		if outer_str:
			print outer_str
		query_key = raw_input('(C) - Check download queue\n(Q) - Quit and will not download anything\nOr Input Query Key Now : ')
		if query_key == 'Q' or query_key == 'q' or query_key == 'quit' or query_key == 'Quit':
			leave_fun()
		elif query_key == 'C' or query_key == 'c' or query_key == 'Check' or query_key == 'check':
			outer_str = check_download_queue()
			continue

		query_key = delete_mega_from_query(query_key)
		choice = None
		m = main_page(query_key=query_key)
		warning_str = ''

		while True:
			os.system('clear')
			m.show_page_list()
			print "(S) - Select\n(N) - Next page\n(C) - Check download queue\n(D) - Download files in download queue\n(Q) - Quit the query this time\n"

			if warning_str:
				print warning_str
				warning_str = ''
			else:
				pass


			choice = raw_input('Your choice : ')


			# Select
			if choice == 'S' or choice == 's':
				warning_str = select(m)

			# Next page
			elif choice == 'N' or choice == 'n':
				# There is a next page
				if m.next_main_page_link:
					m = main_page(url=m.next_main_page_link)
				# There is not
				else:
					warning_str = ornament("Sorry, this is the last page.")

			# Check download queue
			elif choice == 'C' or choice == 'c':
				check_download_queue()

			# Download files in download queue
			elif choice == 'D' or choice == 'd':
				for page in download_queue:
					directory_name = replace_bad_char(page['title'])+'/'
					info_file_name = 'info.txt'
					passwd = replace_bad_char(page['content_page'].passwd)

					# os.system("mkdir " + directory_name)
					print "mkdir " + directory_name
					# os.system("echo '" + passwd + "' > " + directory_name + info_file_name)
					print '"'+passwd+'"'
					print len(passwd)
					print 'echo ' + passwd + ' >> ' + directory_name + info_file_name
					for link in page['content_page'].links:
						# os.system("megadl " + directory_name + " '" + link + "' > /dev/null &")
						print("megadl --path " + directory_name + " '" + link + "' > /dev/null &")
				empty_download_queue()
				warning_str = ornament("Downloading files now and empty the download queue")

			# Quit the query this time
			elif choice == 'Q' or choice == 'q':
				break

			# Wrong input
			else:
				warning_str = ornament("[ERR] - Wrong Choice !")
Exemplo n.º 8
0
 def get(self):
   self.response.headers['Content-Type'] = 'text/plain'
   self.response.out.write(main_page())