Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the labels with their ids from a template #92

Merged
merged 8 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish npmjs Package

on:
release:
types: [published]

jobs:
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 2.7
- run: make release-npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_API_TOKEN}}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

0.1.23 Sep 23, 2021
rtibbles marked this conversation as resolved.
Show resolved Hide resolved
-------------------
- Added new labelslookup.json constants
- Added labelstemplatelookup.json and idforlabels.py
- Added build-label target for Makefile release


0.1.22 Oct 3, 2019
-------------------
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean clean-test clean-pyc clean-build test release
.PHONY: clean clean-test clean-pyc clean-build test release build-labels

clean: clean-build clean-pyc clean-test

Expand All @@ -23,6 +23,13 @@ clean-test: ## remove test and coverage artifacts
test:
pytest -s

release: clean
build-labels:
python scripts/generate_labels.py

release: clean build-labels
python setup.py sdist
twine upload dist/*.tar.gz

release-npm: clean build-labels
cd js
npm publish
18 changes: 18 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

import Needs from "./labels/Needs";
import AccessibilityCategories from "./labels/AccessibilityCategories";
import ResourceType from "./labels/ResourceType";
import Levels from "./labels/Levels";
import Subjects from "./labels/Subjects";
import LearningActivities from "./labels/LearningActivities";

export default {
Needs: Needs,
AccessibilityCategories: AccessibilityCategories,
ResourceType: ResourceType,
Levels: Levels,
Subjects: Subjects,
LearningActivities: LearningActivities,
};
11 changes: 11 additions & 0 deletions js/labels/AccessibilityCategories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
AUDIO_DESCRIPTION: "cwDcsY",
ALT_TEXT: "cuhrmh",
CAPTIONS_SUBTITLES: "da2iCe",
HIGH_CONTRAST: "br&HYl",
TAGGED_PDF: "crDF4W",
SIGN_LANGUAGE: "b1hGk&",
};
12 changes: 12 additions & 0 deletions js/labels/LearningActivities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
READ: "bzRtvr",
CREATE: "c7fP3a",
PRACTICE: "c9ATW4",
WATCH: "c53M6c",
REFLECT: "dCoWsm",
EXPLORE: "d4NYxq",
LISTEN: "WPRwV",
};
14 changes: 14 additions & 0 deletions js/labels/Levels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
UPPER_SECONDARY: "dn4KHz",
WORK_SKILLS: "dp73Sn",
LOWER_PRIMARY: "by0beT",
LOWER_SECONDARY: "svpsy",
UPPER_PRIMARY: "bSQdiJ",
PRESCHOOL: "b#GEd",
BASIC_SKILLS: "chRJoI",
PROFESSIONAL: "dnezU7",
TERTIARY: "b&jDyf",
};
15 changes: 15 additions & 0 deletions js/labels/Needs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
PRIOR_KNOWLEDGE: "biiiAR",
MATERIALS: "cfjB0R",
FOR_BEGINNERS: "biiiAR.bjQPib",
PAPER_PENCIL: "cfjB0R.cH#ig5",
OTHER_SUPPLIES: "cfjB0R.d4Uvx6",
INTERNET: "cfjB0R.cdGFA5",
SPECIAL_SOFTWARE: "cfjB0R.mhgPB",
PEOPLE: "Ti5WR",
PEERS: "Ti5WR.cAsjNo",
TEACHER: "Ti5WR.ch#A9l",
};
15 changes: 15 additions & 0 deletions js/labels/ResourceType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
MEDIA: "bgStlE",
TEXTBOOK: "cwRiL",
LESSON_PLAN: "cHbILa",
GAME: "d0o6Fw",
BOOK: "dr5pZC",
TUTORIAL: "dboes",
ACTIVITY: "cpJLQx",
LESSON: "bCz8L8",
GUIDE: "dBtI2b",
EXERCISE: "db5560",
};
62 changes: 62 additions & 0 deletions js/labels/Subjects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

export default {
LOGIC_AND_CRITICAL_THINKING: "3hB92.dkzVgX",
CALCULUS: "p&dep.bblteS.dXgpNS",
NUMERACY: "3hB92.c1jGqN",
READING_COMPREHENSION: "p&dep.Qgsp#.bhUTDV",
TECHNICAL_AND_VOCATIONAL_TRAINING: "VT1kL.ckX7et",
LEARNING_SKILLS: "3hB92.wNyNV",
PROGRAMMING: "p&dep.t6U3d.bWu0U1",
WRITING: "p&dep.Qgsp#.cr#oHX",
ANTHROPOLOGY: "p&dep.ctZs6B.c8HSSg",
LESSON_PLANS: "bKIpQL.UHULh",
SOCIAL_SCIENCES: "p&dep.ctZs6B",
LITERATURE: "p&dep.Qgsp#.b2ovSe",
MATHEMATICS: "p&dep.bblteS",
DAILY_LIFE: "cKga4t",
CHEMISTRY: "p&dep.Jwimc.d5hK4i",
PHYSICS: "p&dep.Jwimc.bh5yfp",
FOR_TEACHERS: "bKIpQL",
ARTS: "p&dep.dMPOKy",
MENTAL_HEALTH: "cKga4t.pZ8zW",
DANCE: "p&dep.dMPOKy.bU6Aon",
WORK: "VT1kL",
SCIENCES: "p&dep.Jwimc",
CIVIC_EDUCATION: "p&dep.ctZs6B.b&ZRDw",
TOOLS_AND_SOFTWARE_TRAINING: "VT1kL.ckX7et.dwmwig",
ASTRONOMY: "p&dep.Jwimc.WMX&I",
EARTH_SCIENCE: "p&dep.Jwimc.bKf1LD",
COMPUTER_SCIENCE: "p&dep.t6U3d",
SOCIOLOGY: "p&dep.ctZs6B.dVNbTt",
CURRENT_EVENTS: "cKga4t.cpTY7w",
BIOLOGY: "p&dep.Jwimc.br5gFI",
POLITICAL_SCIENCE: "p&dep.ctZs6B.ctVB8#",
DRAMA: "p&dep.dMPOKy.dflbK2",
MUSIC: "p&dep.dMPOKy.btqcqM",
MECHANICAL_ENGINEERING: "p&dep.t6U3d.dZm4cL",
DIGITAL_LITERACY: "3hB92.bBpD5O",
WEB_DESIGN: "p&dep.t6U3d.cNTlX9",
LITERACY: "3hB92.cgu720",
ENTREPRENEURSHIP: "cKga4t.PHE2D",
GUIDES: "bKIpQL.cUuuC&",
HISTORY: "p&dep.bNbmkp",
VISUAL_ART: "p&dep.dMPOKy.dIviQH",
ENVIRONMENT: "cKga4t.boZVcq",
SCHOOL: "p&dep",
STATISTICS: "p&dep.bblteS.MCZxM",
SKILLS_TRAINING: "VT1kL.ckX7et.d&xa&j",
ALGEBRA: "p&dep.bblteS.drpKXi",
GEOMETRY: "p&dep.bblteS.ShT6u",
DIVERSITY: "cKga4t.b6eieL",
FINANCIAL_LITERACY: "cKga4t.cgcil1",
PUBLIC_HEALTH: "cKga4t.OHvRm",
INDUSTRY_AND_SECTOR_SPECIFIC: "VT1kL.ckX7et.#TwHM",
MEDIA_LITERACY: "cKga4t.c6I2x6",
READING_AND_WRITING: "p&dep.Qgsp#",
LANGUAGE_LEARNING: "p&dep.cn24wo",
BASIC_SKILLS: "3hB92",
PROFESSIONAL_SKILLS: "VT1kL.d6FA9G",
ARITHMETIC: "p&dep.bblteS.2d3O2",
};
18 changes: 18 additions & 0 deletions js/labels/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// -*- coding: utf-8 -*-
// Generated by scripts/generate_labels.py

import Needs from "./Needs";
import AccessibilityCategories from "./AccessibilityCategories";
import ResourceType from "./ResourceType";
import Levels from "./Levels";
import Subjects from "./Subjects";
import LearningActivities from "./LearningActivities";

export default {
Needs: Needs,
AccessibilityCategories: AccessibilityCategories,
ResourceType: ResourceType,
Levels: Levels,
Subjects: Subjects,
LearningActivities: LearningActivities,
};
31 changes: 31 additions & 0 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"author": "Learning Equality",
"bugs": {
"url": "https://github.com/learningequality/le-utils/issues"
},
"description": "A package that exposes constants commonly used across the Kolibri Ecosystem",
"directories": {
"src": "js"
},
"files": [
"*.js",
"**/*.js"
],
"homepage": "https://github.com/learningequality/le-utils#readme",
"keywords": [
"kolibri",
"constants",
"content"
],
"license": "MIT",
"main": "index.js",
"name": "kolibri-constants",
"repository": {
"type": "git",
"url": "git+https://github.com/learningequality/le-utils.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.32-beta2"
}
5 changes: 5 additions & 0 deletions le_utils/constants/labels/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
The constants defined in the submodules of this module are intended
only to provide additional user metadata about content, and have no impact
on their functional roles in any Kolibri tools or platforms.
"""
30 changes: 30 additions & 0 deletions le_utils/constants/labels/accessibility_categories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# AccessibilityCategories

AUDIO_DESCRIPTION = "cwDcsY"
ALT_TEXT = "cuhrmh"
CAPTIONS_SUBTITLES = "da2iCe"
HIGH_CONTRAST = "br&HYl"
TAGGED_PDF = "crDF4W"
SIGN_LANGUAGE = "b1hGk&"

choices = (
(AUDIO_DESCRIPTION, "Audio Description"),
(ALT_TEXT, "Alt Text"),
(CAPTIONS_SUBTITLES, "Captions Subtitles"),
(HIGH_CONTRAST, "High Contrast"),
(TAGGED_PDF, "Tagged Pdf"),
(SIGN_LANGUAGE, "Sign Language"),
)

ACCESSIBILITYCATEGORIESLIST = [
AUDIO_DESCRIPTION,
ALT_TEXT,
CAPTIONS_SUBTITLES,
HIGH_CONTRAST,
TAGGED_PDF,
SIGN_LANGUAGE,
]
33 changes: 33 additions & 0 deletions le_utils/constants/labels/learning_activities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# LearningActivities

READ = "bzRtvr"
CREATE = "c7fP3a"
PRACTICE = "c9ATW4"
WATCH = "c53M6c"
REFLECT = "dCoWsm"
EXPLORE = "d4NYxq"
LISTEN = "WPRwV"

choices = (
(READ, "Read"),
(CREATE, "Create"),
(PRACTICE, "Practice"),
(WATCH, "Watch"),
(REFLECT, "Reflect"),
(EXPLORE, "Explore"),
(LISTEN, "Listen"),
)

LEARNINGACTIVITIESLIST = [
READ,
CREATE,
PRACTICE,
WATCH,
REFLECT,
EXPLORE,
LISTEN,
]
39 changes: 39 additions & 0 deletions le_utils/constants/labels/levels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Generated by scripts/generate_labels.py
from __future__ import unicode_literals

# Levels

UPPER_SECONDARY = "dn4KHz"
WORK_SKILLS = "dp73Sn"
LOWER_PRIMARY = "by0beT"
LOWER_SECONDARY = "svpsy"
UPPER_PRIMARY = "bSQdiJ"
PRESCHOOL = "b#GEd"
BASIC_SKILLS = "chRJoI"
PROFESSIONAL = "dnezU7"
TERTIARY = "b&jDyf"

choices = (
(UPPER_SECONDARY, "Upper Secondary"),
(WORK_SKILLS, "Work Skills"),
(LOWER_PRIMARY, "Lower Primary"),
(LOWER_SECONDARY, "Lower Secondary"),
(UPPER_PRIMARY, "Upper Primary"),
(PRESCHOOL, "Preschool"),
(BASIC_SKILLS, "Basic Skills"),
(PROFESSIONAL, "Professional"),
(TERTIARY, "Tertiary"),
)

LEVELSLIST = [
UPPER_SECONDARY,
WORK_SKILLS,
LOWER_PRIMARY,
LOWER_SECONDARY,
UPPER_PRIMARY,
PRESCHOOL,
BASIC_SKILLS,
PROFESSIONAL,
TERTIARY,
]
Loading