How to specify file-include regex in synchronizer

オープン
#536 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
cloud

調査の方向性

Start from the reporter's snippet: it imports SyncPolicyManager but constructs ScanPoliciesManager, and passes exclude_file_regexes=".", which matches every file. Reproduce with a folder holding file1.dat, file2.dat and file3.dat in dry-run mode, then check how include and exclude regexes combine in the sync policy code. Done when a documented or fixed pattern uploads only file1.dat and the example in the docs runs as written.

索引モデルが issue の本文から書いたものです。

説明

I've been trying to solve a simple problem, how to specify to only upload filefile1.dat
I have these files in the folder: file1.dat file2.dat file3.dat

I've tried with many different regex'es for the parameter include_file_regexes but not succeed to include on this file.

from b2sdk.v2 import SyncPolicyManager
from b2sdk.v2 import parse_folder
from b2sdk.v2 import Synchronizer
from b2sdk.v2 import SyncReport
import time, sys

source = (r"c:\temp\test")
destination = "b2://" + AccountInfos["bucketName"]
source = parse_folder(source, b2api)
destination = parse_folder(destination, b2api)

policies_manager = ScanPoliciesManager(exclude_file_regexes=".", include_file_regexes=r"file1\.dat")
synchronizer = Synchronizer(max_workers=10, policies_manager=policies_manager, dry_run=True, allow_empty_source=True)
no_progress = False

with SyncReport(sys.stdout, no_progress) as reporter:
        synchronizer.sync_folders(
            source_folder=source,
            dest_folder=destination,
            now_millis=int(round(time.time() * 1000)),
            reporter=reporter,
        )
主要言語
Python
スター
214
フォーク
68
平均マージ
51分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Backblaze/b2-sdk-python のほかの issue

Backblaze/b2-sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。