7
7
msgstr ""
8
8
"Project-Id-Version :Python 3.10\n "
9
9
"Report-Msgid-Bugs-To :\n "
10
- "POT-Creation-Date :2022-06-22 00:18 +0000\n "
10
+ "POT-Creation-Date :2022-10-11 00:23 +0000\n "
11
11
"PO-Revision-Date :2018-05-23 16:15+0000\n "
12
12
"Last-Translator :Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -333,113 +333,129 @@ msgid ""
333
333
"environment in ``PATH``."
334
334
msgstr ""
335
335
336
- #: ../../library/venv.rst:91
336
+ #: ../../library/venv.rst:87
337
+ msgid ""
338
+ "Because scripts installed in environments should not expect the environment "
339
+ "to be activated, their shebang lines contain the absolute paths to their "
340
+ "environment's interpreters. Because of this, environments are inherently non-"
341
+ "portable, in the general case. You should always have a simple means of "
342
+ "recreating an environment (for example, if you have a requirements file "
343
+ "``requirements.txt``, you can invoke ``pip install -r requirements.txt`` "
344
+ "using the environment's ``pip`` to install all of the packages needed by the "
345
+ "environment). If for any reason you need to move the environment to a new "
346
+ "location, you should recreate it at the desired location and delete the one "
347
+ "at the old location. If you move an environment because you moved a parent "
348
+ "directory of it, you should recreate the environment in its new location. "
349
+ "Otherwise, software installed into the environment may not work as expected."
350
+ msgstr ""
351
+
352
+ #: ../../library/venv.rst:104
337
353
msgid "API"
338
354
msgstr "API"
339
355
340
- #: ../../library/venv.rst:95
356
+ #: ../../library/venv.rst:108
341
357
msgid ""
342
358
"The high-level method described above makes use of a simple API which "
343
359
"provides mechanisms for third-party virtual environment creators to "
344
360
"customize environment creation according to their needs, the :class:"
345
361
"`EnvBuilder` class."
346
362
msgstr ""
347
363
348
- #: ../../library/venv.rst:103
364
+ #: ../../library/venv.rst:116
349
365
msgid ""
350
366
"The :class:`EnvBuilder` class accepts the following keyword arguments on "
351
367
"instantiation:"
352
368
msgstr ""
353
369
354
- #: ../../library/venv.rst:106
370
+ #: ../../library/venv.rst:119
355
371
msgid ""
356
372
"``system_site_packages`` -- a Boolean value indicating that the system "
357
373
"Python site-packages should be available to the environment (defaults to "
358
374
"``False``)."
359
375
msgstr ""
360
376
361
- #: ../../library/venv.rst:109
377
+ #: ../../library/venv.rst:122
362
378
msgid ""
363
379
"``clear`` -- a Boolean value which, if true, will delete the contents of any "
364
380
"existing target directory, before creating the environment."
365
381
msgstr ""
366
382
367
- #: ../../library/venv.rst:112
383
+ #: ../../library/venv.rst:125
368
384
msgid ""
369
385
"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the "
370
386
"Python binary rather than copying."
371
387
msgstr ""
372
388
373
- #: ../../library/venv.rst:115
389
+ #: ../../library/venv.rst:128
374
390
msgid ""
375
391
"``upgrade`` -- a Boolean value which, if true, will upgrade an existing "
376
392
"environment with the running Python - for use when that Python has been "
377
393
"upgraded in-place (defaults to ``False``)."
378
394
msgstr ""
379
395
380
- #: ../../library/venv.rst:119
396
+ #: ../../library/venv.rst:132
381
397
msgid ""
382
398
"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in "
383
399
"the virtual environment. This uses :mod:`ensurepip` with the ``--default-"
384
400
"pip`` option."
385
401
msgstr ""
386
402
387
- #: ../../library/venv.rst:123
403
+ #: ../../library/venv.rst:136
388
404
msgid ""
389
405
"``prompt`` -- a String to be used after virtual environment is activated "
390
406
"(defaults to ``None`` which means directory name of the environment would be "
391
407
"used). If the special string ``\" .\" `` is provided, the basename of the "
392
408
"current directory is used as the prompt."
393
409
msgstr ""
394
410
395
- #: ../../library/venv.rst:128
411
+ #: ../../library/venv.rst:141
396
412
msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI"
397
413
msgstr ""
398
414
399
- #: ../../library/venv.rst:130 ../../library/venv.rst:260
415
+ #: ../../library/venv.rst:143 ../../library/venv.rst:273
400
416
msgid "Added the ``with_pip`` parameter"
401
417
msgstr "新增 ``with_pip`` 參數"
402
418
403
- #: ../../library/venv.rst:133 ../../library/venv.rst:263
419
+ #: ../../library/venv.rst:146 ../../library/venv.rst:276
404
420
msgid "Added the ``prompt`` parameter"
405
421
msgstr "新增 ``prompt`` 參數"
406
422
407
- #: ../../library/venv.rst:136 ../../library/venv.rst:266
423
+ #: ../../library/venv.rst:149 ../../library/venv.rst:279
408
424
msgid "Added the ``upgrade_deps`` parameter"
409
425
msgstr "新增 ``upgrade_deps`` 參數"
410
426
411
- #: ../../library/venv.rst:139
427
+ #: ../../library/venv.rst:152
412
428
msgid ""
413
429
"Creators of third-party virtual environment tools will be free to use the "
414
430
"provided :class:`EnvBuilder` class as a base class."
415
431
msgstr ""
416
432
417
- #: ../../library/venv.rst:142
433
+ #: ../../library/venv.rst:155
418
434
msgid "The returned env-builder is an object which has a method, ``create``:"
419
435
msgstr ""
420
436
421
- #: ../../library/venv.rst:146
437
+ #: ../../library/venv.rst:159
422
438
msgid ""
423
439
"Create a virtual environment by specifying the target directory (absolute or "
424
440
"relative to the current directory) which is to contain the virtual "
425
441
"environment. The ``create`` method will either create the environment in "
426
442
"the specified directory, or raise an appropriate exception."
427
443
msgstr ""
428
444
429
- #: ../../library/venv.rst:152
445
+ #: ../../library/venv.rst:165
430
446
msgid ""
431
447
"The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks "
432
448
"available for subclass customization::"
433
449
msgstr ""
434
450
435
- #: ../../library/venv.rst:167
451
+ #: ../../library/venv.rst:180
436
452
msgid ""
437
453
"Each of the methods :meth:`ensure_directories`, :meth:"
438
454
"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :"
439
455
"meth:`post_setup` can be overridden."
440
456
msgstr ""
441
457
442
- #: ../../library/venv.rst:173
458
+ #: ../../library/venv.rst:186
443
459
msgid ""
444
460
"Creates the environment directory and all necessary directories, and returns "
445
461
"a context object. This is just a holder for attributes (such as paths), for "
@@ -448,60 +464,60 @@ msgid ""
448
464
"an existing environment directory."
449
465
msgstr ""
450
466
451
- #: ../../library/venv.rst:181
467
+ #: ../../library/venv.rst:194
452
468
msgid "Creates the ``pyvenv.cfg`` configuration file in the environment."
453
469
msgstr ""
454
470
455
- #: ../../library/venv.rst:185
471
+ #: ../../library/venv.rst:198
456
472
msgid ""
457
473
"Creates a copy or symlink to the Python executable in the environment. On "
458
474
"POSIX systems, if a specific executable ``python3.x`` was used, symlinks to "
459
475
"``python`` and ``python3`` will be created pointing to that executable, "
460
476
"unless files with those names already exist."
461
477
msgstr ""
462
478
463
- #: ../../library/venv.rst:192
479
+ #: ../../library/venv.rst:205
464
480
msgid ""
465
481
"Installs activation scripts appropriate to the platform into the virtual "
466
482
"environment."
467
483
msgstr ""
468
484
469
- #: ../../library/venv.rst:197
485
+ #: ../../library/venv.rst:210
470
486
msgid ""
471
487
"Upgrades the core venv dependency packages (currently ``pip`` and "
472
488
"``setuptools``) in the environment. This is done by shelling out to the "
473
489
"``pip`` executable in the environment."
474
490
msgstr ""
475
491
476
- #: ../../library/venv.rst:205
492
+ #: ../../library/venv.rst:218
477
493
msgid ""
478
494
"A placeholder method which can be overridden in third party implementations "
479
495
"to pre-install packages in the virtual environment or perform other post-"
480
496
"creation steps."
481
497
msgstr ""
482
498
483
- #: ../../library/venv.rst:209
499
+ #: ../../library/venv.rst:222
484
500
msgid ""
485
501
"Windows now uses redirector scripts for ``python[w].exe`` instead of copying "
486
502
"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless "
487
503
"running from a build in the source tree."
488
504
msgstr ""
489
505
490
- #: ../../library/venv.rst:214
506
+ #: ../../library/venv.rst:227
491
507
msgid ""
492
508
"Windows copies the redirector scripts as part of :meth:`setup_python` "
493
509
"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using "
494
510
"symlinks, the original executables will be linked."
495
511
msgstr ""
496
512
497
- #: ../../library/venv.rst:219
513
+ #: ../../library/venv.rst:232
498
514
msgid ""
499
515
"In addition, :class:`EnvBuilder` provides this utility method that can be "
500
516
"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to "
501
517
"assist in installing custom scripts into the virtual environment."
502
518
msgstr ""
503
519
504
- #: ../../library/venv.rst:225
520
+ #: ../../library/venv.rst:238
505
521
msgid ""
506
522
"*path* is the path to a directory that should contain subdirectories\" common"
507
523
"\" ,\" posix\" ,\" nt\" , each containing scripts destined for the bin "
@@ -510,64 +526,64 @@ msgid ""
510
526
"placeholders:"
511
527
msgstr ""
512
528
513
- #: ../../library/venv.rst:231
529
+ #: ../../library/venv.rst:244
514
530
msgid ""
515
531
"``__VENV_DIR__`` is replaced with the absolute path of the environment "
516
532
"directory."
517
533
msgstr ""
518
534
519
- #: ../../library/venv.rst:234
535
+ #: ../../library/venv.rst:247
520
536
msgid ""
521
537
"``__VENV_NAME__`` is replaced with the environment name (final path segment "
522
538
"of environment directory)."
523
539
msgstr ""
524
540
525
- #: ../../library/venv.rst:237
541
+ #: ../../library/venv.rst:250
526
542
msgid ""
527
543
"``__VENV_PROMPT__`` is replaced with the prompt (the environment name "
528
544
"surrounded by parentheses and with a following space)"
529
545
msgstr ""
530
546
531
- #: ../../library/venv.rst:240
547
+ #: ../../library/venv.rst:253
532
548
msgid ""
533
549
"``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either "
534
550
"``bin`` or ``Scripts``)."
535
551
msgstr ""
536
552
537
- #: ../../library/venv.rst:243
553
+ #: ../../library/venv.rst:256
538
554
msgid ""
539
555
"``__VENV_PYTHON__`` is replaced with the absolute path of the environment's "
540
556
"executable."
541
557
msgstr ""
542
558
543
- #: ../../library/venv.rst:246
559
+ #: ../../library/venv.rst:259
544
560
msgid ""
545
561
"The directories are allowed to exist (for when an existing environment is "
546
562
"being upgraded)."
547
563
msgstr ""
548
564
549
- #: ../../library/venv.rst:249
565
+ #: ../../library/venv.rst:262
550
566
msgid "There is also a module-level convenience function:"
551
567
msgstr ""
552
568
553
- #: ../../library/venv.rst:255
569
+ #: ../../library/venv.rst:268
554
570
msgid ""
555
571
"Create an :class:`EnvBuilder` with the given keyword arguments, and call "
556
572
"its :meth:`~EnvBuilder.create` method with the *env_dir* argument."
557
573
msgstr ""
558
574
559
- #: ../../library/venv.rst:270
575
+ #: ../../library/venv.rst:283
560
576
msgid "An example of extending ``EnvBuilder``"
561
577
msgstr ""
562
578
563
- #: ../../library/venv.rst:272
579
+ #: ../../library/venv.rst:285
564
580
msgid ""
565
581
"The following script shows how to extend :class:`EnvBuilder` by implementing "
566
582
"a subclass which installs setuptools and pip into a created virtual "
567
583
"environment::"
568
584
msgstr ""
569
585
570
- #: ../../library/venv.rst:491
586
+ #: ../../library/venv.rst:504
571
587
msgid ""
572
588
"This script is also available for download `online <https://gist.github.com/"
573
589
"vsajip/4673395>`_."