Git Product home page Git Product logo

update-vott-assets's Introduction

update-vott-assets

A script to enable transferring VoTT assets between machines when using Local File System

For Windows compatibility, use https://github.com/lukasalexanderweber/update-vott-assets instead.

Inspiration

Feature: Ability to move project source location and maintain asset IDs

Usage

with pipenv

git clone https://github.com/cnrmck/update-vott-assets.git && cd update-vott-assets
pipenv install && pipenv shell
python update_vott_assets.py --help

with pip

git clone https://github.com/cnrmck/update-vott-assets.git && cd update-vott-assets
pip3 install click
python3 update_vott_assets.py --help

Caveats

Not tested with video files.

Has a click dependency. Could be replaced with argparse if anyone is a purist.

update-vott-assets's People

Contributors

cnrmck avatar

Stargazers

niccari avatar Hiroya Akita avatar Luca Scalerandi avatar mert avatar :) avatar  avatar  avatar Oleksandr Paraska avatar Ankit Sharma avatar

update-vott-assets's Issues

Notes for Windows-Users

Hello,

first of all thank you for publishing your great work! It saved a lot of time for me.
In sake of improving open source software, I would like to point out three things I noticed when using your script.


  1. Wrong Hashes

In line 65, you are using os.path.join() to generate the new file string. In my case, this leads to the following string, since I'm using Windows and Backslash is Standard:

file:C:/Users/weberlu/Desktop/neuer_pfad/gross\15-0000598.png

This does not lead to an error, however, the MD5 hash is completely wrong because of that.

Changing line 65 from
source_asset_path = 'file:'+os.path.join(directory_name, asset['name'])
to
source_asset_path = 'file:'+ directory_name + '/' + asset['name']
fixes this issue.


  1. Extra Line between each Line

After running your script, I get a blanc line between each JSON entry:

{

    "name": "Test",

    "securityToken": "Test Token",

I fixed this by adding
line = line.replace("\\n","")
below
line = line.replace(old_source_directory, node_ready_new_source_directory)


  1. Remove click functionality

The click functionality is not stable for Windows users. Just pass the new_source_directory and target_directory (with Slashes, not Backslashes!) as string parameter into the main() function!


Thats all from me and maybe helps another windows user.
Keep up the good work!
Lukas

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.