-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathpathlib.po
More file actions
3213 lines (2769 loc) · 113 KB
/
Copy pathpathlib.po
File metadata and controls
3213 lines (2769 loc) · 113 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
# Takanori Suzuki <takanori@takanory.net>, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-25 18:08+0000\n"
"PO-Revision-Date: 2025-09-16 00:01+0000\n"
"Last-Translator: Takanori Suzuki <takanori@takanory.net>, 2026\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/pathlib.rst:2
msgid ":mod:`!pathlib` --- Object-oriented filesystem paths"
msgstr ":mod:`!pathlib` --- オブジェクト指向のファイルシステムパス"
#: ../../library/pathlib.rst:9
msgid "**Source code:** :source:`Lib/pathlib/`"
msgstr "**ソースコード:** :source:`Lib/pathlib/`"
#: ../../library/pathlib.rst:15
msgid ""
"This module offers classes representing filesystem paths with semantics "
"appropriate for different operating systems. Path classes are divided "
"between :ref:`pure paths <pure-paths>`, which provide purely computational "
"operations without I/O, and :ref:`concrete paths <concrete-paths>`, which "
"inherit from pure paths but also provide I/O operations."
msgstr ""
"このモジュールはファイルシステムのパスを表すクラスを提供していて、様々なオペ"
"レーティングシステムについての適切な意味論をそれらのクラスに持たせていま"
"す。\n"
"Path クラスは :ref:`純粋パス <pure-paths>` と :ref:`具象パス <concrete-"
"paths>` からなります。\n"
"純粋パスは I/O を伴わない純粋な計算操作を提供します。\n"
"具象パスは純粋パスを継承していますが、 I/O 操作も提供しています。"
#: ../../library/pathlib.rst:21
msgid ""
"Inheritance diagram showing the classes available in pathlib. The\n"
"most basic class is PurePath, which has three direct subclasses:\n"
"PurePosixPath, PureWindowsPath, and Path. Further to these four\n"
"classes, there are two classes that use multiple inheritance:\n"
"PosixPath subclasses PurePosixPath and Path, and WindowsPath\n"
"subclasses PureWindowsPath and Path."
msgstr ""
#: ../../library/pathlib.rst:31
msgid ""
"If you've never used this module before or just aren't sure which class is "
"right for your task, :class:`Path` is most likely what you need. It "
"instantiates a :ref:`concrete path <concrete-paths>` for the platform the "
"code is running on."
msgstr ""
"あなたが今までこのモジュールを使用したことがない場合や、タスクに適しているの"
"がどのクラスかわからない場合は、 :class:`Path` はきっとあなたに必要なもので"
"しょう。\n"
":class:`Path` はコードが実行されているプラットフォーム用の :ref:`具象パス "
"<concrete-paths>` のインスタンスを作成します。"
#: ../../library/pathlib.rst:35
msgid "Pure paths are useful in some special cases; for example:"
msgstr "純粋パスは、以下のようないくつかの特殊なケースで有用です:"
#: ../../library/pathlib.rst:37
msgid ""
"If you want to manipulate Windows paths on a Unix machine (or vice versa). "
"You cannot instantiate a :class:`WindowsPath` when running on Unix, but you "
"can instantiate :class:`PureWindowsPath`."
msgstr ""
"Unix マシン上で Windows のパスを扱いたいとき (またはその逆)。Unix 上で実行し"
"ているときに :class:`WindowsPath` のインスタンスを作成することはできません"
"が、:class:`PureWindowsPath` なら可能になります。"
#: ../../library/pathlib.rst:40
msgid ""
"You want to make sure that your code only manipulates paths without actually "
"accessing the OS. In this case, instantiating one of the pure classes may be "
"useful since those simply don't have any OS-accessing operations."
msgstr ""
"実際に OS にアクセスすることなしにパスを操作するだけのコードを確認したいと"
"き。この場合、純粋クラスのインスタンスを一つ作成すれば、それが OS にアクセス"
"することはないので便利です。"
#: ../../library/pathlib.rst:45
msgid ":pep:`428`: The pathlib module -- object-oriented filesystem paths."
msgstr ""
":pep:`428`: The pathlib module -- オブジェクト指向のファイルシステムパス。"
#: ../../library/pathlib.rst:48
msgid ""
"For low-level path manipulation on strings, you can also use the :mod:`os."
"path` module."
msgstr "文字列による低水準のパス操作の場合は :mod:`os.path` も使用できます。"
#: ../../library/pathlib.rst:53
msgid "Basic use"
msgstr "基本的な使い方"
#: ../../library/pathlib.rst:55
msgid "Importing the main class::"
msgstr "メインクラスをインポートします::"
#: ../../library/pathlib.rst:57
msgid ">>> from pathlib import Path"
msgstr ">>> from pathlib import Path"
#: ../../library/pathlib.rst:59
msgid "Listing subdirectories::"
msgstr "サブディレクトリの一覧を取得します::"
#: ../../library/pathlib.rst:61
msgid ""
">>> p = Path('.')\n"
">>> [x for x in p.iterdir() if x.is_dir()]\n"
"[PosixPath('.hg'), PosixPath('docs'), PosixPath('dist'),\n"
" PosixPath('__pycache__'), PosixPath('build')]"
msgstr ""
">>> p = Path('.')\n"
">>> [x for x in p.iterdir() if x.is_dir()]\n"
"[PosixPath('.hg'), PosixPath('docs'), PosixPath('dist'),\n"
" PosixPath('__pycache__'), PosixPath('build')]"
#: ../../library/pathlib.rst:66
msgid "Listing Python source files in this directory tree::"
msgstr "このディレクトリツリー内の Python ソースファイルの一覧を取得します::"
#: ../../library/pathlib.rst:68
msgid ""
">>> list(p.glob('**/*.py'))\n"
"[PosixPath('test_pathlib.py'), PosixPath('setup.py'),\n"
" PosixPath('pathlib.py'), PosixPath('docs/conf.py'),\n"
" PosixPath('build/lib/pathlib.py')]"
msgstr ""
">>> list(p.glob('**/*.py'))\n"
"[PosixPath('test_pathlib.py'), PosixPath('setup.py'),\n"
" PosixPath('pathlib.py'), PosixPath('docs/conf.py'),\n"
" PosixPath('build/lib/pathlib.py')]"
#: ../../library/pathlib.rst:73
msgid "Navigating inside a directory tree::"
msgstr "ディレクトリツリー内を移動します::"
#: ../../library/pathlib.rst:75
msgid ""
">>> p = Path('/etc')\n"
">>> q = p / 'init.d' / 'reboot'\n"
">>> q\n"
"PosixPath('/etc/init.d/reboot')\n"
">>> q.resolve()\n"
"PosixPath('/etc/rc.d/init.d/halt')"
msgstr ""
#: ../../library/pathlib.rst:82
msgid "Querying path properties::"
msgstr "パスのプロパティを問い合わせます::"
#: ../../library/pathlib.rst:84
msgid ""
">>> q.exists()\n"
"True\n"
">>> q.is_dir()\n"
"False"
msgstr ""
">>> q.exists()\n"
"True\n"
">>> q.is_dir()\n"
"False"
#: ../../library/pathlib.rst:89
msgid "Opening a file::"
msgstr "ファイルを開きます::"
#: ../../library/pathlib.rst:91
msgid ""
">>> with q.open() as f: f.readline()\n"
"...\n"
"'#!/bin/bash\\n'"
msgstr ""
">>> with q.open() as f: f.readline()\n"
"...\n"
"'#!/bin/bash\\n'"
#: ../../library/pathlib.rst:97
msgid "Exceptions"
msgstr "例外"
#: ../../library/pathlib.rst:101
msgid ""
"An exception inheriting :exc:`NotImplementedError` that is raised when an "
"unsupported operation is called on a path object."
msgstr ""
":exc:`NotImplementedError` を継承した例外です。パスオブジェクトがサポートして"
"いない操作を行おうとした時に送出されます。 "
#: ../../library/pathlib.rst:110
msgid "Pure paths"
msgstr "純粋パス"
#: ../../library/pathlib.rst:112
msgid ""
"Pure path objects provide path-handling operations which don't actually "
"access a filesystem. There are three ways to access these classes, which we "
"also call *flavours*:"
msgstr ""
"純粋パスオブジェクトは実際にファイルシステムにアクセスしないパス操作処理を提"
"供します。これらのクラスにアクセスするには 3 つの方法があり、それらを *フレー"
"バー* と呼んでいます:"
#: ../../library/pathlib.rst:118
msgid ""
"A generic class that represents the system's path flavour (instantiating it "
"creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::"
msgstr ""
"システムのパスのフレーバーを表すジェネリッククラスです (インスタンスを作成す"
"ることで :class:`PurePosixPath` または :class:`PureWindowsPath` のどちらかが"
"作成されます)::"
#: ../../library/pathlib.rst:121
msgid ""
">>> PurePath('setup.py') # Running on a Unix machine\n"
"PurePosixPath('setup.py')"
msgstr ""
#: ../../library/pathlib.rst:124
msgid ""
"Each element of *pathsegments* can be either a string representing a path "
"segment, or an object implementing the :class:`os.PathLike` interface where "
"the :meth:`~os.PathLike.__fspath__` method returns a string, such as another "
"path object::"
msgstr ""
"*pathsegments* の各要素は、パスの構成要素を表す文字列か、パスオブジェクトなど"
"の、 :class:`os.PathLike` インターフェースを実装するオブジェクトである必要が"
"あります。\n"
":class:`os.PathLike` インターフェースでは、 :meth:`~os.PathLike.__fspath__` "
"メソッドが文字列を返します::"
#: ../../library/pathlib.rst:129
msgid ""
">>> PurePath('foo', 'some/path', 'bar')\n"
"PurePosixPath('foo/some/path/bar')\n"
">>> PurePath(Path('foo'), Path('bar'))\n"
"PurePosixPath('foo/bar')"
msgstr ""
">>> PurePath('foo', 'some/path', 'bar')\n"
"PurePosixPath('foo/some/path/bar')\n"
">>> PurePath(Path('foo'), Path('bar'))\n"
"PurePosixPath('foo/bar')"
#: ../../library/pathlib.rst:134
msgid ""
"When *pathsegments* is empty or consists only of empty strings, the current "
"directory is assumed::"
msgstr ""
#: ../../library/pathlib.rst:137
msgid ""
">>> PurePath(), PurePath('')\n"
"(PurePosixPath('.'), PurePosixPath('.'))"
msgstr ""
#: ../../library/pathlib.rst:140
msgid ""
"If a segment is an absolute path, all previous segments are ignored (like :"
"func:`os.path.join`)::"
msgstr ""
"あるパス構成要素が絶対パスである場合、それより前の要素はすべて無視されます (:"
"func:`os.path.join` と同様)::"
#: ../../library/pathlib.rst:143
msgid ""
">>> PurePath('/etc', '/usr', 'lib64')\n"
"PurePosixPath('/usr/lib64')\n"
">>> PureWindowsPath('c:/Windows', 'd:bar')\n"
"PureWindowsPath('d:bar')"
msgstr ""
">>> PurePath('/etc', '/usr', 'lib64')\n"
"PurePosixPath('/usr/lib64')\n"
">>> PureWindowsPath('c:/Windows', 'd:bar')\n"
"PureWindowsPath('d:bar')"
#: ../../library/pathlib.rst:148
msgid ""
"On Windows, the drive is not reset when a rooted relative path segment (e."
"g., ``r'\\foo'``) is encountered::"
msgstr ""
"Windowsの場合、ルート相対パス (例えば ``r'\\foo'``) があってもドライブ名はそ"
"のまま変わりません::"
#: ../../library/pathlib.rst:151
msgid ""
">>> PureWindowsPath('c:/Windows', '/Program Files')\n"
"PureWindowsPath('c:/Program Files')"
msgstr ""
">>> PureWindowsPath('c:/Windows', '/Program Files')\n"
"PureWindowsPath('c:/Program Files')"
#: ../../library/pathlib.rst:154
msgid ""
"Spurious slashes and single dots are collapsed, but double dots (``'..'``) "
"and leading double slashes (``'//'``) are not, since this would change the "
"meaning of a path for various reasons (e.g. symbolic links, UNC paths)::"
msgstr ""
"単一スラッシュと等価な複数スラッシュやシングルドットは簡略化されますが、ダブ"
"ルドット (``'..'``) や先頭に位置するダブルスラッシュ (``'//'``) は簡略化され"
"ません。\n"
"これは、様々な理由でパスの意味が簡略化した場合と異なってしまうからです (例: "
"シンボリックリンク、UNCパス)::"
#: ../../library/pathlib.rst:158
msgid ""
">>> PurePath('foo//bar')\n"
"PurePosixPath('foo/bar')\n"
">>> PurePath('//foo/bar')\n"
"PurePosixPath('//foo/bar')\n"
">>> PurePath('foo/./bar')\n"
"PurePosixPath('foo/bar')\n"
">>> PurePath('foo/../bar')\n"
"PurePosixPath('foo/../bar')"
msgstr ""
">>> PurePath('foo//bar')\n"
"PurePosixPath('foo/bar')\n"
">>> PurePath('//foo/bar')\n"
"PurePosixPath('//foo/bar')\n"
">>> PurePath('foo/./bar')\n"
"PurePosixPath('foo/bar')\n"
">>> PurePath('foo/../bar')\n"
"PurePosixPath('foo/../bar')"
#: ../../library/pathlib.rst:167
msgid ""
"(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to "
"``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to "
"another directory)"
msgstr ""
"(通常 ``PurePosixPath('foo/../bar')`` は ``PurePosixPath('bar')`` と等価にな"
"りますが、``foo`` が他のディレクトリへのシンボリックリンクの場合は等価になり"
"ません)"
#: ../../library/pathlib.rst:171
msgid ""
"Pure path objects implement the :class:`os.PathLike` interface, allowing "
"them to be used anywhere the interface is accepted."
msgstr ""
"純粋パスオブジェクトは :class:`os.PathLike` インターフェースを実装しており、"
"そのインターフェースを受理する箇所ならどこでも使用することができます。"
#: ../../library/pathlib.rst:174
msgid "Added support for the :class:`os.PathLike` interface."
msgstr ":class:`os.PathLike` インターフェースがサポートされました。"
#: ../../library/pathlib.rst:179
msgid ""
"A subclass of :class:`PurePath`, this path flavour represents non-Windows "
"filesystem paths::"
msgstr ""
":class:`PurePath` のサブクラスです。このパスフレーバーは非 Windows パスを表し"
"ます::"
#: ../../library/pathlib.rst:182
msgid ""
">>> PurePosixPath('/etc/hosts')\n"
"PurePosixPath('/etc/hosts')"
msgstr ""
">>> PurePosixPath('/etc/hosts')\n"
"PurePosixPath('/etc/hosts')"
#: ../../library/pathlib.rst:185 ../../library/pathlib.rst:197
#: ../../library/pathlib.rst:770 ../../library/pathlib.rst:780
#: ../../library/pathlib.rst:795
msgid "*pathsegments* is specified similarly to :class:`PurePath`."
msgstr "*pathsegments* の指定は :class:`PurePath` と同じです。"
#: ../../library/pathlib.rst:189
msgid ""
"A subclass of :class:`PurePath`, this path flavour represents Windows "
"filesystem paths, including `UNC paths`_::"
msgstr ""
":class:`PurePath` のサブクラスです。このパスフレーバー `UNC paths`_ を含む "
"Windows ファイルシステムパスを表します::"
#: ../../library/pathlib.rst:192
msgid ""
">>> PureWindowsPath('c:/', 'Users', 'Ximénez')\n"
"PureWindowsPath('c:/Users/Ximénez')\n"
">>> PureWindowsPath('//server/share/file')\n"
"PureWindowsPath('//server/share/file')"
msgstr ""
">>> PureWindowsPath('c:/', 'Users', 'Ximénez')\n"
"PureWindowsPath('c:/Users/Ximénez')\n"
">>> PureWindowsPath('//server/share/file')\n"
"PureWindowsPath('//server/share/file')"
#: ../../library/pathlib.rst:201
msgid ""
"Regardless of the system you're running on, you can instantiate all of these "
"classes, since they don't provide any operation that does system calls."
msgstr ""
"これらクラスはあらゆるシステムコールを行わないため、起動しているシステムにか"
"かわらずインスタンスを作成できます。"
#: ../../library/pathlib.rst:206
msgid "General properties"
msgstr "全般的な性質"
#: ../../library/pathlib.rst:208
msgid ""
"Paths are immutable and :term:`hashable`. Paths of a same flavour are "
"comparable and orderable. These properties respect the flavour's case-"
"folding semantics::"
msgstr ""
"パスオブジェクトはイミュータブルで :term:`ハッシュ可能 <hashable>` です。同じ"
"フレーバーのパスオブジェクトは比較ならびに順序付け可能です。これらのプロパ"
"ティは、フレーバーのケースフォールディング (訳注: 比較のために正規化するこ"
"と、例えば全て大文字にする) のセマンティクスに従います。"
#: ../../library/pathlib.rst:212
msgid ""
">>> PurePosixPath('foo') == PurePosixPath('FOO')\n"
"False\n"
">>> PureWindowsPath('foo') == PureWindowsPath('FOO')\n"
"True\n"
">>> PureWindowsPath('FOO') in { PureWindowsPath('foo') }\n"
"True\n"
">>> PureWindowsPath('C:') < PureWindowsPath('d:')\n"
"True"
msgstr ""
">>> PurePosixPath('foo') == PurePosixPath('FOO')\n"
"False\n"
">>> PureWindowsPath('foo') == PureWindowsPath('FOO')\n"
"True\n"
">>> PureWindowsPath('FOO') in { PureWindowsPath('foo') }\n"
"True\n"
">>> PureWindowsPath('C:') < PureWindowsPath('d:')\n"
"True"
#: ../../library/pathlib.rst:221
msgid "Paths of a different flavour compare unequal and cannot be ordered::"
msgstr ""
"異なるフレーバーのパスオブジェクト同士の比較は等価になることはなく、順序付け"
"もできません::"
#: ../../library/pathlib.rst:223
msgid ""
">>> PureWindowsPath('foo') == PurePosixPath('foo')\n"
"False\n"
">>> PureWindowsPath('foo') < PurePosixPath('foo')\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"TypeError: '<' not supported between instances of 'PureWindowsPath' and "
"'PurePosixPath'"
msgstr ""
">>> PureWindowsPath('foo') == PurePosixPath('foo')\n"
"False\n"
">>> PureWindowsPath('foo') < PurePosixPath('foo')\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"TypeError: '<' not supported between instances of 'PureWindowsPath' and "
"'PurePosixPath'"
#: ../../library/pathlib.rst:232
msgid "Operators"
msgstr "演算子"
#: ../../library/pathlib.rst:234
msgid ""
"The slash operator helps create child paths, like :func:`os.path.join`. If "
"the argument is an absolute path, the previous path is ignored. On Windows, "
"the drive is not reset when the argument is a rooted relative path (e.g., "
"``r'\\foo'``)::"
msgstr ""
"スラッシュ演算子を使って、 :func:`os.path.join` のように子パスを作成すること"
"ができます。\n"
"スラッシュの右側が絶対パスである場合、左側のパスは無視されます。\n"
"Windows環境で、右側のパスがルート相対パス (例: ``r'\\foo'``) である場合、ドラ"
"イブ名はリセットされません::"
#: ../../library/pathlib.rst:239
msgid ""
">>> p = PurePath('/etc')\n"
">>> p\n"
"PurePosixPath('/etc')\n"
">>> p / 'init.d' / 'apache2'\n"
"PurePosixPath('/etc/init.d/apache2')\n"
">>> q = PurePath('bin')\n"
">>> '/usr' / q\n"
"PurePosixPath('/usr/bin')\n"
">>> p / '/an_absolute_path'\n"
"PurePosixPath('/an_absolute_path')\n"
">>> PureWindowsPath('c:/Windows', '/Program Files')\n"
"PureWindowsPath('c:/Program Files')"
msgstr ""
">>> p = PurePath('/etc')\n"
">>> p\n"
"PurePosixPath('/etc')\n"
">>> p / 'init.d' / 'apache2'\n"
"PurePosixPath('/etc/init.d/apache2')\n"
">>> q = PurePath('bin')\n"
">>> '/usr' / q\n"
"PurePosixPath('/usr/bin')\n"
">>> p / '/an_absolute_path'\n"
"PurePosixPath('/an_absolute_path')\n"
">>> PureWindowsPath('c:/Windows', '/Program Files')\n"
"PureWindowsPath('c:/Program Files')"
#: ../../library/pathlib.rst:252
msgid ""
"A path object can be used anywhere an object implementing :class:`os."
"PathLike` is accepted::"
msgstr ""
":class:`os.PathLike` を実装したオブジェクトが受理できる箇所ならどこでも、パス"
"オブジェクトが使用できます::"
#: ../../library/pathlib.rst:255
msgid ""
">>> import os\n"
">>> p = PurePath('/etc')\n"
">>> os.fspath(p)\n"
"'/etc'"
msgstr ""
">>> import os\n"
">>> p = PurePath('/etc')\n"
">>> os.fspath(p)\n"
"'/etc'"
#: ../../library/pathlib.rst:260
msgid ""
"The string representation of a path is the raw filesystem path itself (in "
"native form, e.g. with backslashes under Windows), which you can pass to any "
"function taking a file path as a string::"
msgstr ""
"パスオブジェクトの文字列表現はそのシステム自身の Raw ファイルシステムパス (ネ"
"イティブの形式、例えば Windows では区切り文字がバックスラッシュ) になり、文字"
"列としてファイルパスを取るあらゆる関数に渡すことができます::"
#: ../../library/pathlib.rst:264
msgid ""
">>> p = PurePath('/etc')\n"
">>> str(p)\n"
"'/etc'\n"
">>> p = PureWindowsPath('c:/Program Files')\n"
">>> str(p)\n"
"'c:\\\\Program Files'"
msgstr ""
">>> p = PurePath('/etc')\n"
">>> str(p)\n"
"'/etc'\n"
">>> p = PureWindowsPath('c:/Program Files')\n"
">>> str(p)\n"
"'c:\\\\Program Files'"
#: ../../library/pathlib.rst:271
msgid ""
"Similarly, calling :class:`bytes` on a path gives the raw filesystem path as "
"a bytes object, as encoded by :func:`os.fsencode`::"
msgstr ""
"同様に、パスオブジェクトを :class:`bytes` で呼び出すと、Raw ファイルシステム"
"パスを :func:`os.fsencode` でエンコードされたバイト列オブジェクトで返します::"
#: ../../library/pathlib.rst:274
msgid ""
">>> bytes(p)\n"
"b'/etc'"
msgstr ""
">>> bytes(p)\n"
"b'/etc'"
#: ../../library/pathlib.rst:278
msgid ""
"Calling :class:`bytes` is only recommended under Unix. Under Windows, the "
"unicode form is the canonical representation of filesystem paths."
msgstr ""
":class:`bytes` での呼び出しは Unix 上での使用のみ推奨します。Windows では "
"Unicode 形式が標準的なファイルシステムパス表現になります。"
#: ../../library/pathlib.rst:283
msgid "Accessing individual parts"
msgstr "個別の構成要素へのアクセス"
#: ../../library/pathlib.rst:285
msgid ""
"To access the individual \"parts\" (components) of a path, use the following "
"property:"
msgstr ""
"パスの個別の \"構成要素\" へアクセスするには、以下のプロパティを使用します:"
#: ../../library/pathlib.rst:290
msgid "A tuple giving access to the path's various components::"
msgstr "パスのさまざまな構成要素へのアクセス手段を提供するタプルになります::"
#: ../../library/pathlib.rst:292
msgid ""
">>> p = PurePath('/usr/bin/python3')\n"
">>> p.parts\n"
"('/', 'usr', 'bin', 'python3')\n"
"\n"
">>> p = PureWindowsPath('c:/Program Files/PSF')\n"
">>> p.parts\n"
"('c:\\\\', 'Program Files', 'PSF')"
msgstr ""
">>> p = PurePath('/usr/bin/python3')\n"
">>> p.parts\n"
"('/', 'usr', 'bin', 'python3')\n"
"\n"
">>> p = PureWindowsPath('c:/Program Files/PSF')\n"
">>> p.parts\n"
"('c:\\\\', 'Program Files', 'PSF')"
#: ../../library/pathlib.rst:300
msgid "(note how the drive and local root are regrouped in a single part)"
msgstr "(ドライブ名とローカルルートは単一要素にまとめられます)"
#: ../../library/pathlib.rst:304
msgid "Methods and properties"
msgstr "メソッドとプロパティ"
#: ../../library/pathlib.rst:310
msgid "Pure paths provide the following methods and properties:"
msgstr "純粋パスは以下のメソッドとプロパティを提供します:"
#: ../../library/pathlib.rst:314
msgid ""
"The implementation of the :mod:`os.path` module used for low-level path "
"parsing and joining: either :mod:`!posixpath` or :mod:`!ntpath`."
msgstr ""
"低レベルのパスのパースと結合に使用される :mod:`os.path` モジュールの実装。:"
"mod:`!posixpath` または :mod:`!ntpath`。"
#: ../../library/pathlib.rst:321
msgid "A string representing the drive letter or name, if any::"
msgstr "ドライブ文字または名前を表す文字列があればそれになります::"
#: ../../library/pathlib.rst:323
msgid ""
">>> PureWindowsPath('c:/Program Files/').drive\n"
"'c:'\n"
">>> PureWindowsPath('/Program Files/').drive\n"
"''\n"
">>> PurePosixPath('/etc').drive\n"
"''"
msgstr ""
#: ../../library/pathlib.rst:330
msgid "UNC shares are also considered drives::"
msgstr "UNC 共有名もドライブとみなされます::"
#: ../../library/pathlib.rst:332
msgid ""
">>> PureWindowsPath('//host/share/foo.txt').drive\n"
"'\\\\\\\\host\\\\share'"
msgstr ""
#: ../../library/pathlib.rst:337
msgid "A string representing the (local or global) root, if any::"
msgstr "ローカルまたはグローバルルートを表す文字列があればそれになります::"
#: ../../library/pathlib.rst:339
msgid ""
">>> PureWindowsPath('c:/Program Files/').root\n"
"'\\\\'\n"
">>> PureWindowsPath('c:Program Files/').root\n"
"''\n"
">>> PurePosixPath('/etc').root\n"
"'/'"
msgstr ""
#: ../../library/pathlib.rst:346
msgid "UNC shares always have a root::"
msgstr "UNC 共有名は常にルートを持ちます::"
#: ../../library/pathlib.rst:348
msgid ""
">>> PureWindowsPath('//host/share').root\n"
"'\\\\'"
msgstr ""
#: ../../library/pathlib.rst:351
msgid ""
"If the path starts with more than two successive slashes, :class:`~pathlib."
"PurePosixPath` collapses them::"
msgstr ""
":class:`~pathlib.PurePosixPath` でパスの先頭が3つ以上の連続したスラッシュで"
"ある場合、 余分なスラッシュは除去されます::"
#: ../../library/pathlib.rst:354
msgid ""
">>> PurePosixPath('//etc').root\n"
"'//'\n"
">>> PurePosixPath('///etc').root\n"
"'/'\n"
">>> PurePosixPath('////etc').root\n"
"'/'"
msgstr ""
#: ../../library/pathlib.rst:363
msgid ""
"This behavior conforms to *The Open Group Base Specifications Issue 6*, "
"paragraph `4.11 Pathname Resolution <https://pubs.opengroup.org/"
"onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11>`_:"
msgstr ""
"この挙動は、以下に示す、 *The Open Group Base Specifications Issue 6* の "
"`4.11 Pathname Resolution <https://pubs.opengroup.org/onlinepubs/009695399/"
"basedefs/xbd_chap04.html#tag_04_11>`_ に沿ったものです:"
#: ../../library/pathlib.rst:367
msgid ""
"*\"A pathname that begins with two successive slashes may be interpreted in "
"an implementation-defined manner, although more than two leading slashes "
"shall be treated as a single slash.\"*"
msgstr ""
#: ../../library/pathlib.rst:373
msgid "The concatenation of the drive and root::"
msgstr "ドライブとルートを結合した文字列になります::"
#: ../../library/pathlib.rst:375
msgid ""
">>> PureWindowsPath('c:/Program Files/').anchor\n"
"'c:\\\\'\n"
">>> PureWindowsPath('c:Program Files/').anchor\n"
"'c:'\n"
">>> PurePosixPath('/etc').anchor\n"
"'/'\n"
">>> PureWindowsPath('//host/share').anchor\n"
"'\\\\\\\\host\\\\share\\\\'"
msgstr ""
#: ../../library/pathlib.rst:387
msgid ""
"An immutable sequence providing access to the logical ancestors of the path::"
msgstr ""
"パスの論理的な上位パスにアクセスできるイミュータブルなシーケンスになります::"
#: ../../library/pathlib.rst:390
msgid ""
">>> p = PureWindowsPath('c:/foo/bar/setup.py')\n"
">>> p.parents[0]\n"
"PureWindowsPath('c:/foo/bar')\n"
">>> p.parents[1]\n"
"PureWindowsPath('c:/foo')\n"
">>> p.parents[2]\n"
"PureWindowsPath('c:/')"
msgstr ""
#: ../../library/pathlib.rst:398
msgid ""
"The parents sequence now supports :term:`slices <slice>` and negative index "
"values."
msgstr ""
"parents シーケンスが、:term:`スライス <slice>` と負のインデックスをサポートす"
"るようになりました。"
#: ../../library/pathlib.rst:403
msgid "The logical parent of the path::"
msgstr "パスの論理的な上位パスになります::"
#: ../../library/pathlib.rst:405
msgid ""
">>> p = PurePosixPath('/a/b/c/d')\n"
">>> p.parent\n"
"PurePosixPath('/a/b/c')"
msgstr ""
#: ../../library/pathlib.rst:409
msgid "You cannot go past an anchor, or empty path::"
msgstr "アンカーの位置を超えることや空のパスになる位置には対応していません::"
#: ../../library/pathlib.rst:411
msgid ""
">>> p = PurePosixPath('/')\n"
">>> p.parent\n"
"PurePosixPath('/')\n"
">>> p = PurePosixPath('.')\n"
">>> p.parent\n"
"PurePosixPath('.')"
msgstr ""
#: ../../library/pathlib.rst:419
msgid "This is a purely lexical operation, hence the following behaviour::"
msgstr "これは純粋な字句操作であるため、以下のような挙動になります::"
#: ../../library/pathlib.rst:421
msgid ""
">>> p = PurePosixPath('foo/..')\n"
">>> p.parent\n"
"PurePosixPath('foo')"
msgstr ""
#: ../../library/pathlib.rst:425
msgid ""
"If you want to walk an arbitrary filesystem path upwards, it is recommended "
"to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate "
"``\"..\"`` components."
msgstr ""
"任意のファイルシステムパスを上位方向に移動したい場合、シンボリックリンクの解"
"決や ``\"..\"`` 要素の除去のため、最初に :meth:`Path.resolve` を呼ぶことを推"
"奨します。"
#: ../../library/pathlib.rst:432
msgid ""
"A string representing the final path component, excluding the drive and "
"root, if any::"
msgstr ""
"パス要素の末尾を表す文字列があればそれになります。ドライブやルートは含まれま"
"せん::"
#: ../../library/pathlib.rst:435
msgid ""
">>> PurePosixPath('my/library/setup.py').name\n"
"'setup.py'"
msgstr ""
#: ../../library/pathlib.rst:438
msgid "UNC drive names are not considered::"
msgstr "UNC ドライブ名は考慮されません::"
#: ../../library/pathlib.rst:440
msgid ""
">>> PureWindowsPath('//some/share/setup.py').name\n"
"'setup.py'\n"
">>> PureWindowsPath('//some/share').name\n"
"''"
msgstr ""
#: ../../library/pathlib.rst:448
msgid "The last dot-separated portion of the final component, if any::"
msgstr "末尾の要素をドットで分割した最後の部分があれば、それになります::"
#: ../../library/pathlib.rst:450
msgid ""
">>> PurePosixPath('my/library/setup.py').suffix\n"
"'.py'\n"
">>> PurePosixPath('my/library.tar.gz').suffix\n"
"'.gz'\n"
">>> PurePosixPath('my/library').suffix\n"
"''"
msgstr ""
#: ../../library/pathlib.rst:457
msgid "This is commonly called the file extension."
msgstr "一般的にはファイル拡張子と呼ばれています。"
#: ../../library/pathlib.rst:461 ../../library/pathlib.rst:476
#: ../../library/pathlib.rst:492
msgid "A single dot (\"``.``\") is considered a valid suffix."
msgstr ""
#: ../../library/pathlib.rst:465
msgid "A list of the path's suffixes, often called file extensions::"
msgstr "パスのサフィックス(ファイル拡張子)のリストです::"
#: ../../library/pathlib.rst:467
msgid ""
">>> PurePosixPath('my/library.tar.gar').suffixes\n"
"['.tar', '.gar']\n"
">>> PurePosixPath('my/library.tar.gz').suffixes\n"
"['.tar', '.gz']\n"
">>> PurePosixPath('my/library').suffixes\n"
"[]"
msgstr ""
#: ../../library/pathlib.rst:481
msgid "The final path component, without its suffix::"
msgstr "パス要素の末尾から拡張子を除いたものになります::"
#: ../../library/pathlib.rst:483
msgid ""
">>> PurePosixPath('my/library.tar.gz').stem\n"
"'library.tar'\n"
">>> PurePosixPath('my/library.tar').stem\n"
"'library'\n"
">>> PurePosixPath('my/library').stem\n"
"'library'"
msgstr ""
#: ../../library/pathlib.rst:497
msgid ""
"Return a string representation of the path with forward slashes (``/``)::"
msgstr "フォワードスラッシュ (``/``) を使用したパスを表す文字列を返します::"
#: ../../library/pathlib.rst:499
msgid ""
">>> p = PureWindowsPath('c:\\\\windows')\n"
">>> str(p)\n"
"'c:\\\\windows'\n"
">>> p.as_posix()\n"
"'c:/windows'"
msgstr ""
#: ../../library/pathlib.rst:508
msgid ""
"Return whether the path is absolute or not. A path is considered absolute "
"if it has both a root and (if the flavour allows) a drive::"
msgstr ""
"パスが絶対パスかどうかを返します。パスが絶対パスとみなされるのは、ルートと "
"(フレーバーが許す場合) ドライブとの両方が含まれる場合です::"
#: ../../library/pathlib.rst:511
msgid ""
">>> PurePosixPath('/a/b').is_absolute()\n"
"True\n"
">>> PurePosixPath('a/b').is_absolute()\n"
"False\n"
"\n"
">>> PureWindowsPath('c:/a/b').is_absolute()\n"
"True\n"
">>> PureWindowsPath('/a/b').is_absolute()\n"
"False\n"
">>> PureWindowsPath('c:').is_absolute()\n"
"False\n"
">>> PureWindowsPath('//some/share').is_absolute()\n"
"True"
msgstr ""
#: ../../library/pathlib.rst:528
msgid "Return whether or not this path is relative to the *other* path."
msgstr ""
"このパスが *other* パスに対して相対なのかそうでないのかの結果を返します。"
#: ../../library/pathlib.rst:536
msgid ""
"This method is string-based; it neither accesses the filesystem nor treats "
"\"``..``\" segments specially. The following code is equivalent:"
msgstr ""
#: ../../library/pathlib.rst:547
msgid ""
"Passing additional arguments is deprecated; if supplied, they are joined "
"with *other*."
msgstr ""
"追加の引数指定は非推奨となりました。指定された場合は *other* と連結されます。"
#: ../../library/pathlib.rst:552
msgid ""
"Calling this method is equivalent to combining the path with each of the "
"given *pathsegments* in turn::"
msgstr ""
"このメソッドの呼び出しは、与えられた *pathsegments* のパスを順番に結合するこ"
"とと等価です。"
#: ../../library/pathlib.rst:555
msgid ""
">>> PurePosixPath('/etc').joinpath('passwd')\n"
"PurePosixPath('/etc/passwd')\n"
">>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))\n"
"PurePosixPath('/etc/passwd')\n"
">>> PurePosixPath('/etc').joinpath('init.d', 'apache2')\n"
"PurePosixPath('/etc/init.d/apache2')\n"
">>> PureWindowsPath('c:').joinpath('/Program Files')\n"
"PureWindowsPath('c:/Program Files')"
msgstr ""
#: ../../library/pathlib.rst:567
msgid ""
"Match this path against the provided glob-style pattern. Return ``True`` if "
"matching is successful, ``False`` otherwise. For example::"
msgstr ""
"現在のパスが glob 形式で与えられたパターンと一致したら ``True`` を、一致しな"
"ければ ``False`` を返します。例::"
#: ../../library/pathlib.rst:570
msgid ""
">>> PurePath('a/b.py').full_match('a/*.py')\n"
"True\n"
">>> PurePath('a/b.py').full_match('*.py')\n"
"False\n"
">>> PurePath('/a/b/c.py').full_match('/a/**')\n"
"True\n"
">>> PurePath('/a/b/c.py').full_match('**/*.py')\n"
"True"
msgstr ""
#: ../../library/pathlib.rst:580 ../../library/pathlib.rst:1346
msgid ":ref:`pathlib-pattern-language` documentation."
msgstr ":ref:`pathlib-pattern-language` ドキュメント。"
#: ../../library/pathlib.rst:582
msgid "As with other methods, case-sensitivity follows platform defaults::"
msgstr ""
"他のメソッドと同様に、大文字小文字の区別はプラットフォームの設定に従います::"
#: ../../library/pathlib.rst:584
msgid ""
">>> PurePosixPath('b.py').full_match('*.PY')\n"
"False\n"
">>> PureWindowsPath('b.py').full_match('*.PY')\n"
"True"
msgstr ""