def __init__(self):
    self.virtualbox = virtualbox.VirtualBox()
    self.config = configparser.ConfigParser()
    self.config.read('config.ini')
    self.assets = json.load(open('assets.json', 'r'))
    client_id = self.config['Rich Presence']['client_id']
    self.RPC = Presence(client_id)
    self.RPC.connect()
    self.format_dict = {'start': time.time()}
    while True:
        if ((('VirtualBox.exe' in (p.name() for p in psutil.process_iter())) or ('VirtualBoxVM.exe' in (p.name() for p in psutil.process_iter()))) and sys.platform.startswith('win32')):
            self.machine_list = self.generate_machine_list()
            self.previous_format_dict = self.format_dict
            self.format_dict = self.generate_format_dict(machine_list=self.machine_list, previous_format_dict=self.previous_format_dict)
            self.presence_dict = self.generate_presence_dict(format_dict=self.format_dict)
            self.RPC.update(**self.presence_dict)
            pprint.pprint(self.presence_dict)
            print('--------------------')
        elif sys.platform.startswith('win32'):
            print('VirtualBox is not running')
            self.RPC.clear()
        else:
            print('Sorry, your platform is not supported.')
            exit()
        time.sleep(15)
def __init__(self):
    self.virtualbox = virtualbox.VirtualBox()
    self.config = configparser.ConfigParser()
    self.config.read('config.ini')
    self.assets = json.load(open('assets.json', 'r'))
    client_id = self.config['Rich Presence']['client_id']
    self.RPC = Presence(client_id)
    self.RPC.connect()
    self.format_dict = {'start': time.time()}
    while True:
        if ((('VirtualBox.exe' in (p.name() for p in psutil.process_iter())) or ('VirtualBoxVM.exe' in (p.name() for p in psutil.process_iter()))) and sys.platform.startswith('win32')):
            self.machine_list = self.generate_machine_list()
            self.previous_format_dict = self.format_dict
            self.format_dict = self.generate_format_dict(machine_list=self.machine_list, previous_format_dict=self.previous_format_dict)
            self.presence_dict = self.generate_presence_dict(format_dict=self.format_dict)
            self.RPC.update(**self.presence_dict)
            pprint.pprint(self.presence_dict)
            print('--------------------')
        elif sys.platform.startswith('win32'):
            print('VirtualBox is not running')
            self.RPC.clear()
        else:
            print('Sorry, your platform is not supported.')
            exit()
        time.sleep(15)