mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
Update vendored windows libs
This commit is contained in:
parent
f61c211655
commit
b1cefa94e5
226 changed files with 33472 additions and 11882 deletions
10
libs/win/incubator/replace-file.py
Normal file
10
libs/win/incubator/replace-file.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from jaraco.windows.api.filesystem import ReplaceFile
|
||||
|
||||
open('orig-file', 'w').write('some content')
|
||||
open('replacing-file', 'w').write('new content')
|
||||
ReplaceFile('orig-file', 'replacing-file', 'orig-backup', 0, 0, 0)
|
||||
assert open('orig-file').read() == 'new content'
|
||||
assert open('orig-backup').read() == 'some content'
|
||||
import os
|
||||
|
||||
assert not os.path.exists('replacing-file')
|
22
libs/win/incubator/trace-symlink.py
Normal file
22
libs/win/incubator/trace-symlink.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from jaraco.windows.filesystem import trace_symlink_target
|
||||
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
def get_args():
|
||||
parser = OptionParser()
|
||||
options, args = parser.parse_args()
|
||||
try:
|
||||
options.filename = args.pop(0)
|
||||
except IndexError:
|
||||
parser.error('filename required')
|
||||
return options
|
||||
|
||||
|
||||
def main():
|
||||
options = get_args()
|
||||
print(trace_symlink_target(options.filename))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue