<|BOS|>.stat_result`) is the stat result of the direct
entry.
"""
self.name = name
"""
*name* (:class:`str`) is the base name of the entry.
"""
self.path = path
"""
*path* (:class:`str`) is the path of the entry.
"""
self._stat = stat
"""
*_stat* (:class:`~os.stat_result`) is the stat result of the linked
entry.
"""
def is_dir(self, follow_links=None):
# type: (Optional[bool]) -> bool
"""
Get whether the entry is a directory.
*follow_links* (:class:`bool` or :data:`None`) is whether to follow
symbolic links. If this is :data:`True`, a symlink to a directory
will result in :data:`True`. Default is :data:`None` for :data:`True`.
Returns whether the entry is a directory (:class:`bool`).
"""
if follow_links is None:
follow_links = True
node_stat = self._stat if follow_links else self._lstat
return stat.S_ISDIR(node_stat.st_mode)
def is_file(self, follow_links=None):
# type: (Optional[bool]) -> bool
"""
Get whether the entry is a regular file.
*follow_links* (:class:`bool` or :data:`None`) is whether to follow
symbolic links. If this is :data:`True`, a symlink to a regular file
will result in :data:`True`. Default is :data:`None` for :data:`True`.
Returns whether the entry is a regular file (:class:`bool`).
"""
if follow_links is None:
follow_links = True
node_stat = self._stat if follow_links else self._lstat
return stat.S_ISREG(node_stat.st_mode)
def is_symlink(self):
# type: () -> bool
"""
Returns whether the entry is a symbolic link (:class:`bool`).
"""
return stat.S_ISLNK(self._lstat.st_mode)
def stat(self, follow_links=None):
# type: (Optional[bool]) -> os.stat_result
"""
Get the cached stat result for the entry.
*follow_links* (:class:`bool` or :data:`None`) is whether to follow
symbolic links. If this is :data:`True`, the stat result of the
linked file will be returned. Default is :data:`None` for :data:`True`.
Returns that stat result (:class:`~os.stat_result`).
"""
if follow_links is None:
follow_links = True
return self._stat if follow_links else self._lstat
<|EOS|>import codecs
import fnmatch
import os
import sublime
import sublime_plugin
import time
import re
try: # Python 3
from .haxe_helper import HaxeComplete_inst, get_classpaths
from .haxe_generate_code_helper import is_haxe_scope, get_context
from .haxe_organize_imports import HaxeOrganizeImports
from .haxe_parse_helper import *
except (ValueError): # Python 2
from haxe_helper import HaxeComplete_inst, get_classpaths
from haxe_generate_code_helper import is_haxe_scope, get_context
from haxe_organize_imports import HaxeOrganizeImports
from haxe_parse_helper import *
from xml.etree import ElementTree
try:
from elementtree import SimpleXMLTreeBuilder
ElementTree.XMLTreeBuilder = SimpleXMLTreeBuilder.TreeBuilder
except ImportError as e:
pass # ST3
result_file_regex = (
r'^(.+):(\d+)'
r'(?:: (?:lines \d+-\d+|character(?:s \d+-| )(\d+)) : )?'
r'(?:(?!Defined in this class).)*$')
re_haxe_position = re.compile(
r'^(.+):(\d+): (?: