-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel font installtion deprecated. fontman/fontmanpkg-spec#2
- Loading branch information
1 parent
a3625aa
commit fbae05c
Showing
12 changed files
with
78 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" Fontman server tags consumer | ||
Consume and sync with fontman server roles REST API. | ||
Created by Lahiru Pathirage @ Mooniak<lpsandaruwan@gmail.com> on 5/1/2017 | ||
""" | ||
|
||
from session import api_base_url | ||
|
||
import json, requests | ||
|
||
|
||
class TagsConsumer: | ||
|
||
def consume_tags_by_font_id(self, font_id): | ||
response = requests.get(api_base_url + "/tags/" + str(font_id)) | ||
return json.loads(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" Font Type | ||
Characteristics of a font. eg: serif/sans serif | ||
Created by Lahiru Pathirage @ Mooniak <lpsandaruwan@gmail.com> on 8/2/2017 | ||
""" | ||
|
||
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String | ||
|
||
from session import Base | ||
|
||
|
||
class FontType(Base): | ||
|
||
__tablename__ = "fonttype" | ||
|
||
type_id = Column(Integer, primary_key=True) | ||
font_id = Column(Integer, ForeignKey("font.font_id")) | ||
tag = Column(String(20), nullable=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
flask==0.12 | ||
jinja2==2.8 | ||
python-fontconfig==0.5.1 | ||
requests==2.12.4 | ||
sqlalchemy==1.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" Font types service | ||
High level functions to manipulate font types table | ||
Created by Lahiru Pathirage @ Mooniak<lpsandaruwan@gmail.com> on 8/2/2017 | ||
""" | ||
|
||
from model import FontType | ||
from session import db_session | ||
|
||
|
||
class FontTypeService: | ||
|
||
def add_new(self, font_id, tag): | ||
new_tag = FontType( | ||
font_id=font_id, | ||
tag=tag | ||
) | ||
|
||
db_session.add(new_tag) | ||
db_session.commit() | ||
|
||
return new_tag | ||
|
||
def find_all(self): | ||
return db_session.query(FontType).all() | ||
|
||
def find_by_font_id(self, font_id): | ||
return db_session.query(FontType).filter_by(font_id=font_id) | ||
|
||
def find_by_tag(self, tag): | ||
return db_session.query(FontType).filter_by(tag=tag) | ||
|
||
def find_by_type_id(self, type_id): | ||
return db_session.query(FontType).filter_by(type_id=type_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters