Skip to content

Commit

Permalink
Update Linux.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkrzyskow authored Mar 5, 2024
1 parent c1d84f4 commit 611e7ac
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
print(f"\n---Running {os.path.basename(__file__)}---\n")


class CustomPopen(subprocess.Popen):
class Meta(type):
def __getattribute__(self, attr):
att = super().__getattribute__(attr)
print("Meta__getattribute__:", att)
return att


class CustomPopen(subprocess.Popen, metaclass=Meta):

def __init__(self, *args, **kwargs):
print(f"Subprocess command:\n {' '.join(args[0])}")
Expand All @@ -23,6 +30,11 @@ def communicate(self, *args, **kwargs):
print(f" Output is empty")
return out, _

def __class_getitem__(cls, item):
item = super().__class_getitem__(item)
print("__class_getitem__:", item)
return item

def __getattr__(self, item):
att = super().__getattr__(item)
print("__getattr__:", att)
Expand Down

0 comments on commit 611e7ac

Please sign in to comment.