-
Notifications
You must be signed in to change notification settings - Fork 0
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StorageDirのリファクタリング #96
Labels
Milestone
Comments
sonoh5n
added
🛠️ improvement
Improve features which are working
♻️ refactor
refactoring
labels
Dec 8, 2024
# example.py
from directory_manager import DirectoryManager
def main():
# DirectoryManagerを初期化
dir_manager = DirectoryManager('/tmp/base_directory')
# 1. 通常のディレクトリアクセス
inputdata_dir = dir_manager.inputdata
print(f"InputData Path: {inputdata_dir}")
# このタイミングで'/tmp/base_directory/inputdata'が存在しない場合は作成される
# ディレクトリ内のファイル一覧を取得
inputdata_files = inputdata_dir.list()
print("InputData Files:", inputdata_files)
# 2. 分割ディレクトリアクセス(idx=1など)
inputdata_divided_dir = dir_manager.inputdata(1)
print(f"Divided InputData Path: {inputdata_divided_dir}")
# このタイミングで'/tmp/base_directory/divided/0001/inputdata'が存在しない場合は作成される
divided_files = inputdata_divided_dir.list()
print("Divided InputData Files:", divided_files)
# 3. サポートされていないディレクトリにもアクセス可能
custom_dir = dir_manager.customdir
print(f"CustomDir Path: {custom_dir}")
custom_files = custom_dir.list()
print("CustomDir Files:", custom_files)
# 4. サポートディレクトリをまとめて作成・取得する例
all_dirs = dir_manager.all()
print("All Supported Directories:")
for d in all_dirs:
print(d)
if __name__ == "__main__":
main() |
sonoh5n
added a commit
that referenced
this issue
Jan 9, 2025
sonoh5n
added a commit
that referenced
this issue
Jan 9, 2025
sonoh5n
added a commit
that referenced
this issue
Jan 14, 2025
- Add ManagedDirectory support for creating divided subdirectories - Separate base-only and divided-supported directories - Implement index-based directory creation in divided folders - Handle directory creation errors with proper error mapping
sonoh5n
added a commit
that referenced
this issue
Jan 14, 2025
…d subdirectories and improve documentation
sonoh5n
added a commit
that referenced
this issue
Jan 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
現在実装されているクラスがPythonicではなく使いづらい。
The text was updated successfully, but these errors were encountered: