No description.
def _search_coding_line(txt):
Search a pattern like this: # -*- coding: utf-8 -*-.
def belongs_to_folder(path, fileName):
Determine if fileName is located under path structure.
def check_for_external_modification(fileName, old_mtime):
Check if the file was modified outside ninja.
def convert_to_relative(basePath, fileName):
Convert a absolut path to relative based on its start with basePath.
def create_folder(folderName, add_init_file=True):
Create a new Folder inside the one received as a param.
def create_init_file(folderName):
Create a __init__.py file in the folder received.
def create_init_file_complete(folderName):
Create a __init__.py file in the folder received.
This __init__.py will contain the information of the files inside
this folder.
def create_path(*args):
Join the paths provided in order to create an absolut path.
def create_tree_folders(folderName):
Create a group of folders, one inside the other.
def delete_file(path, fileName=None):
Delete the proper file.
If fileName is None, path and fileName are joined to create the
complete path, otherwise path is used to delete the file.
def delete_folder(path, fileName=None):
Delete the proper folder.
def file_exists(path, fileName=str):
Check if a file already exists.
def folder_exists(folderName):
Check if a folder already exists.
def get_basename(fileName):
Get the name of a file or folder specified in a path.
def get_file_encoding(content):
Try to get the encoding of the file using the PEP 0263 rules
search the first or the second line of the file
Returns the encoding or the default UTF-8
def get_file_extension(fileName):
Get the file extension in the form of: 'py'
def get_file_name(fileName):
Get the file name, without the extension.
def get_files_from_folder(folder, ext):
Get the files in folder with the specified extension.
def get_folder(fileName):
Get the name of the folder containing the file or folder received.
def get_last_modification(fileName):
Get the last time the file was modified.
def get_module_name(fileName):
Get the name of the file without the extension.
def has_write_permission(fileName):
Check if the file has writing permissions.
def is_supported_extension(filename, extensions=None):
No description.
def open_project(path):
Return a dict structure containing the info inside a folder.
def open_project_with_extensions(path, extensions):
Return a dict structure containing the info inside a folder.
This function uses the extensions specified by each project.
def read_file_content(fileName):
Read a file content, this function is used to load Editor content.
def rename_file(old, new):
Rename a file, changing its name from 'old' to 'new'.
def store_file_content(fileName, content, addExtension=True, newFile=False):
Save content on disk with the given file name.