Beispiel #1
0
    def __init__(self, main_window, ListDevices, BlivetUtils, Builder, kickstart_mode=False, disk=None):

        GLib.threads_init()
        Gdk.threads_init()
        Gdk.threads_enter()

        self.list_devices = ListDevices
        self.b = BlivetUtils
        self.builder = Builder

        self.kickstart_mode = kickstart_mode

        self.disk = disk
        self.main_window = main_window

        # ListStores for partitions and actions
        self.partitions_list = Gtk.TreeStore(object, str, str, str, str, str, str, object)
        self.actions_list = Gtk.ListStore(GdkPixbuf.Pixbuf, str)

        self.partitions_view = self.create_partitions_view()
        self.builder.get_object("partitions_viewport").add(self.partitions_view)

        self.actions_view = self.create_actions_view()
        self.builder.get_object("actions_viewport").add(self.actions_view)

        self.info_label = Gtk.Label()
        self.builder.get_object("pv_viewport").add(self.info_label)

        self.darea = device_canvas(blivet_utils=self.b, list_partitions=self)
        self.builder.get_object("image_window").add(self.darea)

        self.main_menu = main_menu(self.main_window, self, self.list_devices)
        self.builder.get_object("vbox").add(self.main_menu.get_main_menu)

        self.popup_menu = actions_menu(self)
        self.toolbar = actions_toolbar(self, self.main_window)
        self.builder.get_object("vbox").add(self.toolbar.get_toolbar)

        self.select = self.partitions_view.get_selection()
        self.path = self.select.select_path("1")

        self.on_partition_selection_changed(self.select)
        self.selection_signal = self.select.connect("changed", self.on_partition_selection_changed)

        self.actions = 0
        self.actions_label = self.builder.get_object("actions_page")
        self.actions_label.set_text(_("Pending actions ({0})").format(self.actions))

        self.partitions_label = self.builder.get_object("partitions_page")
        self.partitions_label.set_text(_("Partitions").format(self.actions))

        self.selected_partition = None

        self.history = actions_history(self)
Beispiel #2
0
def main(email, password, book):
    requests_session = requests.Session()
    choose = main_menu()
    if email is None:
        email = click.prompt('Goodreads email ')
    if password is None:
        password = click.prompt('Goodreads password ', hide_input=True)
    token = login(requests_session, email, password)
    # def check_credentials()
    if choose == 'Enter a Book Name':
        book_id = get_book_id(book)
        add_book_to_shelf(requests_session, token, book_id)
    elif choose == 'Upload a file with Book Names':
        books_titles = read_file()
        for title in books_titles:
            book_id = get_book_id(title)
            add_book_to_shelf(requests_session, token, book_id)
Beispiel #3
0
    def __init__(self, ListDevices, BlivetUtils, Builder, disk=None):

        GLib.threads_init()
        Gdk.threads_init()
        Gdk.threads_enter()

        self.list_devices = ListDevices
        self.b = BlivetUtils
        self.builder = Builder

        self.disk = disk

        # ListStores for partitions and actions
        self.partitions_list = Gtk.ListStore(str, str, str, str)
        self.actions_list = Gtk.ListStore(GdkPixbuf.Pixbuf, str)

        self.load_partitions()

        self.partitions_view = self.create_partitions_view()
        self.actions_view = self.create_actions_view()

        self.info_label = Gtk.Label("")
        self.builder.get_object("pv_viewport").add(self.info_label)

        self.darea = Gtk.DrawingArea()

        self.main_menu = main_menu(self.builder.get_object("MainWindow"), self, self.list_devices)
        self.popup_menu = actions_menu(self)
        self.toolbar = actions_toolbar(self)

        self.select = self.partitions_view.get_selection()
        self.path = self.select.select_path("1")

        self.on_partition_selection_changed(self.select)
        self.selection_signal = self.select.connect("changed", self.on_partition_selection_changed)

        self.actions = 0
        self.actions_label = self.builder.get_object("actions_page")
        self.actions_label.set_text(_("Pending actions ({0})").format(self.actions))

        self.partitions_label = self.builder.get_object("partitions_page")
        self.partitions_label.set_text(_("Partitions").format(self.actions))

        self.selected_partition = None
Beispiel #4
0
#!/usr/bin/python
# -*- coding: utf-8 -*
from subprocess import call
import getch, os
import cPickle as pickle
import pygame
from random import random
from random import uniform
from characters import *
from combat import *
from save_system import *
from pause_menu import *
from main_menu import *

user = main_menu()
pygame.mixer.init()
sound=pygame.mixer.Sound("../sounds/prueba.wav")
sound.play(loops=-1)
#maps
marcador ="+"
x = user.position[1]
y = user.position[2]
px = user.position[3]
py = user.position[4]
mapa = open(user.position[0])
maps = mapa.readlines()
maps_lista=[]
maps_linea=[]
for linea in maps:
	for caracter in range(len(linea)):
		caracteres=linea[caracter]
Beispiel #5
0
#!/usr/bin/python
# -*- coding: utf-8 -*
from subprocess import call
import getch, os
import cPickle as pickle
import pygame
from random import random
from random import uniform
from characters import *
from combat import *
from save_system import *
from pause_menu import *
from main_menu import *

user = main_menu()
pygame.mixer.init()
sound = pygame.mixer.Sound("../sounds/prueba.wav")
sound.play(loops=-1)
#maps
marcador = "+"
x = user.position[1]
y = user.position[2]
px = user.position[3]
py = user.position[4]
mapa = open(user.position[0])
maps = mapa.readlines()
maps_lista = []
maps_linea = []
for linea in maps:
    for caracter in range(len(linea)):
        caracteres = linea[caracter]
Beispiel #6
0
#!/usr/bin/python3
import pygame
from displayText import *
from main_menu import *
pygame.mixer.pre_init()
pygame.init()
pygame.font.init()

main_menu()
from algorithms.pathfinding_algorithms import *
from algorithms.mazegen_algorithms import *
from run_algorithm import *
from main_menu import *
from display import *
from globals import *
from node import *

if __name__ == "__main__":
    pathfinding_alg, maze_generation_alg, maze_generation, weighted_graph = main_menu(
    )
    run_algorithm(pathfinding_alg, maze_generation_alg, maze_generation,
                  weighted_graph)
Beispiel #8
0
from main_menu import *
from commands import *
from menu import *

menu = main_menu()
menu.print_menu()
menu.select_menu(int(input('Choose: ')))