Skip to content

Instantly share code, notes, and snippets.

View zzacharo's full-sized avatar

Zacharias Zacharodimos zzacharo

View GitHub Profile
import re
from invenio_db import db
from invenio_files_rest.models import as_object_version
from cds.modules.records.api import CDSRecord, CDSVideosFilesIterator
from cds.modules.deposit.api import CDSDeposit
from invenio_records.models import RecordMetadata
def _rename_subtitles(record):
"""Rename subtitles."""
# Pattern to extract subtitle's filename and iso language
@zzacharo
zzacharo / access_update.py
Last active May 11, 2018 12:40
Update cds-videos records _access.update with e-groups
from functools import reduce
from invenio_db import db
from invenio_pidstore.models import PersistentIdentifier
from invenio_search import current_search
from invenio_search.utils import schema_to_index
from cds.modules.records.api import CDSRecord
from cds.modules.deposit.api import Project, Video
from cds.modules.fixtures.cli import _load_json_source
from cds.modules.deposit.resolver import get_video_pid
@zzacharo
zzacharo / update-workflow.py
Last active October 30, 2017 15:15
update workflows to have `is-update` extra_data flag by default to False
import time
from invenio_db import db
from invenio_workflows import workflow_object_class
from invenio_workflows.models import ObjectStatus
from flask import current_app
from flask_sqlalchemy import SQLAlchemy
def update_workflow():
query_ses = SQLAlchemy(current_app).session