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

fix find_in_po. Make it Windows compatible#2714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rtobar merged 3 commits intopython:3.12fromcacrespo:fix_find_in_po
Oct 28, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletionsscripts/find_in_po.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
import functools
from glob import glob
import multiprocessing
importos
from shutilimportget_terminal_size
from textwrap import fill

import regex # fades
Expand All@@ -31,11 +31,8 @@ def _get_file_entries(pattern, width, filename):

def find_in_po(pattern):
pattern = regex.compile(pattern)
try:
_, columns = os.popen("stty size", "r").read().split()
available_width = int(columns) // 2 - 3
except:
available_width = 80 // 2 - 3
columns = get_terminal_size().columns
available_width = columns // 2 - 3

# Find entries in parallel
get_file_entries = functools.partial(_get_file_entries, pattern, available_width)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp