Skip to content

Class Manage File

Module manage create file

Cleanup

Cleanup()

Bases: CreateFileBaseAndUpdate

Source code in fenv\manage_file.py
599
600
601
602
603
604
605
def __init__(self) -> None:
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.path_lib_all = EnvAll().get_path_lib_all()
    self.lib_default_env = EnvAll().get_lib_default_env()
    self.env_name = EnvAll().get_env_name()

remove_lib_not_default_in_env

remove_lib_not_default_in_env()

Removes all the libraries that are not in the default environment

Source code in fenv\manage_file.py
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
def remove_lib_not_default_in_env(self):
    """
    Removes all the libraries that are not in the default environment
    """
    data_lib_all = list(os.listdir(self.path_lib_all))
    diff_list_1 = set(data_lib_all) - set(self.lib_default_env)
    diff_list_2 = set(self.lib_default_env) - set(data_lib_all)
    result = diff_list_1.union(diff_list_2)
    os.chdir(self.path_lib_all)
    if len(result) > 0:
        for item in result:
            if os.path.isdir(item):
                shutil.rmtree(item)
            else:
                os.remove(item)
            print(
                f"{self.notice}{self.colors.SALMON}{item}{self.colors.ENDC} has been removed"
            )
    os.chdir("../../..")
    print(
        f"{self.notice}{self.colors.SKY_BLUE}All the libraries have been removed.{self.colors.ENDC}"
    )
    if platform.system() == "Windows":
        os.system(
            f".\env_{self.env_name }\Scripts\python.exe -m pip freeze > requirements.txt"
        )
        print(
            f'{self.notice}{self.colors.SKY_BLUE}Successfully updated the file "requirements.txt"{self.colors.ENDC}'
        )

    elif platform.system() == "Linux":
        os.system(
            f"bash -c 'source env_{self.env_name }/bin/activate  && pip freeze > requirements.txt'"
        )
        print(
            f'{self.notice}{self.colors.SKY_BLUE}Successfully updated the file "requirements.txt"{self.colors.ENDC}'
        )

CreateFileBaseAndUpdate

CreateFileBaseAndUpdate(name, state)
Source code in fenv\manage_file.py
17
18
19
20
21
22
23
24
def __init__(self, name, state):
    self.name = name
    self.state = state
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.env_directory = EnvAll().get_env_name()
    self.root_directory = EnvAll().get_root_dir_name()

create_file_freeze

create_file_freeze()

It creates a file called "requirements.txt" and writes the string "black" to it

Source code in fenv\manage_file.py
74
75
76
77
78
79
80
81
82
def create_file_freeze(self):
    """
    It creates a file called "requirements.txt" and writes the string "black" to it
    """
    module_base = self.commands.get_requirements_txt()
    with open("requirements.txt", "w") as f:
        f.write(module_base)
    os.chmod("requirements.txt", 0o777)
    print(f'{self.notice}Successfully created the file "requirements.txt"')

create_file_gitignore

create_file_gitignore()

It creates a file called .gitignore and writes the string "*.pyc" to it

Source code in fenv\manage_file.py
84
85
86
87
88
89
90
91
def create_file_gitignore(self):
    """
    It creates a file called .gitignore and writes the string "*.pyc" to it
    """
    with open(".gitignore", "w") as f:
        f.write(f"*.pyc\n/{self.env_directory}")
    os.chmod(".gitignore", 0o777)
    print(f'{self.notice}Successfully created the file ".gitignore"')

create_file_main_py

create_file_main_py()

Create a file main.py and write a function called main() inside of it

Source code in fenv\manage_file.py
26
27
28
29
30
31
32
33
34
def create_file_main_py(self):
    """
    Create a file main.py and write a function called main() inside of it
    """
    self.file_path = "main.py"
    with open(self.file_path, "w") as f:
        f.write(self.commands.get_main_py())
    os.chmod(self.file_path, 0o777)
    print(f'{self.notice}Successfully created the file "{self.file_path}"')

create_file_readme_md

create_file_readme_md()

It creates a file called readme.md and writes the markdown text to it

Source code in fenv\manage_file.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def create_file_readme_md(self):
    """
    It creates a file called readme.md and writes the markdown text to it
    """
    markdown_path = "readme.md"
    markdown = self.commands.get_readme_md()
    with open(markdown_path, "w", encoding="utf-8") as f:
        f.write(
            markdown.format(
                self.name, self.name, self.name, self.name, self.generate_tree()
            )
        )
    os.chmod(markdown_path, 0o777)
    print(f'{self.notice}Successfully created the file "{markdown_path}"')

create_folder

create_folder()

It creates a folder with the name of the argument passed to it

Example
create_folder("project_name")
Return

1 : if has folder already

Source code in fenv\manage_file.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
def create_folder(self):
    """
    It creates a folder with the name of the argument passed to it

    Example:
        ```py
        create_folder("project_name")
        ```
    Return:
        1 : if has folder already
    """
    try:
        os.mkdir(self.name)
    except FileExistsError:
        print(f"{self.notice}{self.name} already exists.")
        return 1
    else:
        print(f'{self.notice}Successfully created the directory "{self.name}"')

create_setting_vscode

create_setting_vscode()

It creates a file settings.json inside the virtual environment

env_path (str): The path to the virtual environment

Example
create_setting_vscode("env_path")
Return

None

Source code in fenv\manage_file.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
def create_setting_vscode(self):
    """
    It creates a file settings.json inside the virtual environment
    Args:
    env_path (str): The path to the virtual environment
    Example:
        ```py
        create_setting_vscode("env_path")
        ```
    Return:
        None
    """

    text_vscode = """{{"python.formatting.provider": "black","python.pythonPath": "{name_env}","editor.formatOnSave": true,}}"""
    os.makedirs(os.path.dirname(".vscode/settings.json"), exist_ok=True)
    with open(".vscode/settings.json", "w", encoding="utf-8") as f:
        f.write(text_vscode.format(name_env=self.name))
    print(f"{self.notice}Successfully created the .vscode/settings.json")

create_virtualenv

create_virtualenv()

It creates a virtual environment with the name you pass to it

Parameters:

Name Type Description Default
virtual_env_name str

The name of the virtual environment you want to create.

required
Example
create_virtualenv("virtual_env_name")
Return

None

Source code in fenv\manage_file.py
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def create_virtualenv(self):
    """
    It creates a virtual environment with the name you pass to it

    Args:
      virtual_env_name (str): The name of the virtual environment you want to create.

    Example:
        ```py
        create_virtualenv("virtual_env_name")
        ```
    Return:
        None
    """
    if os.path.exists(self.name):
        os.chdir(self.name)
        print(f"createing virtualenv env_{self.name}...")
        os.system(f"virtualenv env_{self.name}")
        EnvAll().create_lib_default_env()

    print(f'{self.notice}Successfully created the virtualenv "{self.name}"')

process_create_base_file_and_update

process_create_base_file_and_update()

If the state is create, create the files main.py, freeze.py, gitignore.py, and readme.md. If the state is update, update the file readme.md

Source code in fenv\manage_file.py
209
210
211
212
213
214
215
216
217
218
219
220
221
def process_create_base_file_and_update(self):
    """
    If the state is create, create the files main.py, freeze.py, gitignore.py, and readme.md. If the
    state is update, update the file readme.md
    """
    if self.state == "create":
        self.create_file_main_py()
        self.create_file_freeze()
        self.create_file_gitignore()
        self.create_file_readme_md()
        self.update_file_readme_md()
    elif self.state == "update":
        self.update_file_readme_md()

procress_only_create_project

procress_only_create_project()

It creates a virtual environment and a vscode settings file.

Source code in fenv\manage_file.py
223
224
225
226
227
228
229
230
231
def procress_only_create_project(self):
    """
    It creates a virtual environment and a vscode settings file.
    """
    if self.create_folder() != 1:
        self.create_virtualenv()
        self.create_setting_vscode()
        self.process_create_base_file_and_update()
        self.run_install_module_base()

run_install_module_base

run_install_module_base()

It installs the base Python modules

:param env: The environment object

Source code in fenv\manage_file.py
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def run_install_module_base(self):
    """
    It installs the base Python modules

    :param env: The environment object
    """

    if platform.system() == "Windows":
        self._extracted_from_run_install_module_base_9(
            ".\env_",
            "\Scripts\python.exe -m pip install -r requirements.txt",
            "\Scripts\python.exe -m pip freeze > requirements.txt",
            "\Scripts\python.exe -m pip install --upgrade pip",
        )
    elif platform.system() == "Linux":
        self._extracted_from_run_install_module_base_9(
            "bash -c 'source env_",
            "/bin/activate  && pip install -r requirements.txt'",
            "/bin/activate  && pip freeze > requirements.txt'",
            "/bin/activate  && pip install --upgrade pip'",
        )

update_file_readme_md

update_file_readme_md()

It update a file called readme.md and writes the markdown text to it

Source code in fenv\manage_file.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
def update_file_readme_md(self):
    """
    It update a file called readme.md and writes the markdown text to it
    """
    markdown_path = "readme.md"
    with open(markdown_path, "r", encoding="utf-8") as f:
        data = f.readlines()

    for i, v in enumerate(data):
        if "<!--- Start Tree --->" in v:
            first = i

        if "<!--- End Tree --->" in v:
            last = i

    data = data[: first + 1] + data[last:]

    for i, v in enumerate(data):
        if "<!--- Start Tree --->" in v:
            data[i] = self.commands.get_update_tree_path().format(
                self.name, self.generate_tree()
            )
    with open(markdown_path, "w", encoding="utf-8") as f:
        f.writelines(data)
    os.chmod(markdown_path, 0o777)

GitCloneVirtualENV

GitCloneVirtualENV(link)
Source code in fenv\manage_file.py
647
648
649
650
651
652
653
def __init__(self, link) -> None:
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.root_dir = EnvAll().get_root_dir_name()
    self.url = link
    self.name_repo = ""

cmd_git_clone

cmd_git_clone()

"A function that is called when the user runs the command "git clone"."

Source code in fenv\manage_file.py
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
def cmd_git_clone(self):
    """
    "A function that is called when the user runs the command "git clone"."
    """
    try:
        subprocess.run(
            [
                "git",
                "clone",
                self.url,
            ]
        )
        self.name_repo = self.url.split("/")[-1]

    except FileNotFoundError:
        print(
            f"The system cannot find the {self.colors.ORANGE}git {self.colors.ENDC}command, can be downloaded at : {self.colors.PURPLE}https://git-scm.com/downloads{self.colors.ENDC}"
        )

url_exists

url_exists()

The function "url_exists" is defined, but its implementation is missing.

Source code in fenv\manage_file.py
674
675
676
677
678
679
680
681
682
683
684
def url_exists(self):
    """
    The function "url_exists" is defined, but its implementation is missing.
    """
    try:
        urllib.request.urlopen(self.url)
        return True
    except urllib.error.HTTPError:
        return False
    except ValueError:
        return False

InstallModule

InstallModule(arg=None)

Module install module

Source code in fenv\manage_file.py
307
308
309
310
311
312
313
def __init__(self, arg=None) -> None:
    self.package_name = arg
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.env_directory = EnvAll().get_env_name()
    self.root_directory = EnvAll().get_root_dir_name()

add_module_to_txt

add_module_to_txt()

It takes the argument from the command line and adds it to the requirements.txt file

Parameters:

Name Type Description Default
args str

The arguments passed to the script

required
Example
add_module_to_txt("package_name")
Return

None

Source code in fenv\manage_file.py
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
def add_module_to_txt(self):
    """
    It takes the argument from the command line and adds it to the requirements.txt file
    Args:
        args (str): The arguments passed to the script

    Example:
        ```py
        add_module_to_txt("package_name")
        ```
    Return:
        None

    """
    if self.env_directory:
        if platform.system() == "Windows":
            os.system(
                f".\{self.env_directory}\Scripts\python.exe -m pip freeze > requirements.txt"
            )
        elif platform.system() == "Linux":
            os.system(
                f"bash -c 'source {self.env_directory}/bin/activate  && pip freeze > requirements.txt'"
            )
        print(
            self.notice
            + f'Successfully module {self.colors.PURPLE}{self.package_name.install}{self.colors.ENDC} added to "{self.colors.SEA_GREEN}requirements.txt{self.colors.ENDC}"'
        )

install_package_all

install_package_all()

install all packages in requirements.txt file using pip install -r requirements.txt

Source code in fenv\manage_file.py
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
def install_package_all(self):
    """
    install all packages in requirements.txt file using pip install -r requirements.txt
    """

    folder_name = "env*"
    folder_name_env = (
        fnmatch.filter(os.listdir("."), folder_name)
        if fnmatch.filter(os.listdir("."), folder_name) == []
        else str(fnmatch.filter(os.listdir("."), folder_name)[0])
    )
    requirements_file = "requirements.txt"

    def install_package_follow_env(folder_name_env):
        if platform.system() == "Windows":
            os.system(
                f".\{folder_name_env}\Scripts\python.exe -m pip install -r requirements.txt"
            )
        elif platform.system() == "Linux":
            os.system(
                f"bash -c 'source {folder_name_env}/bin/activate && pip install -r requirements.txt'"
            )

    def run_install_main(folder_name_env):
        if folder_name_env:
            print(
                f"Found directory  `{self.colors.SPRING_GREEN}{folder_name_env}{self.colors.ENDC}`"
            )
            print(
                f"Installing modules with  `{self.colors.SPRING_GREEN}{folder_name_env}{self.colors.ENDC}`"
            )
            install_package_follow_env(folder_name_env)
            print(
                f'{self.notice}Successfully installed module from {self.colors.SPRING_GREEN}"requirements.txt"{self.colors.ENDC}'
            )
        else:
            while True:
                response = input(
                    "We couldn't find the fenv virtual environment. Would you like to set up a new one? (y/n): "
                )
                if response.lower() in ["y", "yes", ""]:
                    OnlyVirtualEnv().run_process()
                    folder_name = "env*"
                    folder_name_env = str(
                        fnmatch.filter(os.listdir("."), folder_name)[0]
                    )
                    print(
                        f"Installing modules with  `{self.colors.SPRING_GREEN}{folder_name_env}{self.colors.ENDC}`"
                    )
                    install_package_follow_env(folder_name_env)
                    print(
                        f'{self.notice}Successfully installed modules from "requirements.txt"'
                    )
                    break
                elif response.lower() == "n":
                    os.system("pip install -r requirements.txt")
                    break

    if requirements_file in os.listdir("."):
        run_install_main(folder_name_env)
    else:
        print(
            f"Maybe you forgot to put the name of the package to ininstall? for example `{self.colors.MINT_GREEN}fenv ininstall{self.colors.OKBLUE} <package_name>{self.colors.ENDC}` \nOr you can use `{self.colors.MINT_GREEN}fenv ininstall{self.colors.ENDC}` alone. But there must be {self.colors.FAIL}{requirements_file}{self.colors.ENDC} in the current directory"
        )

install_package_only

install_package_only()

It tries to install a package, if it fails, it prints a message

args (str): The arguments passed to the command.

Example
install_package_only("package_name")
Return

None

Source code in fenv\manage_file.py
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
def install_package_only(self):
    """
    It tries to install a package, if it fails, it prints a message

    Args:
    args (str): The arguments passed to the command.
    Example:
        ```py
        install_package_only("package_name")
        ```
    Return:
        None
    """
    try:
        if self.env_directory:
            self.install_required_package()
            self.add_module_to_txt()
        else:
            while True:
                response = input(
                    "We couldn't find the fenv virtual environment. Would you like to set up a new one? (y/n): "
                )
                if response.lower() in ["y", "yes", ""]:
                    OnlyVirtualEnv().run_process()
                    folder_name = "env*"
                    folder_name_env = str(
                        fnmatch.filter(os.listdir("."), folder_name)[0]
                    )
                    self.install_required_package()
                    break
                elif response.lower() == "n":
                    self.install_required_package()
                    break
    except AttributeError as err:
        print(
            self.colors.SPRING_GREEN
            + "An error was encountered, it could not be installed."
            + self.colors.ENDC
        )

install_required_package

install_required_package()

It checks if the platform is Windows, if it is, it runs the command:

.{self.env_directory}\Scripts\python.exe -m pip install {self.package_name.install}

The problem is that it doesn't work

Source code in fenv\manage_file.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
def install_required_package(self):
    """
    It checks if the platform is Windows, if it is, it runs the command:

    <code>.\{self.env_directory}\Scripts\python.exe -m pip install
    {self.package_name.install}</code>

    The problem is that it doesn't work
    """
    print(
        f"{self.notice} Installing {self.colors.PURPLE}{self.package_name.install}{self.colors.ENDC}{self.colors.SEA_GREEN}"
    )
    try:
        if platform.system() == "Windows":
            os.system(
                rf".\{self.env_directory}\Scripts\python.exe -m pip install {self.package_name.install}"
            )
            print(
                f"{self.notice}Successfully installed {self.colors.PURPLE}{self.package_name.install}{self.colors.ENDC}"
            )
        elif platform.system() == "Linux":
            os.system(
                f"bash -c 'source {self.env_directory}/bin/activate  && pip install {self.package_name.install}'"
            )
            print(
                f"{self.notice} Successfully installed {self.colors.PURPLE}{self.package_name.install}{self.colors.ENDC}"
            )

    except TimeoutError as e:
        print(e)

OnlyVirtualEnv

OnlyVirtualEnv()

Module create only env

Source code in fenv\manage_file.py
237
238
239
240
241
242
def __init__(self):
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.env_directory = EnvAll().get_env_name()
    self.root_directory = EnvAll().get_root_dir_name()

create_name_env

create_name_env()

If the user enters a name for the virtualenv, the function will check if the name is in English only, if it is, it will return the name, if not, it will return a name automatically :return: The name of the virtual environment.

Source code in fenv\manage_file.py
254
255
256
257
258
259
260
261
262
263
264
265
266
267
def create_name_env(self) -> str:
    """
    If the user enters a name for the virtualenv, the function will check if the name is in English
    only, if it is, it will return the name, if not, it will return a name automatically
    :return: The name of the virtual environment.
    """
    self.name = input(
        "Enter a name for the virtualenv (english only) , leave it blank to create it automatically: "
    ).replace(" ", "_")

    if bool(re.match("^[A-Za-z0-9_#]+$", self.name)):
        return f"{self.name[:10]}"
    else:
        return self.create_name_env_auto()

create_name_env_auto

create_name_env_auto()

It creates a random name for the environment :return: A string

Source code in fenv\manage_file.py
244
245
246
247
248
249
250
251
252
def create_name_env_auto(self) -> str:
    """
    > It creates a random name for the environment
    :return: A string
    """
    self.name_ = random.choice(["samai", "danai"])
    self.middle_ = random.choice("_#")
    self.no_ = random.randint(0, 100)
    return f"{self.name_}{self.middle_}{self.no_}"

create_virtualenv_not_change_dir

create_virtualenv_not_change_dir()

It creates a virtual environment with the name you pass to it

Parameters:

Name Type Description Default
virtual_env_name str

The name of the virtual environment you want to create.

required
Example
create_virtualenv("virtual_env_name")
Return

None

Source code in fenv\manage_file.py
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
def create_virtualenv_not_change_dir(self):
    """
    It creates a virtual environment with the name you pass to it

    Args:
      virtual_env_name (str): The name of the virtual environment you want to create.

    Example:
        ```py
        create_virtualenv("virtual_env_name")
        ```
    Return:
        None
    """
    if not os.path.exists(self._name_env):
        print(f"virtualenv env_{self._name_env}")
        os.system(f"virtualenv env_{self._name_env}")
        EnvAll().create_lib_default_env()

    print(f'{self.notice}Successfully created the virtualenv "{self._name_env}"')

run_process

run_process()

It creates a virtual environment and a vscode settings file.

Source code in fenv\manage_file.py
290
291
292
293
294
295
296
297
298
299
300
301
def run_process(self):
    """
    It creates a virtual environment and a vscode settings file.
    """
    self._name_env = self.create_name_env()
    print(
        f"your env name is `{self.colors.MINT_GREEN}{self._name_env}{self.colors.ENDC}`"
    )
    self.create_virtualenv_not_change_dir()
    CreateFileBaseAndUpdate(
        os.path.basename(os.getcwd()), ""
    ).create_setting_vscode()

UninstallModule

UninstallModule(arg)
Source code in fenv\manage_file.py
481
482
483
484
485
486
487
def __init__(self, arg) -> None:
    self.package_name = arg
    self.colors = Colors()
    self.notice = Colors().notice()
    self.commands = Commands()
    self.env_directory = EnvAll().get_env_name()
    self.root_directory = EnvAll().get_root_dir_name()

cmd_uninstall_package

cmd_uninstall_package()

It uninstalls a package from the virtual environment

Parameters:

Name Type Description Default
args str

The arguments passed to the command

required
Example
cmd_uninstall_package("package_name")
Return

None

Source code in fenv\manage_file.py
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
def cmd_uninstall_package(self):
    """
    It uninstalls a package from the virtual environment

    Args:
        args (str): The arguments passed to the command
    Example:
        ```py
        cmd_uninstall_package("package_name")
        ```
    Return:
        None
    """

    try:
        package_dependency_list = self.pip_show_to_dict()["Requires"].split(", ")
        print(f"{self.notice}Uninstalling...{self.colors.ORANGE}")
        if platform.system() == "Windows":
            os.system(
                f".\{self.env_directory}\Scripts\python.exe -m pip uninstall {self.package_name.uninstall} -y"
            )
            for i in package_dependency_list:
                os.system(
                    f".\{self.env_directory}\Scripts\python.exe -m pip uninstall {i} -y"
                )

        elif platform.system() == "Linux":
            os.system(
                f"bash -c 'source {self.env_directory}/bin/activate && pip uninstall {self.package_name.uninstall} -y'"
            )
            for i in package_dependency_list:
                os.system(
                    f"bash -c 'source {self.env_directory}/bin/activate && pip uninstall {i} -y'"
                )
        print(
            self.notice
            + f"Successfully uninstalled module {self.colors.MINT_GREEN}{self.package_name.uninstall}{self.colors.ENDC}"
        )
    except TimeoutError:
        print(TimeoutError)

process_run

process_run()

"A function that is called when the user runs the command "uninstall"."

The first line of the function is a docstring. It's a string that describes what the function does. It's a good idea to include a docstring for every function you write

args (str): The arguments passed to the command

Example
process_run("package_name")
Return

None

Source code in fenv\manage_file.py
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
def process_run(self):
    """
    "A function that is called when the user runs the command "uninstall"."

    The first line of the function is a docstring. It's a string that describes what the function does.
    It's a good idea to include a docstring for every function you write

    Args:
    args (str): The arguments passed to the command
    Example:
        ```py
        process_run("package_name")
        ```
    Return:
        None
    """
    try:
        self.cmd_uninstall_package()
        self.remove_module_exit_txt()
    except AttributeError as err:
        print(err, "An error was encountered, it could not be uninstalled.")