简体   繁体   English

如何阻止linguini更改文件名?

[英]How do you stop linguini from changing file names?

When you use the linguini.File resource, it will automatically prepend the file names with the lot name and 'pilot' (when run in pilot mode). 当您使用linguini.File资源时,它将在文件名前自动添加批号和'pilot'(在试验模式下运行)。 Is there a way to overide (ie stop) this behavior? 有没有办法覆盖(即停止)此行为?

To stop the file resource from prepending the filename with the lot name, invoke it using the keyword share=True : 要阻止文件资源在文件名前添加批次名称,请使用关键字share=True调用它:

from linguini import File

File('/path/to/my', 'file.txt', share=True)

To stop the file resource from prepending the filename with 'pilot' (when run in pilot mode), invoke it with ignore_pilot=True . 要阻止文件资源在文件名前添加“ pilot”(当以试验模式运行时),请使用ignore_pilot=True调用它。

File('/path/to/my', 'file.txt', ignore_pilot=True)

To stop it from making any changes at all to the file name, use the keyword static=True : 要停止对文件名进行任何更改,请使用关键字static=True

File('/path/to/my', 'file.txt', static=True)

Note that these settings don't change the value of self.lot or self.pilot within the resource---it only affects their inclusion in the file name. 请注意,这些设置不会更改资源中self.lotself.pilot的值-只会影响它们包含在文件名中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM