Code completion doesn't work with Source.Python

All other Source.Python topics and issues.
User avatar
khaimovmr
Junior Member
Posts: 27
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Code completion doesn't work with Source.Python

Postby khaimovmr » Sun Mar 04, 2018 7:52 pm

Hi, guys.
I'm developing some plugins on Source.Python in Ubuntu.
I have some problems with the development process.
For example, IDE, that I'm using can't automatically find all the packages that's I'm using (from the Source.Python itself, from the "site-packages" folder and from the Python3 folder in the repo).
My usual workflow is to set up a virtual environment with all usable packages and when I'm editing the code vim is automatically resolving the code dependencies and autocomplete is working fine.

Sorry for too much words...
My question - Is there a workarounds that you're using to make you auto-completion work without adding all three folders that I've mentioned above into the $PATH and without copying these packages into your working directory?
User avatar
Ayuto
Project Leader
Posts: 2023
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Code completion doesn't work with Source.Python

Postby Ayuto » Sun Mar 04, 2018 9:03 pm

I can't help you with that question, but you should also keep in mind that a lot functions, classes, etc. is provided by core.dll/so at runtime. So, even if you have setup the three folders correctly, auto-completion will still not work correctly.
User avatar
khaimovmr
Junior Member
Posts: 27
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: Code completion doesn't work with Source.Python

Postby khaimovmr » Sat May 04, 2019 2:56 pm

Isn't there a reason to create a dummy libraries for such core.dll/so functions, objects, e.t.c? Just to have a reference for the objects that we can use.
User avatar
BackRaw
Senior Member
Posts: 527
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: Code completion doesn't work with Source.Python

Postby BackRaw » Sun May 05, 2019 12:14 pm

khaimovmr wrote:Isn't there a reason to create a dummy libraries for such core.dll/so functions, objects, e.t.c? Just to have a reference for the objects that we can use.

You could do that, yes, but each time the core API changes you'd have to change the dummy libraries as well.

Well, maybe we could automate that somehow. I'll look into it. Seems like a nice side project.
User avatar
Ayuto
Project Leader
Posts: 2023
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Code completion doesn't work with Source.Python

Postby Ayuto » Sun May 05, 2019 1:34 pm

BackRaw wrote:Well, maybe we could automate that somehow. I'll look into it. Seems like a nice side project.

Everything else would be crazy :grin:
User avatar
Ayuto
Project Leader
Posts: 2023
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Code completion doesn't work with Source.Python

Postby Ayuto » Sun May 05, 2019 3:44 pm

This is what I have got so far:

Syntax: Select all

# TODO:
# 1. Handle class ordering (base of class A must be defined before A)
# 2. Handle more types

import inspect


ROUTINE_TEMPLATE = """def {name}(*args, **kwargs):
pass"""

CLASS_TEMPLATE = """class {name}({bases}):"""

IMPORT_TEMPLATE = """from {module} import {cls}"""

PROPERTY_GET_TEMPLATE = """@property
def {name}(self):
pass"""

PROPERTY_SET_TEMPLATE = """@{name}.setter
def {name}(self, value):
pass"""

UNKNOWN_TEMPLATE = """{name} = None"""

METHOD_TEMPLATE = """def {name}(self, *args, **kwargs):
pass"""

INT_TEMPLATE = """{name} = {value}"""

STR_TEMPLATE = """{name} = {value}"""

FLOAT_TEMPLATE = """{name} = {value}"""

FORBIDDEN_NAMES = ['__slots__']


class ModuleSkeletonGenerator(object):
def __init__(self, module):
self.module = module
self.bases = set()

def create_sekeleton(self):
buffer = ''

for name in dir(self.module):
obj = getattr(self.module, name)

if inspect.isroutine(obj):
buffer += self._handle_routine(name, obj)
elif inspect.isclass(obj):
buffer += self._handle_class(name, obj)
elif name in FORBIDDEN_NAMES:
continue
else:
buffer += self._handle_unknown(name, obj)

buffer += '\n'

# Add import statements
for base in self.bases:
# Skip Boost.Python base classes and built-ins
if base.__module__ in ('Boost.Python', '__builtin__'):
continue

# Skips classes from this module
if base.__module__ == self.module.__name__:
continue

buffer = self._handle_import(base.__name__, base) + '\n' + buffer

return buffer

def _handle_routine(self, name, func):
return ROUTINE_TEMPLATE.format(name=name)

def _handle_class(self, name, cls):
self.bases.update(cls.__bases__)

bases = set()
for base in cls.__bases__:
if base.__module__ == 'Boost.Python':
base = object

bases.add(base)

buffer = CLASS_TEMPLATE.format(
name=name,
bases=','.join(base.__name__ for base in bases)) + '\n'

for name in dir(cls):
obj = getattr(cls, name)

if inspect.isdatadescriptor(obj) or inspect.isgetsetdescriptor(obj) or inspect.ismemberdescriptor(obj):
buffer += self._handle_property(name, obj)
elif inspect.isroutine(obj):
buffer += self._handle_method(name, obj)
elif isinstance(obj, int):
buffer += self._handle_int(name, obj)
elif isinstance(obj, str):
buffer += self._handle_str(name, obj)
elif isinstance(obj, float):
buffer += self._handle_float(name, obj)
elif name in FORBIDDEN_NAMES:
continue
else:
buffer += self._handle_unknown(name, obj)

buffer += '\n'

# TODO:
# Cheap way to get proper indentions. This won't work for multi line strings
return buffer.replace('\n', '\n ')

def _handle_import(self, name, obj):
return IMPORT_TEMPLATE.format(
module=obj.__module__,
cls=name)

def _handle_property(self, name, obj):
get_template = PROPERTY_GET_TEMPLATE.format(name=name)
set_template = PROPERTY_SET_TEMPLATE.format(name=name)
return f'{get_template}\n{set_template}'

def _handle_unknown(self, name, obj):
return UNKNOWN_TEMPLATE.format(name=name)

def _handle_method(self, name, obj):
return METHOD_TEMPLATE.format(name=name)

def _handle_int(self, name, obj):
return INT_TEMPLATE.format(name=name, value=int(obj))

def _handle_str(self, name, obj):
obj = str(obj)

# Handle multi line strings
if '\n' in obj:
obj = f'"""{obj}"""'
else:
obj = f'\'{obj}\''

return STR_TEMPLATE.format(name=name, value=obj)

def _handle_float(self, name, obj):
return INT_TEMPLATE.format(name=name, value=float(obj))



# Test
from _engines import _server

with open('c:/tmp/out.py', 'w') as f:
generator = ModuleSkeletonGenerator(_server)
f.write(generator.create_sekeleton())
Not sure if there is a better way...

This is the current output:

Syntax: Select all

class ConnectionlessPacketHandler(object):
__class__ = None
def __delattr__(self, *args, **kwargs):
pass
__dict__ = None
def __dir__(self, *args, **kwargs):
pass
__doc__ = None
def __eq__(self, *args, **kwargs):
pass
def __format__(self, *args, **kwargs):
pass
def __ge__(self, *args, **kwargs):
pass
def __getattribute__(self, *args, **kwargs):
pass
def __gt__(self, *args, **kwargs):
pass
def __hash__(self, *args, **kwargs):
pass
def __init__(self, *args, **kwargs):
pass
def __init_subclass__(self, *args, **kwargs):
pass
def __le__(self, *args, **kwargs):
pass
def __lt__(self, *args, **kwargs):
pass
__module__ = '_engines._server'
def __ne__(self, *args, **kwargs):
pass
def __new__(self, *args, **kwargs):
pass
def __reduce__(self, *args, **kwargs):
pass
def __reduce_ex__(self, *args, **kwargs):
pass
def __repr__(self, *args, **kwargs):
pass
def __setattr__(self, *args, **kwargs):
pass
def __sizeof__(self, *args, **kwargs):
pass
def __str__(self, *args, **kwargs):
pass
def __subclasshook__(self, *args, **kwargs):
pass
@property
def __weakref__(self):
pass
@__weakref__.setter
def __weakref__(self, value):
pass

class QueryCvarStatus(object):
INVALID = 2
NOT_FOUND = 1
PROTECTED = 3
SUCCESS = 0
def __abs__(self, *args, **kwargs):
pass
def __add__(self, *args, **kwargs):
pass
def __and__(self, *args, **kwargs):
pass
def __bool__(self, *args, **kwargs):
pass
def __ceil__(self, *args, **kwargs):
pass
__class__ = None
def __delattr__(self, *args, **kwargs):
pass
def __dir__(self, *args, **kwargs):
pass
def __divmod__(self, *args, **kwargs):
pass
__doc__ = None
def __eq__(self, *args, **kwargs):
pass
def __float__(self, *args, **kwargs):
pass
def __floor__(self, *args, **kwargs):
pass
def __floordiv__(self, *args, **kwargs):
pass
def __format__(self, *args, **kwargs):
pass
def __ge__(self, *args, **kwargs):
pass
def __getattribute__(self, *args, **kwargs):
pass
def __getnewargs__(self, *args, **kwargs):
pass
def __gt__(self, *args, **kwargs):
pass
def __hash__(self, *args, **kwargs):
pass
def __index__(self, *args, **kwargs):
pass
def __init__(self, *args, **kwargs):
pass
def __init_subclass__(self, *args, **kwargs):
pass
def __int__(self, *args, **kwargs):
pass
def __invert__(self, *args, **kwargs):
pass
def __le__(self, *args, **kwargs):
pass
def __lshift__(self, *args, **kwargs):
pass
def __lt__(self, *args, **kwargs):
pass
def __mod__(self, *args, **kwargs):
pass
__module__ = '_engines._server'
def __mul__(self, *args, **kwargs):
pass
def __ne__(self, *args, **kwargs):
pass
def __neg__(self, *args, **kwargs):
pass
def __new__(self, *args, **kwargs):
pass
def __or__(self, *args, **kwargs):
pass
def __pos__(self, *args, **kwargs):
pass
def __pow__(self, *args, **kwargs):
pass
def __radd__(self, *args, **kwargs):
pass
def __rand__(self, *args, **kwargs):
pass
def __rdivmod__(self, *args, **kwargs):
pass
def __reduce__(self, *args, **kwargs):
pass
def __reduce_ex__(self, *args, **kwargs):
pass
def __repr__(self, *args, **kwargs):
pass
def __rfloordiv__(self, *args, **kwargs):
pass
def __rlshift__(self, *args, **kwargs):
pass
def __rmod__(self, *args, **kwargs):
pass
def __rmul__(self, *args, **kwargs):
pass
def __ror__(self, *args, **kwargs):
pass
def __round__(self, *args, **kwargs):
pass
def __rpow__(self, *args, **kwargs):
pass
def __rrshift__(self, *args, **kwargs):
pass
def __rshift__(self, *args, **kwargs):
pass
def __rsub__(self, *args, **kwargs):
pass
def __rtruediv__(self, *args, **kwargs):
pass
def __rxor__(self, *args, **kwargs):
pass
def __setattr__(self, *args, **kwargs):
pass
def __sizeof__(self, *args, **kwargs):
pass
def __str__(self, *args, **kwargs):
pass
def __sub__(self, *args, **kwargs):
pass
def __subclasshook__(self, *args, **kwargs):
pass
def __truediv__(self, *args, **kwargs):
pass
def __trunc__(self, *args, **kwargs):
pass
def __xor__(self, *args, **kwargs):
pass
def bit_length(self, *args, **kwargs):
pass
def conjugate(self, *args, **kwargs):
pass
@property
def denominator(self):
pass
@denominator.setter
def denominator(self, value):
pass
def from_bytes(self, *args, **kwargs):
pass
@property
def imag(self):
pass
@imag.setter
def imag(self, value):
pass
@property
def name(self):
pass
@name.setter
def name(self, value):
pass
names = None
@property
def numerator(self):
pass
@numerator.setter
def numerator(self, value):
pass
@property
def real(self):
pass
@real.setter
def real(self, value):
pass
def to_bytes(self, *args, **kwargs):
pass
values = None

class Server(ConnectionlessPacketHandler):
__class__ = None
def __delattr__(self, *args, **kwargs):
pass
__dict__ = None
def __dir__(self, *args, **kwargs):
pass
__doc__ = None
def __eq__(self, *args, **kwargs):
pass
def __format__(self, *args, **kwargs):
pass
def __ge__(self, *args, **kwargs):
pass
def __getattribute__(self, *args, **kwargs):
pass
def __gt__(self, *args, **kwargs):
pass
def __hash__(self, *args, **kwargs):
pass
def __init__(self, *args, **kwargs):
pass
def __init_subclass__(self, *args, **kwargs):
pass
def __le__(self, *args, **kwargs):
pass
def __lt__(self, *args, **kwargs):
pass
__module__ = '_engines._server'
def __ne__(self, *args, **kwargs):
pass
def __new__(self, *args, **kwargs):
pass
def __reduce__(self, *args, **kwargs):
pass
def __reduce_ex__(self, *args, **kwargs):
pass
def __repr__(self, *args, **kwargs):
pass
def __setattr__(self, *args, **kwargs):
pass
def __sizeof__(self, *args, **kwargs):
pass
def __str__(self, *args, **kwargs):
pass
def __subclasshook__(self, *args, **kwargs):
pass
@property
def __weakref__(self):
pass
@__weakref__.setter
def __weakref__(self, value):
pass
def _obj(self, *args, **kwargs):
pass
def _ptr(self, *args, **kwargs):
pass
_size = 4
def broadcast_message(self, *args, **kwargs):
pass
@property
def class_bits(self):
pass
@class_bits.setter
def class_bits(self, value):
pass
@property
def client_count(self):
pass
@client_count.setter
def client_count(self, value):
pass
def disconnect_client(self, *args, **kwargs):
pass
def get_client(self, *args, **kwargs):
pass
def get_player_info(self, *args, **kwargs):
pass
def is_active(self, *args, **kwargs):
pass
def is_dedicated(self, *args, **kwargs):
pass
def is_hltv(self, *args, **kwargs):
pass
def is_loading(self, *args, **kwargs):
pass
def is_multiplayer(self, *args, **kwargs):
pass
def is_pausable(self, *args, **kwargs):
pass
@property
def map_name(self):
pass
@map_name.setter
def map_name(self, value):
pass
@property
def max_clients(self):
pass
@max_clients.setter
def max_clients(self, value):
pass
@property
def name(self):
pass
@name.setter
def name(self, value):
pass
@property
def net_stats(self):
pass
@net_stats.setter
def net_stats(self, value):
pass
@property
def num_classes(self):
pass
@num_classes.setter
def num_classes(self, value):
pass
@property
def num_clients(self):
pass
@num_clients.setter
def num_clients(self, value):
pass
@property
def num_fake_clients(self):
pass
@num_fake_clients.setter
def num_fake_clients(self, value):
pass
@property
def num_players(self):
pass
@num_players.setter
def num_players(self, value):
pass
@property
def num_proxies(self):
pass
@num_proxies.setter
def num_proxies(self, value):
pass
@property
def password(self):
pass
@password.setter
def password(self, value):
pass
@property
def paused(self):
pass
@paused.setter
def paused(self, value):
pass
@property
def spawn_count(self):
pass
@spawn_count.setter
def spawn_count(self, value):
pass
@property
def tick(self):
pass
@tick.setter
def tick(self, value):
pass
@property
def tick_interval(self):
pass
@tick_interval.setter
def tick_interval(self, value):
pass
@property
def time(self):
pass
@time.setter
def time(self, value):
pass
@property
def udp_port(self):
pass
@udp_port.setter
def udp_port(self, value):
pass

class _EngineServer(object):
__class__ = None
def __delattr__(self, *args, **kwargs):
pass
__dict__ = None
def __dir__(self, *args, **kwargs):
pass
__doc__ = None
def __eq__(self, *args, **kwargs):
pass
def __format__(self, *args, **kwargs):
pass
def __ge__(self, *args, **kwargs):
pass
def __getattribute__(self, *args, **kwargs):
pass
def __gt__(self, *args, **kwargs):
pass
def __hash__(self, *args, **kwargs):
pass
def __init__(self, *args, **kwargs):
pass
def __init_subclass__(self, *args, **kwargs):
pass
def __le__(self, *args, **kwargs):
pass
def __lt__(self, *args, **kwargs):
pass
__module__ = '_engines._server'
def __ne__(self, *args, **kwargs):
pass
def __new__(self, *args, **kwargs):
pass
def __reduce__(self, *args, **kwargs):
pass
def __reduce_ex__(self, *args, **kwargs):
pass
def __repr__(self, *args, **kwargs):
pass
def __setattr__(self, *args, **kwargs):
pass
def __sizeof__(self, *args, **kwargs):
pass
def __str__(self, *args, **kwargs):
pass
def __subclasshook__(self, *args, **kwargs):
pass
@property
def __weakref__(self):
pass
@__weakref__.setter
def __weakref__(self, value):
pass
def _obj(self, *args, **kwargs):
pass
def _ptr(self, *args, **kwargs):
pass
_size = 4
@property
def achievement_mgr(self):
pass
@achievement_mgr.setter
def achievement_mgr(self, value):
pass
def add_origin_to_pvs(self, *args, **kwargs):
pass
def alloc_level_static_data(self, *args, **kwargs):
pass
def allow_immediate_edict_reuse(self, *args, **kwargs):
pass
@property
def app_id(self):
pass
@app_id.setter
def app_id(self, value):
pass
def build_entity_cluster_list(self, *args, **kwargs):
pass
def change_level(self, *args, **kwargs):
pass
def check_areas_connected(self, *args, **kwargs):
pass
def check_box_in_pvs(self, *args, **kwargs):
pass
def check_head_node_visible(self, *args, **kwargs):
pass
def check_origin_in_pvs(self, *args, **kwargs):
pass
def clean_up_entity_cluster_list(self, *args, **kwargs):
pass
def clear_save_dir_after_client_load(self, *args, **kwargs):
pass
def client_command(self, *args, **kwargs):
pass
def client_command_key_values(self, *args, **kwargs):
pass
def client_printf(self, *args, **kwargs):
pass
@property
def cluster_count(self):
pass
@cluster_count.setter
def cluster_count(self, value):
pass
def con_nprintf(self, *args, **kwargs):
pass
def con_nxprintf(self, *args, **kwargs):
pass
def create_edict(self, *args, **kwargs):
pass
def create_fake_client(self, *args, **kwargs):
pass
def create_fake_client_ex(self, *args, **kwargs):
pass
def create_spatial_partition(self, *args, **kwargs):
pass
def crosshair_angle(self, *args, **kwargs):
pass
def destroy_spatial_partition(self, *args, **kwargs):
pass
def draw_map_to_scratch_pad(self, *args, **kwargs):
pass
def emit_ambient_sound(self, *args, **kwargs):
pass
def ensure_instance_baseline(self, *args, **kwargs):
pass
@property
def entity_count(self):
pass
@entity_count.setter
def entity_count(self, value):
pass
def fade_client_volume(self, *args, **kwargs):
pass
def force_exact_file(self, *args, **kwargs):
pass
def force_flush_entity(self, *args, **kwargs):
pass
def force_model_bounds(self, *args, **kwargs):
pass
def force_simple_material(self, *args, **kwargs):
pass
@property
def game_server_steamid(self):
pass
@game_server_steamid.setter
def game_server_steamid(self, value):
pass
def get_area(self, *args, **kwargs):
pass
def get_area_bits(self, *args, **kwargs):
pass
def get_area_portal_plane(self, *args, **kwargs):
pass
def get_change_accessor(self, *args, **kwargs):
pass
def get_client_convar_value(self, *args, **kwargs):
pass
def get_client_cross_play_platform(self, *args, **kwargs):
pass
def get_client_steamid(self, *args, **kwargs):
pass
def get_client_xuid(self, *args, **kwargs):
pass
def get_cluster_for_origin(self, *args, **kwargs):
pass
def get_engine_hltv_info(self, *args, **kwargs):
pass
def get_entity_transmit_bits_for_client(self, *args, **kwargs):
pass
def get_loading_process_for_userid(self, *args, **kwargs):
pass
def get_paint_map_data_rle(self, *args, **kwargs):
pass
def get_player_info(self, *args, **kwargs):
pass
def get_player_net_info(self, *args, **kwargs):
pass
def get_prev_check_transmit_info(self, *args, **kwargs):
pass
def get_pvs_for_cluster(self, *args, **kwargs):
pass
def get_replayis_creating_xbox_reslist(self, *args, **kwargs):
pass
def get_single_player_shared_memory_space(self, *args, **kwargs):
pass
def get_split_screen_player_for_edict(self, *args, **kwargs):
pass
def has_paint_map(self, *args, **kwargs):
pass
def host_validated_session(self, *args, **kwargs):
pass
def is_active_app(self, *args, **kwargs):
pass
def is_any_client_low_violence(self, *args, **kwargs):
pass
def is_client_fully_authenticated(self, *args, **kwargs):
pass
def is_creating_reslist(self, *args, **kwargs):
pass
def is_decal_precached(self, *args, **kwargs):
pass
def is_dedicated_server(self, *args, **kwargs):
pass
def is_dedicated_server_for_ps3(self, *args, **kwargs):
pass
def is_dedicated_server_for_xbox(self, *args, **kwargs):
pass
def is_generic_precached(self, *args, **kwargs):
pass
def is_in_edit_mode(self, *args, **kwargs):
pass
def is_internal_build(self, *args, **kwargs):
pass
def is_level_main_menu_background(self, *args, **kwargs):
pass
def is_log_enabled(self, *args, **kwargs):
pass
def is_low_violence(self, *args, **kwargs):
pass
def is_map_valid(self, *args, **kwargs):
pass
def is_model_precached(self, *args, **kwargs):
pass
def is_override_load_game_ents_on(self, *args, **kwargs):
pass
def is_paused(self, *args, **kwargs):
pass
def is_split_screen_player(self, *args, **kwargs):
pass
def is_userid_in_use(self, *args, **kwargs):
pass
def latency_for_choreo_sounds(self, *args, **kwargs):
pass
@property
def launch_options(self):
pass
@launch_options.setter
def launch_options(self, value):
pass
def light_style(self, *args, **kwargs):
pass
def load_adjacent_ents(self, *args, **kwargs):
pass
def load_game_state(self, *args, **kwargs):
pass
def load_paint_map_data_rle(self, *args, **kwargs):
pass
def lock_network_string_tables(self, *args, **kwargs):
pass
def log_print(self, *args, **kwargs):
pass
@property
def map_entities_string(self):
pass
@map_entities_string.setter
def map_entities_string(self, value):
pass
def message_determine_multicast_recipients(self, *args, **kwargs):
pass
def multiplayer_end_game(self, *args, **kwargs):
pass
def notify_edict_flags_change(self, *args, **kwargs):
pass
def paint_all_surfaces(self, *args, **kwargs):
pass
def pause(self, *args, **kwargs):
pass
def playback_temp_entity(self, *args, **kwargs):
pass
def precache_decal(self, *args, **kwargs):
pass
def precache_generic(self, *args, **kwargs):
pass
def precache_model(self, *args, **kwargs):
pass
def refresh_screen_if_necessary(self, *args, **kwargs):
pass
def remove_all_paint(self, *args, **kwargs):
pass
def remove_edict(self, *args, **kwargs):
pass
def replay(self, *args, **kwargs):
pass
def reserve_server_for_queued_game(self, *args, **kwargs):
pass
def reset_pvs(self, *args, **kwargs):
pass
def send_paint_map_data_to_client(self, *args, **kwargs):
pass
def sentence_group_index_from_name(self, *args, **kwargs):
pass
def sentence_group_name_from_index(self, *args, **kwargs):
pass
def sentence_group_pick(self, *args, **kwargs):
pass
def sentence_group_pick_sequential(self, *args, **kwargs):
pass
def sentence_index_from_name(self, *args, **kwargs):
pass
def sentence_length(self, *args, **kwargs):
pass
def sentence_name_from_index(self, *args, **kwargs):
pass
@property
def server(self):
pass
@server.setter
def server(self, value):
pass
@property
def server_version(self):
pass
@server_version.setter
def server_version(self, value):
pass
def set_area_portal_state(self, *args, **kwargs):
pass
def set_area_portal_states(self, *args, **kwargs):
pass
def set_dedicated_server_benchmark_mode(self, *args, **kwargs):
pass
def set_fake_client_convar_value(self, *args, **kwargs):
pass
def set_noclip_enabled(self, *args, **kwargs):
pass
def set_view(self, *args, **kwargs):
pass
@property
def shared_edict_change_info(self):
pass
@shared_edict_change_info.setter
def shared_edict_change_info(self, value):
pass
def solid_moved(self, *args, **kwargs):
pass
def sphere_paint_surface(self, *args, **kwargs):
pass
def sphere_trace_paint_surface(self, *args, **kwargs):
pass
def start_query_cvar_value(self, *args, **kwargs):
pass
def static_decal(self, *args, **kwargs):
pass
def text_message_get(self, *args, **kwargs):
pass
@property
def timescale(self):
pass
@timescale.setter
def timescale(self, value):
pass
def trigger_moved(self, *args, **kwargs):
pass

class _ServerGameDLL(object):
__class__ = None
def __delattr__(self, *args, **kwargs):
pass
__dict__ = None
def __dir__(self, *args, **kwargs):
pass
__doc__ = None
def __eq__(self, *args, **kwargs):
pass
def __format__(self, *args, **kwargs):
pass
def __ge__(self, *args, **kwargs):
pass
def __getattribute__(self, *args, **kwargs):
pass
def __gt__(self, *args, **kwargs):
pass
def __hash__(self, *args, **kwargs):
pass
def __init__(self, *args, **kwargs):
pass
def __init_subclass__(self, *args, **kwargs):
pass
def __le__(self, *args, **kwargs):
pass
def __lt__(self, *args, **kwargs):
pass
__module__ = '_engines._server'
def __ne__(self, *args, **kwargs):
pass
def __new__(self, *args, **kwargs):
pass
def __reduce__(self, *args, **kwargs):
pass
def __reduce_ex__(self, *args, **kwargs):
pass
def __repr__(self, *args, **kwargs):
pass
def __setattr__(self, *args, **kwargs):
pass
def __sizeof__(self, *args, **kwargs):
pass
def __str__(self, *args, **kwargs):
pass
def __subclasshook__(self, *args, **kwargs):
pass
@property
def __weakref__(self):
pass
@__weakref__.setter
def __weakref__(self, value):
pass
def _obj(self, *args, **kwargs):
pass
def _ptr(self, *args, **kwargs):
pass
_size = 4
@property
def all_server_classes(self):
pass
@all_server_classes.setter
def all_server_classes(self, value):
pass
@property
def game_description(self):
pass
@game_description.setter
def game_description(self, value):
pass
def server_hibernation_update(self, *args, **kwargs):
pass
def set_server_hibernation(self, *args, **kwargs):
pass

__doc__ = None
__loader__ = None
__name__ = None
__package__ = None
__spec__ = None
engine_server = None
def execute_server_command(*args, **kwargs):
pass
def insert_command_string(*args, **kwargs):
pass
def insert_server_command(*args, **kwargs):
pass
def queue_command_string(*args, **kwargs):
pass
def queue_server_command(*args, **kwargs):
pass
server_game_dll = None
I have also added a function to get all modules that are created via SP's core:
https://github.com/Source-Python-Dev-Te ... 9c9771647c

This is its current output:

Code: Select all

_memory
_bitbuffers
_colors
_commands._client
_commands
_commands._say
_commands._server
_cvars
_effects
_effects._base
_engines
_engines._server
_engines._sound
_engines._trace
_entities._constants
_entities._helpers
_entities
_entities._factories
_entities._datamaps
_entities._props
_entities._entity
_core
_events
_globals
_keyvalues
_listeners
_mathlib
_messages
_net_channel
_physics
_players._bots
_players._constants
_players._helpers
_players
_players._voice
_plugins
_filters._recipients
_filesystem
_steam
_stringtables
_studio
_studio._constants
_studio._cache
_weapons._constants
_weapons._scripts
_weapons._entity
User avatar
satoon101
Project Leader
Posts: 2604
Joined: Sat Jul 07, 2012 1:59 am

Re: Code completion doesn't work with Source.Python

Postby satoon101 » Sun May 05, 2019 11:53 pm

That's an awesome start! We also have access to their docstrings, which not only describes the function/method/etc, but lists the arguments and return type, as well.
Image
User avatar
khaimovmr
Junior Member
Posts: 27
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: Code completion doesn't work with Source.Python

Postby khaimovmr » Mon May 06, 2019 11:22 am

Wow, that's a good news, guys.
This feature will boost the mod-development process a lot, at least for newbies.
User avatar
BackRaw
Senior Member
Posts: 527
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: Code completion doesn't work with Source.Python

Postby BackRaw » Mon May 06, 2019 2:38 pm

Woah you're fast, Ayuto. Nice job!

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests