import subprocess
import os


class ScreenBlocker:
	def get_username(self):
		return os.environ["USER"]

	def get_active_sessions(self):
		out = subprocess.Popen(['loginctl', 'list-sessions'], stdout=subprocess.PIPE)
		lines = out.stdout.readlines()
		return [sess.decode().split() for sess in lines[1:len(lines)-2]]

	def lock_session(self):
		name = self.get_username()
		for session in self.get_active_sessions():
			if session[2] == name:
				subprocess.Popen(["loginctl", "lock-session", session[0]])

492d923088d73e2d55ec41a6d3b6811211de70e2
<mask token>


class ScreenBlocker:
    <mask token>
    <mask token>
    <mask token>

<mask token>


class ScreenBlocker:
    <mask token>
    <mask token>

    def lock_session(self):
        name = self.get_username()
        for session in self.get_active_sessions():
            if session[2] == name:
                subprocess.Popen(['loginctl', 'lock-session', session[0]])

<mask token>


class ScreenBlocker:

    def get_username(self):
        return os.environ['USER']

    def get_active_sessions(self):
        out = subprocess.Popen(['loginctl', 'list-sessions'], stdout=
            subprocess.PIPE)
        lines = out.stdout.readlines()
        return [sess.decode().split() for sess in lines[1:len(lines) - 2]]

    def lock_session(self):
        name = self.get_username()
        for session in self.get_active_sessions():
            if session[2] == name:
                subprocess.Popen(['loginctl', 'lock-session', session[0]])

import subprocess
import os


class ScreenBlocker:

    def get_username(self):
        return os.environ['USER']

    def get_active_sessions(self):
        out = subprocess.Popen(['loginctl', 'list-sessions'], stdout=
            subprocess.PIPE)
        lines = out.stdout.readlines()
        return [sess.decode().split() for sess in lines[1:len(lines) - 2]]

    def lock_session(self):
        name = self.get_username()
        for session in self.get_active_sessions():
            if session[2] == name:
                subprocess.Popen(['loginctl', 'lock-session', session[0]])

import subprocess
import os


class ScreenBlocker:
	def get_username(self):
		return os.environ["USER"]

	def get_active_sessions(self):
		out = subprocess.Popen(['loginctl', 'list-sessions'], stdout=subprocess.PIPE)
		lines = out.stdout.readlines()
		return [sess.decode().split() for sess in lines[1:len(lines)-2]]

	def lock_session(self):
		name = self.get_username()
		for session in self.get_active_sessions():
			if session[2] == name:
				subprocess.Popen(["loginctl", "lock-session", session[0]])
