rndusr / torf

Python module to create, parse and edit torrent files and magnet links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question remove file

romanoh opened this issue · comments

Sorry for the question as i am new to python, i work with the code:

t = Torrent(path=folder_path,
trackers=['https://example:2910/announce'],                                     
t.private = True
t.generate()

and it works, but if i want to remove the file who as an extension .nfo per example i write the t.exclude_globs('*.nfo'), and it gives me an error, what i am doing wrong please.

t.exclude_globs('*.nfo') gives an error:
maybe its not torf fault:
imagem

i get the folder path from pysimplegui, like this:
file_path = values[1]

the debug:
imagem

Sorry for my bad English, question edited.

Ok, i made a new py file, eliminate everything, and use this code:

folder_path = "D:/TORRENT FILE/Before the End"
file_path = ''
if file_path == '':
    print('INFO-Tor: Creating Torrent...please wait')
    # Make torrent from folder
    t = Torrent(path=folder_path,
                trackers=['https://example.me:2910/announce'],
                comment='some comment ')
                        
    t.exclude_globs('*.nfo')

    t.private = True
    t.generate()
    t.write(folder_path + '.torrent')

The error is:

Traceback (most recent call last):
  File "D:\folder\test---2.py", line 98, in <module>
    t.exclude_globs('*.nfo')
TypeError: 'MonitoredList' object is not callable

and the traceback from debug:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1477, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:/folder/test---2.py", line 13, in <module>
    t.exclude_globs('*.nfo')
TypeError: 'MonitoredList' object is not callable

thank you for the torf and help.

Thank you.