"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/cudatext.app/Contents/Resources/py/cuda_project_man/__init__.py" between
CudaText-1.92.0.tar.gz and CudaText-1.93.0.tar.gz

About: CudaText is a cross-platform text editor (written in Lazarus).

__init__.py  (CudaText-1.92.0):__init__.py  (CudaText-1.93.0)
skipping to change at line 44 skipping to change at line 44
res['ProjMainFileNameNoExt'] = '.'.join(os.path.basename(fn).split('.')[0:-1 ]) res['ProjMainFileNameNoExt'] = '.'.join(os.path.basename(fn).split('.')[0:-1 ])
data = global_project_info.get('vars', []) data = global_project_info.get('vars', [])
for item in data: for item in data:
s1, s2 = item.split('=', maxsplit=1) s1, s2 = item.split('=', maxsplit=1)
res[s1] = s2 res[s1] = s2
return res return res
NodeInfo = collections.namedtuple("NodeInfo", "caption image") NodeInfo = collections.namedtuple("NodeInfo", "caption image")
_homedir = os.path.expanduser('~')
def nice_filename(path):
dir = os.path.dirname(path)
if dir == _homedir or dir.startswith(_homedir+'/'):
dir = dir.replace(_homedir, '~')
return os.path.basename(path) + ' ('+ dir + ')'
def is_filename_mask_listed(name, mask_list): def is_filename_mask_listed(name, mask_list):
#s = os.path.basename(name) #s = os.path.basename(name)
s = name.lower() #enough for s.endswith s = name.lower() #enough for s.endswith
for item in mask_list.split(' '): for item in mask_list.split(' '):
#if fnmatch(s, item): #slow, lets do it faster #if fnmatch(s, item): #slow, lets do it faster
if s.endswith(item): if s.endswith(item):
return True return True
return False return False
def is_locked(s): def is_locked(s):
skipping to change at line 281 skipping to change at line 290
action_name = "" action_name = ""
action = "" action = ""
else: else:
action_name = item_caption.lower().replace(" ", "_").rstrip(".") action_name = item_caption.lower().replace(" ", "_").rstrip(".")
action = "cuda_project_man.action_" + action_name action = "cuda_project_man.action_" + action_name
menu_added = self.add_context_menu_node(menu_use, action, item_capti on) menu_added = self.add_context_menu_node(menu_use, action, item_capti on)
if item_caption == "Recent projects": if item_caption == "Recent projects":
for path in self.options["recent_projects"]: for path in self.options["recent_projects"]:
action = str.format("module=cuda_project_man;cmd=action_open _project;info=r'{}';", path) action = str.format("module=cuda_project_man;cmd=action_open _project;info=r'{}';", path)
self.add_context_menu_node(menu_added, action, path) self.add_context_menu_node(menu_added, action, nice_filename (path))
@staticmethod @staticmethod
def node_ordering(node): def node_ordering(node):
path = Path(node) path = Path(node)
return path.is_file(), path.name return path.is_file(), path.name
def add_node(self, dialog): def add_node(self, dialog):
path = dialog() path = dialog()
if path is not None: if path is not None:
if path in self.project["nodes"]: if path in self.project["nodes"]:
 End of changes. 2 change blocks. 
1 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)