Sublime Forum

Anyone know why variables are editing themselves? Basically the first part of all strings from one defs file are being deleted

#1

I’m in the process of moving all of my plugin files into a single directory along with adding sublime-settings support… The menu has been created and it works, the name may change so I wanted to create some vars which would precache important locations ( so the logic wouldn’t need to call os.path.join every call - instead call a cached var with that data to save time )… but the data is being deleted!

So far I have almost everything in the single folder - I still need to create a mapper linker so the CodeMap custom_mappers/ folder can be populated with all identical files which link to my folder with a better class-loading system to support file-extensions which have multiple languages - example: PHP uses: PHP, RegEx ( PHP Implementation ), SQL, HTML, CSS, JavaScript, RegEx( JavaScript Implementation ) - so 6 languages - one with 2 different implementations… with the current system you end up with circular imports… which is why I’m doing it this way and adding optimizations where I can…

The vars add a tiny bit of overhead and therefore reduce the need to make functions calls each time it loads or saves a file from / to cache… but I have no idea why the heck the data is being deleted…

Has anyone experienced this before? Is this a bug I need to report? Is this some intended feature?

Definitions File


##
## Paths to files and other locations... This is where the paths are built for consumption throughout the plugin...
##
CFG_DEBUG_PATHS	= not False

##
## Sublime
##

## Sublime Path to the AppData Packages Folder
SUBLIME_PATH_PACKAGES						= sublime.packages_path( )

## Sublime Path to the AppData Packages User Folder
SUBLIME_PATH_USER							= os.path.join( PLUGIN_PATH_PACKAGES, PLUGIN_FOLDER_NAME_USER )


##
## Core
##

## Default / Package Folder and important folders and file-names...
PLUGIN_PATH_BASE							= os.path.join( PLUGIN_PATH_PACKAGES, PLUGIN_FOLDER_NAME )
PLUGIN_PATH_BASE_CFG						= os.path.join( PLUGIN_PATH_BASE, PLUGIN_FOLDER_NAME_SETTINGS )
PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS		= os.path.join( PLUGIN_PATH_BASE, PLUGIN_FOLDER_NAME_SYNTAX_HIGHLIGHTERS )

PLUGIN_PATH_CFG_CORE_DEFS					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_DEFS )
PLUGIN_PATH_CFG_CORE_CORE					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_CORE )
PLUGIN_PATH_CFG_CORE_MAP					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP )

## Default Mapping Class Config Files - Note: This is going to be replaced with a dynamic system using MapSettings_<EXT>.sublime-settings which is the file-name in both folders User/ and non.. These are here for testing purposes..
PLUGIN_PATH_CFG_CORE_MAP_AHK				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_AHK )
PLUGIN_PATH_CFG_CORE_MAP_BAT				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_BAT )
PLUGIN_PATH_CFG_CORE_MAP_CPP				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_CPP )
PLUGIN_PATH_CFG_CORE_MAP_JS					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_JS )
PLUGIN_PATH_CFG_CORE_MAP_LUA				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_LUA )
PLUGIN_PATH_CFG_CORE_MAP_MD					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_MD )
PLUGIN_PATH_CFG_CORE_MAP_PHP				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_PHP )
PLUGIN_PATH_CFG_CORE_MAP_PY					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_PY )
PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS	= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_SUBLIME_SETTINGS )
PLUGIN_PATH_CFG_CORE_MAP_TS					= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_TS )
PLUGIN_PATH_CFG_CORE_MAP_TXT				= os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_TXT )


##
## User
##

## User Configuration and Custom Files Folder - The name is different but that may change...
PLUGIN_PATH_USER							= SUBLIME_PATH_USER #os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_USER )
PLUGIN_PATH_USER_CFG						= os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_SETTINGS )
PLUGIN_PATH_USER_CACHE						= os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_CACHE )

## USER Core Config Files
PLUGIN_PATH_CFG_CORE_USER_DEFS				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_DEFS )
PLUGIN_PATH_CFG_CORE_USER_CORE				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_CORE )
PLUGIN_PATH_CFG_CORE_USER_MAP				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP )

## USER Mapping Class Config Files - Note: This is going to be replaced with a dynamic system using MapSettings_<EXT>.sublime-settings which is the file-name in both folders User/ and non.. These are here for testing purposes..
PLUGIN_PATH_CFG_USER_MAP_AHK				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_AHK )
PLUGIN_PATH_CFG_USER_MAP_BAT				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_BAT )
PLUGIN_PATH_CFG_USER_MAP_CPP				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_CPP )
PLUGIN_PATH_CFG_USER_MAP_JS					= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_JS )
PLUGIN_PATH_CFG_USER_MAP_LUA				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_LUA )
PLUGIN_PATH_CFG_USER_MAP_MD					= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_MD )
PLUGIN_PATH_CFG_USER_MAP_PHP				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_PHP )
PLUGIN_PATH_CFG_USER_MAP_PY					= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_PY )
PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS	= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_SUBLIME_SETTINGS )
PLUGIN_PATH_CFG_USER_MAP_TS					= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_TS )
PLUGIN_PATH_CFG_USER_MAP_TXT				= os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_TXT )


## Core Files
PLUGIN_PATH_FILE_CORE_DEFS					= os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE_DEFS )
PLUGIN_PATH_FILE_CORE_LIB					= os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE_LIB )
PLUGIN_PATH_FILE_CORE						= os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE )


##
## Helper to ensure the proper paths were generated..
##
def PrintAllPaths( *_varargs ):
	if ( len( _varargs ) > 0 ):
		for _path in _varargs:
			print( '\t>> ' + str( _path ) )


if CFG_DEBUG_PATHS:
	print( )
	print( )
	print( '>>>> Printing all paths for verification... >>>>' )
	print( )
	print( )
	print( ' >> Printing >> PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
	PrintAllPaths( PLUGIN_PATH_PACKAGES, SUBLIME_PATH_USER )
	print( ' << Finished << PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
	print( )
	print( )
	print( ' >> Printing >> PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
	PrintAllPaths( PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT )
	print( ' << Finished << PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
	print( )
	print( )
	print( ' >> Printing >> PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
	PrintAllPaths( PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT )
	print( ' << Finished << PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
	print( )
	print( )
	print( ' >> Printing >> PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
	PrintAllPaths( PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE )
	print( ' << Finished << PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
	print( )
	print( )
	print( '<<<< FINISHED Printing all paths for verification... <<<<' )
	print( )
	print( )

Prints


>>>> Printing all paths for verification... >>>>


 >> Printing >> PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User
 << Finished << PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER


 >> Printing >> PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\syntax_files
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\Default_PluginDefinitions.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\Default_PluginSettings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\Default_MapSettings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_ahk.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_bat.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_cpp.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_js.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_lua.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_md.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_php.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_py.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_sublime-settings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_ts.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\settings\MapSettings_txt.sublime-settings
 << Finished << PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT


 >> Printing >> PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\cache
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\Default_PluginDefinitions.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\Default_PluginSettings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\Default_MapSettings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_ahk.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_bat.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_cpp.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_js.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_lua.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_md.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_php.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_py.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_sublime-settings.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_ts.sublime-settings
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\User\settings\MapSettings_txt.sublime-settings
 << Finished << PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT


 >> Printing >> PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\XCodeMapper_Definitions.py
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\AcecoolST3_Library.py
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages\Acecool_CMS\XCodeMapper.py
 << Finished << PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE


<<<< FINISHED Printing all paths for verification... <<<<

Core file which includes defs using from Acecool_CMS import * - all other vars are not edited…

print( )
print( )
print( '>>>> XXXX Printing all paths for verification... >>>>' )
print( )
print( )
print( ' >> Printing >> PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
PrintAllPaths( PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER )
print( ' << Finished << PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
print( )
print( )
print( ' >> Printing >> PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
PrintAllPaths( PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT )
print( ' << Finished << PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
print( )
print( )
print( ' >> Printing >> PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
PrintAllPaths( PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT )
print( ' << Finished << PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
print( )
print( )
print( ' >> Printing >> PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
PrintAllPaths( PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE )
print( ' << Finished << PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
print( )
print( )
print( '<<<< XXXX FINISHED Printing all paths for verification... <<<<' )
print( )
print( )

prints

>>>> XXXX Printing all paths for verification... >>>>


 >> Printing >> PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER
	>> C:\Users\Acecool\AppData\Roaming\Sublime Text 3\Packages
	>> User\Acecool_CMS
 << Finished << PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER


 >> Printing >> PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT
	>> Acecool_CMS
	>> Acecool_CMS\settings
	>> Acecool_CMS\syntax_files
	>> Acecool_CMS\settings\Default_PluginDefinitions.sublime-settings
	>> Acecool_CMS\settings\Default_PluginSettings.sublime-settings
	>> Acecool_CMS\settings\Default_MapSettings.sublime-settings
	>> Acecool_CMS\settings\MapSettings_ahk.sublime-settings
	>> Acecool_CMS\settings\MapSettings_bat.sublime-settings
	>> Acecool_CMS\settings\MapSettings_cpp.sublime-settings
	>> Acecool_CMS\settings\MapSettings_js.sublime-settings
	>> Acecool_CMS\settings\MapSettings_lua.sublime-settings
	>> Acecool_CMS\settings\MapSettings_md.sublime-settings
	>> Acecool_CMS\settings\MapSettings_php.sublime-settings
	>> Acecool_CMS\settings\MapSettings_py.sublime-settings
	>> Acecool_CMS\settings\MapSettings_sublime-settings.sublime-settings
	>> Acecool_CMS\settings\MapSettings_ts.sublime-settings
	>> Acecool_CMS\settings\MapSettings_txt.sublime-settings
 << Finished << PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT


 >> Printing >> PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT
	>> User\Acecool_CMS
	>> User\Acecool_CMS\settings
	>> User\Acecool_CMS\cache
	>> User\Acecool_CMS\settings\Default_PluginDefinitions.sublime-settings
	>> User\Acecool_CMS\settings\Default_PluginSettings.sublime-settings
	>> User\Acecool_CMS\settings\Default_MapSettings.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_ahk.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_bat.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_cpp.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_js.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_lua.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_md.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_php.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_py.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_sublime-settings.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_ts.sublime-settings
	>> User\Acecool_CMS\settings\MapSettings_txt.sublime-settings
 << Finished << PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT


 >> Printing >> PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE
	>> Acecool_CMS\XCodeMapper_Definitions.py
	>> Acecool_CMS\AcecoolST3_Library.py
	>> Acecool_CMS\XCodeMapper.py
 << Finished << PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE


<<<< XXXX FINISHED Printing all paths for verification... <<<<

The XXXX was to differentiate…

I’ve tried different variable names with the same result… It’s strange because I want to use my defs file to set up these core locations so they can be changed from one location ( aside from the imports - but in the code for everything else ) and everything would work…

Sure - I could simply use sublime.package_path( ) in the os.path.join( xxx, … ) but the purpose of this is to avoid running that command - ie sublime text loads the file and keeps it in memory except when refresh is enabled which is a separate var for my addon…

It’s to make things easier - so I also don’t need to call os.path.join or even include it in other files…

I’m not sure whether to report this as a bug or… so I’m posting here first.

Edit: The User\User\ was due to altering the first PLUGIN_PATH_USER which is next to PLUGIN_PATH_PACKAGES from SUBLIME_ prefix to PLUGIN_… Because a second one existed which used it… Even with that issue reolved, the issue remains.

0 Likes

#2

When I run

os.path.join( … ).replace( ‘\’, ‘/’ ) for every single line… the data isn’t replaced… But, it confuses other aspects of the system ( back-end sublime text loading syntax highlighter files - so maybe this needs to be reported as a bug )…

I definitely do not want to run a replace on all of the vars for each file they’re loaded into…

0 Likes

#3

Why not just True?

You cannot do that on the main module body, for example:

import sublime
sublime.packages_path() # cannot do this here because the Sublime Text API is not ready

def plugin_loaded():
    sublime.packages_path() # you can do it on `plugin_loaded()`

When the Sublime Text API is ready, the forward plugin_loaded() will be called and then, only then you can call sublime.packages_path(). See https://www.sublimetext.com/docs/3/api_reference.html#plugin_lifecycle

It seems that was your problem. Your file should be looking like this:

##
## Paths to files and other locations... This is where the paths are built for consumption throughout the plugin...
##
CFG_DEBUG_PATHS = True

##
## Sublime
##

def plugin_loaded():

    ## Sublime Path to the AppData Packages Folder
    SUBLIME_PATH_PACKAGES                       = sublime.packages_path( )

    ## Sublime Path to the AppData Packages User Folder
    SUBLIME_PATH_USER                           = os.path.join( PLUGIN_PATH_PACKAGES, PLUGIN_FOLDER_NAME_USER )


    ##
    ## Core
    ##

    ## Default / Package Folder and important folders and file-names...
    PLUGIN_PATH_BASE                            = os.path.join( PLUGIN_PATH_PACKAGES, PLUGIN_FOLDER_NAME )
    PLUGIN_PATH_BASE_CFG                        = os.path.join( PLUGIN_PATH_BASE, PLUGIN_FOLDER_NAME_SETTINGS )
    PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS        = os.path.join( PLUGIN_PATH_BASE, PLUGIN_FOLDER_NAME_SYNTAX_HIGHLIGHTERS )

    PLUGIN_PATH_CFG_CORE_DEFS                   = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_DEFS )
    PLUGIN_PATH_CFG_CORE_CORE                   = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_CORE )
    PLUGIN_PATH_CFG_CORE_MAP                    = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP )

    ## Default Mapping Class Config Files - Note: This is going to be replaced with a dynamic system using MapSettings_<EXT>.sublime-settings which is the file-name in both folders User/ and non.. These are here for testing purposes..
    PLUGIN_PATH_CFG_CORE_MAP_AHK                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_AHK )
    PLUGIN_PATH_CFG_CORE_MAP_BAT                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_BAT )
    PLUGIN_PATH_CFG_CORE_MAP_CPP                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_CPP )
    PLUGIN_PATH_CFG_CORE_MAP_JS                 = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_JS )
    PLUGIN_PATH_CFG_CORE_MAP_LUA                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_LUA )
    PLUGIN_PATH_CFG_CORE_MAP_MD                 = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_MD )
    PLUGIN_PATH_CFG_CORE_MAP_PHP                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_PHP )
    PLUGIN_PATH_CFG_CORE_MAP_PY                 = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_PY )
    PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS   = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_SUBLIME_SETTINGS )
    PLUGIN_PATH_CFG_CORE_MAP_TS                 = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_TS )
    PLUGIN_PATH_CFG_CORE_MAP_TXT                = os.path.join( PLUGIN_PATH_BASE_CFG, PLUGIN_FILE_NAME_CFG_MAP_TXT )


    ##
    ## User
    ##

    ## User Configuration and Custom Files Folder - The name is different but that may change...
    PLUGIN_PATH_USER                            = SUBLIME_PATH_USER #os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_USER )
    PLUGIN_PATH_USER_CFG                        = os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_SETTINGS )
    PLUGIN_PATH_USER_CACHE                      = os.path.join( SUBLIME_PATH_USER, PLUGIN_FOLDER_NAME_CACHE )

    ## USER Core Config Files
    PLUGIN_PATH_CFG_CORE_USER_DEFS              = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_DEFS )
    PLUGIN_PATH_CFG_CORE_USER_CORE              = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_CORE )
    PLUGIN_PATH_CFG_CORE_USER_MAP               = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP )

    ## USER Mapping Class Config Files - Note: This is going to be replaced with a dynamic system using MapSettings_<EXT>.sublime-settings which is the file-name in both folders User/ and non.. These are here for testing purposes..
    PLUGIN_PATH_CFG_USER_MAP_AHK                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_AHK )
    PLUGIN_PATH_CFG_USER_MAP_BAT                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_BAT )
    PLUGIN_PATH_CFG_USER_MAP_CPP                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_CPP )
    PLUGIN_PATH_CFG_USER_MAP_JS                 = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_JS )
    PLUGIN_PATH_CFG_USER_MAP_LUA                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_LUA )
    PLUGIN_PATH_CFG_USER_MAP_MD                 = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_MD )
    PLUGIN_PATH_CFG_USER_MAP_PHP                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_PHP )
    PLUGIN_PATH_CFG_USER_MAP_PY                 = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_PY )
    PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS   = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_SUBLIME_SETTINGS )
    PLUGIN_PATH_CFG_USER_MAP_TS                 = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_TS )
    PLUGIN_PATH_CFG_USER_MAP_TXT                = os.path.join( PLUGIN_PATH_USER_CFG, PLUGIN_FILE_NAME_CFG_MAP_TXT )


    ## Core Files
    PLUGIN_PATH_FILE_CORE_DEFS                  = os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE_DEFS )
    PLUGIN_PATH_FILE_CORE_LIB                   = os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE_LIB )
    PLUGIN_PATH_FILE_CORE                       = os.path.join( PLUGIN_PATH_BASE, PLUGIN_FILE_NAME_CORE )


    ##
    ## Helper to ensure the proper paths were generated..
    ##
    def PrintAllPaths( *_varargs ):
        if ( len( _varargs ) > 0 ):
            for _path in _varargs:
                print( '\t>> ' + str( _path ) )


    if CFG_DEBUG_PATHS:
        print( )
        print( )
        print( '>>>> Printing all paths for verification... >>>>' )
        print( )
        print( )
        print( ' >> Printing >> PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
        PrintAllPaths( PLUGIN_PATH_PACKAGES, SUBLIME_PATH_USER )
        print( ' << Finished << PLUGIN_PATH_PACKAGES, PLUGIN_PATH_USER' )
        print( )
        print( )
        print( ' >> Printing >> PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
        PrintAllPaths( PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT )
        print( ' << Finished << PLUGIN_PATH_BASE, PLUGIN_PATH_BASE_CFG, PLUGIN_PATH_BASE_SYNTAX_HIGHLIGHTERS, PLUGIN_PATH_CFG_CORE_DEFS, PLUGIN_PATH_CFG_CORE_CORE, PLUGIN_PATH_CFG_CORE_MAP, PLUGIN_PATH_CFG_CORE_MAP_AHK, PLUGIN_PATH_CFG_CORE_MAP_BAT, PLUGIN_PATH_CFG_CORE_MAP_CPP, PLUGIN_PATH_CFG_CORE_MAP_JS, PLUGIN_PATH_CFG_CORE_MAP_LUA, PLUGIN_PATH_CFG_CORE_MAP_MD, PLUGIN_PATH_CFG_CORE_MAP_PHP, PLUGIN_PATH_CFG_CORE_MAP_PY, PLUGIN_PATH_CFG_CORE_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_CORE_MAP_TS, PLUGIN_PATH_CFG_CORE_MAP_TXT' )
        print( )
        print( )
        print( ' >> Printing >> PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
        PrintAllPaths( PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT )
        print( ' << Finished << PLUGIN_PATH_USER, PLUGIN_PATH_USER_CFG, PLUGIN_PATH_USER_CACHE, PLUGIN_PATH_CFG_CORE_USER_DEFS, PLUGIN_PATH_CFG_CORE_USER_CORE, PLUGIN_PATH_CFG_CORE_USER_MAP, PLUGIN_PATH_CFG_USER_MAP_AHK, PLUGIN_PATH_CFG_USER_MAP_BAT, PLUGIN_PATH_CFG_USER_MAP_CPP, PLUGIN_PATH_CFG_USER_MAP_JS, PLUGIN_PATH_CFG_USER_MAP_LUA, PLUGIN_PATH_CFG_USER_MAP_MD, PLUGIN_PATH_CFG_USER_MAP_PHP, PLUGIN_PATH_CFG_USER_MAP_PY, PLUGIN_PATH_CFG_USER_MAP_SUBLIME_SETTINGS, PLUGIN_PATH_CFG_USER_MAP_TS, PLUGIN_PATH_CFG_USER_MAP_TXT' )
        print( )
        print( )
        print( ' >> Printing >> PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
        PrintAllPaths( PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE )
        print( ' << Finished << PLUGIN_PATH_FILE_CORE_DEFS, PLUGIN_PATH_FILE_CORE_LIB, PLUGIN_PATH_FILE_CORE' )
        print( )
        print( )
        print( '<<<< FINISHED Printing all paths for verification... <<<<' )
        print( )
        print( )
1 Like

#4

That isn’t it… The plugin is loaded through another plugin which already processes it through a callback system. Additionally, because the first data printed shows properly, and the second data ( printed after meaning executed after ) trying to use the same definitions have been edited means something else…

Additionally, because sublime is already loaded through that primary package - it is already loaded into memory and doesn’t reload per sublime texts method of loading - meaning when I import it in that file it is in fact ready to be used immediately.

If it was a stand-alone plugin which didn’t include the data and use def plugin_loaded():to then load the other files then I could see that being the problem IF AND ONLY IF the data output first wasn’t printing the full path correctly… But, again - the path is printed properly first and then when printed for the second time from another file all of the variables are altered meaning it is likely an issue with sublime text back-end with the way its version of python imports variables ( ie it is manually deleting the path information from the variables it includes )…

I was just hoping that wasn’t true…

To try and prove myself wrong: I did try def plugin_loaded(): and got absolutely NOTHING because that function def plugin_loaded(): is meant for the primary package - it’ll only be called through the callback service on the primary plugin - not on imported packages which are imported through that system - unless manually called in that function…

Any other solutions before I report this as a bug?

0 Likes

#5

Try creating a Minimal, Complete, and Verifiable example: https://stackoverflow.com/help/mcve, or this is already the minmal code you will ever need to reproduce the problem and all those os.path.join are required?

1 Like

#6

A minimum solution would be basically as my code is above running through CodeMap method of loading mappers with the custom mappers importing my definitions file, etc… but it could be done in a smaller example… I’ll write up something later today or tomorrow.

And no, the os.path.joins aren’t required if all operating systems can use \ ( on Windows with Sublime Text using / causes other issues from what I’ve seen… ) - I used it because each os would have its say in how to establish the path…

All of the custom mapper file definitions aren’t required either - those exist for user / default for debugging purposes only… ie only 15 of the 37 lines would exist…plus 2 for the user vs default mapper files with a string.format string… this way the names / system can be altered in one spot instead of throughout the code.

Edit: Also, I should reiterate the fact I am replacing sublime.packages_path( ) in all of my files with the var created so I can remove imports from some of the files… The fact that using sublime.packages_path( ) in all areas works properly but not the variable defined means there is an issue - and as NONE of my other variables are being mutilated then there is something else wrong - likely the path being targeted on purpose… and because the call does work, it also reiterates the fact that the files are imported and executed after the plugin has loaded properly… – I will write up the example though…

1 Like