Skip to content

Commit 031dc1e

Browse files
committed
Removed the public decorator from all modules. __all__ is now explicitly set in each module. Did not remove the public decorator itself from the public module in case others wish to still use it.
Changed tick.repeat.Status class to tick.repeat.RepeatStatus since Status is not very descriptive.
1 parent 729b61b commit 031dc1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+644
-243
lines changed

addons/source-python/packages/source-python/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
from excepthooks import ExceptHooks
3939

4040

41+
# =============================================================================
42+
# >> ALL DECLARATION
43+
# =============================================================================
44+
# Set all to an empty list
45+
__all__ = []
46+
47+
4148
# =============================================================================
4249
# >> LOGGING SETUP
4350
# =============================================================================

addons/source-python/packages/source-python/auth/manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python imports
7-
from public import public
87
# Auth
98
from auth import AuthLogger
109
from auth.paths import AUTH_PROVIDER_PATH
@@ -14,6 +13,15 @@
1413
from translations.strings import LangStrings
1514

1615

16+
# =============================================================================
17+
# >> ALL DECLARATION
18+
# =============================================================================
19+
# Add all the global variables to __all__
20+
__all__ = [
21+
'AuthManager',
22+
]
23+
24+
1725
# =============================================================================
1826
# >> GLOBAL VARIABLES
1927
# =============================================================================
@@ -27,7 +35,6 @@
2735
# =============================================================================
2836
# >> CLASSES
2937
# =============================================================================
30-
@public
3138
class _AuthManager(dict):
3239
'''Class used to store loaded auth providers
3340
and check if a player is authorized'''

addons/source-python/packages/source-python/auth/paths.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,25 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python imports
7-
from paths import SP_PACKAGES_PATH as _SP_PACKAGES_PATH
8-
from paths import CFG_PATH as _CFG_PATH
7+
from paths import SP_PACKAGES_PATH
8+
from paths import CFG_PATH
9+
10+
11+
# =============================================================================
12+
# >> ALL DECLARATION
13+
# =============================================================================
14+
# Add all the global variables to __all__
15+
__all__ = [
16+
'AUTH_CFG_PATH',
17+
'AUTH_PROVIDER_PATH',
18+
]
919

1020

1121
# =============================================================================
1222
# >> GLOBAL VARIABLES
1323
# =============================================================================
1424
# Store the path to the auth providers
15-
AUTH_PROVIDER_PATH = _SP_PACKAGES_PATH.joinpath('auth', 'providers')
25+
AUTH_PROVIDER_PATH = SP_PACKAGES_PATH.joinpath('auth', 'providers')
1626

1727
# Store the path to the auth configurations
18-
AUTH_CFG_PATH = _CFG_PATH.joinpath('auth_providers')
19-
20-
# Add all paths to __all__
21-
__all__ = [x for x in globals() if x.isupper() and not x.startswith('_')]
28+
AUTH_CFG_PATH = CFG_PATH.joinpath('auth_providers')

addons/source-python/packages/source-python/auth/providers/simple.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@
1212
from auth.paths import AUTH_CFG_PATH
1313

1414

15+
# =============================================================================
16+
# >> ALL DECLARATION
17+
# =============================================================================
18+
# Set all to an empty list
19+
__all__ = []
20+
21+
1522
# =============================================================================
1623
# >> GLOBAL VARIABLES
1724
# =============================================================================
1825
# Store the path to the simple.txt file
19-
SIMPLE_FILE_PATH = AUTH_CFG_PATH.joinpath('simple.txt')
26+
_SIMPLE_FILE_PATH = AUTH_CFG_PATH.joinpath('simple.txt')
2027

2128

2229
# =============================================================================
@@ -31,7 +38,7 @@ def _parse_admins(self):
3138
'''
3239

3340
# Open the simple auth config file
34-
with SIMPLE_FILE_PATH.open() as auth_file:
41+
with _SIMPLE_FILE_PATH.open() as auth_file:
3542

3643
# Loop through each line in the file
3744
for line in auth_file.readlines():
@@ -58,9 +65,9 @@ def is_player_authorized(self, uniqueid, level, permission, flag):
5865
return False
5966

6067
# Get the _SimpleAuth instance
61-
SimpleAuth = _SimpleAuth()
68+
_SimpleAuthInstance = _SimpleAuth()
6269

63-
is_player_authorized = SimpleAuth.is_player_authorized
70+
is_player_authorized = _SimpleAuthInstance.is_player_authorized
6471

6572

6673
# =============================================================================
@@ -70,11 +77,11 @@ def load():
7077
'''Loads the provider by getting all uniqueids that are authorized'''
7178

7279
# Parse the simple auth file
73-
SimpleAuth._parse_admins()
80+
_SimpleAuthInstance._parse_admins()
7481

7582

7683
def unload():
7784
'''Unloads the provider by clearing the set'''
7885

7986
# Clear the set
80-
SimpleAuth.clear()
87+
_SimpleAuthInstance.clear()

addons/source-python/packages/source-python/commands/client/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
# =============================================================================
1414
# >> ALL DECLARATION
1515
# =============================================================================
16-
# Add all imported classes to all
17-
__all__ = list(globals())
16+
# Add all the global variables to __all__
17+
__all__ = [
18+
'ClientCommand',
19+
'ClientCommandFilter',
20+
'ClientCommandManager',
21+
]

addons/source-python/packages/source-python/commands/client/command.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python Imports
7-
from public import public
87
# Commands
98
from commands.command import _BaseCommand
109
from commands.client.manager import ClientCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'ClientCommand',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class ClientCommand(_BaseCommand):
1825
'''Decorator class used to register a client command'''
1926

addons/source-python/packages/source-python/commands/client/filter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python Imports
7-
from public import public
87
# Commands
98
from commands.filter import _BaseFilter
109
from commands.client.manager import ClientCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'ClientCommandFilter',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class ClientCommandFilter(_BaseFilter):
1825
'''Class used to register a client command filter'''
1926

addons/source-python/packages/source-python/commands/client/manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@
77
from command_c import get_client_command
88
from command_c import register_client_command_filter
99
from command_c import unregister_client_command_filter
10-
from public import public
1110
# Commands
1211
from commands.player import _PlayerCommandManager
1312

1413

14+
# =============================================================================
15+
# >> ALL DECLARATION
16+
# =============================================================================
17+
# Add all the global variables to __all__
18+
__all__ = [
19+
'ClientCommandManager',
20+
]
21+
22+
1523
# =============================================================================
1624
# >> CLASSES
1725
# =============================================================================
18-
@public
1926
class _ClientCommandManager(_PlayerCommandManager):
2027
'''Manager class used to register client
2128
commands and client command filters'''

addons/source-python/packages/source-python/commands/say/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
# =============================================================================
1414
# >> ALL DECLARATION
1515
# =============================================================================
16-
# Add all imported classes to all
17-
__all__ = list(globals())
16+
# Add all the global variables to __all__
17+
__all__ = [
18+
'SayCommand',
19+
'SayCommandManager',
20+
'SayFilter',
21+
]

addons/source-python/packages/source-python/commands/say/command.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python Imports
7-
from public import public
87
# Commands
98
from commands.command import _BaseCommand
109
from commands.say.manager import SayCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'SayCommand',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class SayCommand(_BaseCommand):
1825
'''Decorator class used to register a say command'''
1926

addons/source-python/packages/source-python/commands/say/filter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python Imports
7-
from public import public
87
# Commands
98
from commands.filter import _BaseFilter
109
from commands.say.manager import SayCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'SayFilter',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class SayFilter(_BaseFilter):
1825
'''Class used to register a say filter'''
1926

addons/source-python/packages/source-python/commands/say/manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@
77
from command_c import get_say_command
88
from command_c import register_say_filter
99
from command_c import unregister_say_filter
10-
from public import public
1110
# Commands
1211
from commands.player import _PlayerCommandManager
1312

1413

14+
# =============================================================================
15+
# >> ALL DECLARATION
16+
# =============================================================================
17+
# Add all the global variables to __all__
18+
__all__ = [
19+
'SayCommandManager',
20+
]
21+
22+
1523
# =============================================================================
1624
# >> CLASSES
1725
# =============================================================================
18-
@public
1926
class _SayCommandManager(_PlayerCommandManager):
2027
'''Manager class used to register say commands and say filters'''
2128

addons/source-python/packages/source-python/commands/server/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
# =============================================================================
1313
# >> ALL DECLARATION
1414
# =============================================================================
15-
# Add all imported classes to all
16-
__all__ = list(globals())
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'ServerCommand',
18+
'ServerCommandManager',
19+
]

addons/source-python/packages/source-python/commands/server/command.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
# >> IMPORTS
55
# =============================================================================
66
# Source.Python Imports
7-
from public import public
87
# Commands
98
from commands.command import _BaseCommand
109
from commands.server.manager import ServerCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'ServerCommand',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class ServerCommand(_BaseCommand):
1825
'''Decorator class used to register a server command'''
1926

addons/source-python/packages/source-python/commands/server/manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@
55
# =============================================================================
66
# Source.Python Imports
77
from command_c import get_server_command
8-
from public import public
98
# Commands
109
from commands.manager import _BaseCommandManager
1110

1211

12+
# =============================================================================
13+
# >> ALL DECLARATION
14+
# =============================================================================
15+
# Add all the global variables to __all__
16+
__all__ = [
17+
'ServerCommandManager',
18+
]
19+
20+
1321
# =============================================================================
1422
# >> CLASSES
1523
# =============================================================================
16-
@public
1724
class _ServerCommandManager(_BaseCommandManager):
1825
'''Manager class used to register server commands'''
1926

0 commit comments

Comments
 (0)