Skip to content

Commit 66db63d

Browse files
committed
Applied minor improvements
1 parent 6895973 commit 66db63d

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><img src="https://github.com/dhondta/python-sploitkit/raw/main/docs/pages/img/logo.png"></p>
1+
<p align="center" id="top"><img src="https://github.com/dhondta/python-sploitkit/raw/main/docs/pages/img/logo.png"></p>
22
<h1 align="center">SploitKit <a href="https://twitter.com/intent/tweet?text=SploitKit%20-%20Devkit%20for%20building%20Metasploit-like%20consoles.%0D%0APython%20library%20for%20easilly%20building%20framework%20consoles%20in%20a%20Metasploit-like%20style%20with%20a%20comprehensive%20API.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-sploitkit%0D%0A&hashtags=python,programming,devkit,framework,console,ctftools"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=twitter&style=social" alt="Tweet" height="20"/></a></h1>
33
<h3 align="center">Make a Metasploit-like console.</h3>
44

@@ -86,4 +86,4 @@ Sploitkit defines multiple types of entities for various purposes. The following
8686

8787
[![Forkers repo roster for @dhondta/python-sploitkit](https://reporoster.com/forks/dark/dhondta/python-sploitkit)](https://github.com/dhondta/python-sploitkit/network/members)
8888

89-
<p align="center"><a href="#"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>
89+
<p align="center"><a href="#top"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ classifiers = [
3030
"Intended Audience :: Information Technology",
3131
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
3232
"Programming Language :: Python :: 3",
33-
"Programming Language :: Python :: 3.8",
34-
"Programming Language :: Python :: 3.9",
35-
"Programming Language :: Python :: 3.10",
36-
"Programming Language :: Python :: 3.11",
37-
"Programming Language :: Python :: 3.12",
3833
"Topic :: Software Development :: Libraries :: Python Modules",
3934
]
4035
dependencies = [

src/sploitkit/core/entity.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def load_entities(entities, *sources, **kwargs):
4545
# load every single source (folder of modules or single module)
4646
for s in sources:
4747
if not s.exists():
48-
logger.debug("Source does not exist: %s" % s)
48+
logger.debug(f"Source does not exist: {s}")
4949
continue
5050
# bind the source to the entity main class
5151
for e in entities:
5252
e._source = str(s)
5353
# now, it loads every Python module from the list of source folders ; when loading entity subclasses, these are
5454
# registered to entity's registry for further use (i.e. from the console)
55-
logger.debug("Loading Python source: %s" % s)
55+
logger.debug(f"Loading Python source: {s}")
5656
# important note: since version 1.23.17 of Tinyscript, support for cached compiled Python files has been added,
5757
# for the PythonPath class, therefore influencing the location path of loaded entities (that
5858
# is, adding __pycache__)
@@ -66,16 +66,16 @@ def load_entities(entities, *sources, **kwargs):
6666
n = e.__name__.lower()
6767
for c in e.subclasses[:]:
6868
if len(c.__subclasses__()) > 0:
69-
getattr(e, "unregister_%s" % n, Entity.unregister_subclass)(c)
69+
getattr(e, f"unregister_{n}", Entity.unregister_subclass)(c)
7070
# handle specific entities or sets of entities exclusions ; this will remove them from Entity's registries
7171
excludes = kwargs.get("exclude", {}).get(n)
7272
if excludes is not None:
73-
getattr(e, "unregister_%ss" % n, Entity.unregister_subclasses)(*excludes)
73+
getattr(e, f"unregister_{n}s", Entity.unregister_subclasses)(*excludes)
7474
# handle conditional entities ; this will remove entities having a "condition" method returning False
7575
for c in e.subclasses[:]:
7676
# convention: conditional entities are unregistered and removed
7777
if hasattr(c, "condition") and not c().condition():
78-
getattr(e, "unregister_%s" % n, Entity.unregister_subclass)(c)
78+
getattr(e, f"unregister_{n}", Entity.unregister_subclass)(c)
7979
# now populate metadata for each class
8080
for c in e.subclasses:
8181
set_metadata(c, kwargs.get("docstr_parser", parse_docstring))
@@ -593,7 +593,7 @@ def __new__(meta, name, bases, clsdict, subcls=None):
593593
return subcls
594594

595595
def __repr__(self):
596-
return "<%s: %s>" % (self.entity.capitalize(), self.__name__)
596+
return f"<{self.entity.capitalize()}: {self.__name__}>"
597597

598598
@property
599599
def entity(self):

0 commit comments

Comments
 (0)