Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72ee717

Browse files
committed
Turn safe_glob into a function
1 parentf8b5962 commit72ee717

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎bpython/autocomplete.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,14 @@ def format(self, word: str) -> str:
343343
returnafter_last_dot(word)
344344

345345

346+
def_safe_glob(pathname:str)->Iterator[str]:
347+
returnglob.iglob(glob.escape(pathname)+"*")
348+
349+
346350
classFilenameCompletion(BaseCompletionType):
347351
def__init__(self,mode:AutocompleteModes=AutocompleteModes.SIMPLE):
348352
super().__init__(False,mode)
349353

350-
defsafe_glob(self,pathname:str)->Iterator[str]:
351-
returnglob.iglob(glob.escape(pathname)+"*")
352-
353354
defmatches(
354355
self,cursor_offset:int,line:str,**kwargs:Any
355356
)->Optional[Set]:
@@ -359,7 +360,7 @@ def matches(
359360
matches=set()
360361
username=cs.word.split(os.path.sep,1)[0]
361362
user_dir=os.path.expanduser(username)
362-
forfilenameinself.safe_glob(os.path.expanduser(cs.word)):
363+
forfilenamein_safe_glob(os.path.expanduser(cs.word)):
363364
ifos.path.isdir(filename):
364365
filename+=os.path.sep
365366
ifcs.word.startswith("~"):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp