Added __builtns__ extender logc

This commit is contained in:
itdominator 2021-10-10 23:28:19 -05:00
parent f96974d79e
commit 9126d0a5ec
3 changed files with 10 additions and 1 deletions

6
src/__builtins__.py Normal file
View File

@ -0,0 +1,6 @@
class Builtins:
def hello_world():
print("Hello, world!")
__builtins__.update({"hello_world": hello_world})

View File

@ -8,9 +8,10 @@ import inspect
# Application imports # Application imports
from utils import Settings from utils import Settings
from signal_classes import Signals from signal_classes import Signals
from __builtins__ import Builtins
class Main: class Main(Builtins):
def __init__(self, args): def __init__(self, args):
settings = Settings() settings = Settings()
builder = settings.returnBuilder() builder = settings.returnBuilder()

View File

@ -19,6 +19,8 @@ class Signals(DummyMixin):
self.settings = settings self.settings = settings
self.builder = self.settings.returnBuilder() self.builder = self.settings.returnBuilder()
hello_world() # A global method from the __builtins__ file that added it
def getClipboardData(self): def getClipboardData(self):
proc = subprocess.Popen(['xclip','-selection', 'clipboard', '-o'], stdout=subprocess.PIPE) proc = subprocess.Popen(['xclip','-selection', 'clipboard', '-o'], stdout=subprocess.PIPE)