Giter Club home page Giter Club logo

kiara's People

Contributors

aowi avatar hartfelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kiara's Issues

Don't open a million files at once

It seems that kiara tries to open all the files passed as arguments all at once, causing the error below. I'm guessing a missing close() somewhere.

$ kiara -o L*/* K*/*

Unable to contact the backend. Will try to start one...
Traceback (most recent call last):
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 60, in _send
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 47, in inner
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socket.py", line 94, in __init__
socket.error: [Errno 24] Too many open files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aowi/bin/kiara", line 38, in <module>
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 79, in ping
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 74, in _send
ImportError: cannot import name backend
Traceback (most recent call last):
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 60, in _send
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 47, in inner
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socket.py", line 94, in __init__
socket.error: [Errno 24] Too many open files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aowi/bin/kiara", line 38, in <module>
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 79, in ping
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 69, in _send
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 47, in inner
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socket.py", line 94, in __init__
socket.error: [Errno 24] Too many open files

Guide

Hi,

This script seem like it might fit my usecase.
I have a folder with all my anime and want to add it to anidb, but I get error that xxxfolder is not a file. Is it possible to run it on a folder+subfolder?

Can you perhaps add a some examples?
Here are some lines I ran during installation that might help others.

sudo apt-get install python3-distutils
git clone https://github.com/hartfelt/kiara --depth 1 --branch=master ~/kiara
mv ~/kiararc/kiararc ~/.kiararc

Overwrite existing files (conditionally)

[15:19:26] aowi : hartfelt: !!! /Users/aowi/ogiue/shit/anime_series/Usagi Drop/[Commie] Usagi Drop - 01 [654eb35f].mkv already existst, not overwriting
[15:20:25] hartfelt : aowi: vi har den eksakt samme fil
[15:20:31] aowi : I know
[15:20:32] hartfelt : du kan slette den ene
[15:20:34] aowi : I know
[15:20:36] hartfelt : din, fx
[15:20:42] aowi : men det kunne kiara også bare gøre for mig :p
[15:21:04] aowi : eksempelvis med en indiskriminativ mv
[15:21:14] hartfelt : mmmmmmmmnej, den kan spørge først
[15:21:23] aowi : så hellere end switch

Make makedirs less retarded (or handle the retardation)

kiara should handle the error below, which arises when you call makedirs with an existing directory, but with a different set of permissions from the default umask (in this case the existing directory has a sticky bit but python doesn't want it to have that...).

Either don't call makedirs at all if the directory exists, or catch the exception and handle it gracefully.

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Users/aowi/src/kiara/libkiara/backend.py", line 85, in __init__
    return super().__init__(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 637, in __init__
    self.handle()
  File "/Users/aowi/src/kiara/libkiara/backend.py", line 157, in handle
    os.makedirs(os.path.normpath(dir), exist_ok=True)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/os.py", line 152, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/Users/aowi/ogiue/shit/anime_series/Usagi Drop'

Death by unicode

I think what happened here, was kiara finishing processing of one directory and moving on to the next. One of them (not sure which) might have had \u200b (zero-width space) in it.

Traceback (most recent call last):
  File "/Users/aowi/bin/kiara", line 42, in <module>
    libkiara.process(os.path.abspath(file.name), args.watch, args.organize)
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 92, in process
    print(line)
UnicodeEncodeError: 'ascii' codec can't encode character '\u200b' in position 12: ordinal not in range(128)
aowi@spike ~/ogiue/shit/anime $ Filename in database have changed
----------------------------------------
Exception happened during processing of request from
Traceback (most recent call last):
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 60, in _send
    for i in inner():
  File "/Users/aowi/src/kiara/libkiara/__init__.py", line 48, in inner
    client.connect(os.path.expanduser(_config['session']))
socket.error: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Users/aowi/src/kiara/libkiara/backend.py", line 94, in __init__
    return super().__init__(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/socketserver.py", line 648, in __init__
    self.handle()
  File "/Users/aowi/src/kiara/libkiara/backend.py", line 207, in handle
    self.request.sendall(bytes('---end---', 'UTF-8'))
socket.error: [Errno 32] Broken pipe
----------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.