pythonBits icon indicating copy to clipboard operation
pythonBits copied to clipboard

Architecture and syntax overhaul for further modularisation

Open mueslo opened this issue 7 years ago • 0 comments

So pythonBits can be expanded to other trackers, too.

Targeted python syntax:

s = bb.TVSubmission(params)
s.fields (list all available fields)
-> container, video_codec, path, 

s.fields['container'] / s['container']
-> 'MKV'

s.form_fields
-> title, description, ...

s.form_fields['title']
-> this is the generated title

s.submit() -> s.site.post(s['payload'])
-> URL of posting or exception

Targeted command line syntax:

pythonbits bb <file>  # list default fields for media type
pythonbits bb list (<file> or -c <category>)  # list available fields and corresponding form_fields
pythonbits bb get screenshots title <file>
pythonbits bb submit <file> -f <somefield> <somevalue>
pythonbits bb submit <file> --non-interactive  # for use in scripts

Structure

  • __init__.py
  • __main__.py
  • submission.py
  • categories.py
  • sites/
    • __init__.py
    • common.py
    • bb/
      • __init__.py
    • btn/
      • __init__.py

module bb: class MovieSubmission(VideoSubmission, categories.MovieSubmissionMixin) class VideoSubmission(BbSubmission)

mueslo avatar Jun 01 '18 18:06 mueslo