mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-19 13:23:41 -05:00
remove debug prints and unused code
This commit is contained in:
parent
b98cf142d7
commit
74fd0ba646
1 changed files with 0 additions and 26 deletions
26
app.py
26
app.py
|
@ -256,9 +256,7 @@ def emojis():
|
|||
packs = func.listEmojiPacks()
|
||||
if packs:
|
||||
for pack in packs:
|
||||
# print(pack,'\n')
|
||||
json_pack = bool(pack.get('website') and pack.get('exportedAt'))
|
||||
print(json_pack)
|
||||
if json_pack:
|
||||
break
|
||||
else:
|
||||
|
@ -540,28 +538,7 @@ def uploadEmojiPack():
|
|||
meta_json_path = extract_path / 'meta.json'
|
||||
if meta_json_path.exists():
|
||||
processed_emojis = func.processEmojis(meta_json_path)
|
||||
# emoji_metadata = func.loadJSON(meta_json_path)
|
||||
# emojis = emoji_metadata.get('emojis', [])
|
||||
|
||||
# processed_emojis = []
|
||||
# for emoji in emojis:
|
||||
# emoji_info = {
|
||||
# 'name': emoji['emoji']['name'],
|
||||
# 'file_name': emoji['fileName']
|
||||
# }
|
||||
# processed_emojis.append(emoji_info)
|
||||
# app.logger.debug(f"[CatAsk/API/upload_emoji_pack] Processed emoji: {emoji_info['name']} (File: {emoji_info['file_name']})")
|
||||
|
||||
# pack_json = {
|
||||
# 'name': emoji_metadata['emojis'][0]['emoji']['category'].capitalize(),
|
||||
# 'exportedAt': emoji_metadata["exportedAt"],
|
||||
# 'emojis': processed_emojis
|
||||
# }
|
||||
# pack_json_name = const.emojiPath / (emoji_metadata['emojis'][0]['emoji']['category'] + '.json')
|
||||
# func.saveJSON(pack_json, pack_json_name)
|
||||
|
||||
return jsonify({'message': f'Successfully uploaded and processed {len(processed_emojis)} emojis from archive "{filename}".'}), 201
|
||||
|
||||
else:
|
||||
return jsonify({'message': f'Archive {filename} successfully uploaded and extracted.'}), 201
|
||||
|
||||
|
@ -605,9 +582,7 @@ def deleteEmoji():
|
|||
emoji_name = request.args.get('emoji_name')
|
||||
emoji_base_path = const.emojiPath
|
||||
emoji_file_path = emoji_base_path / emoji_name
|
||||
print(emoji_file_path)
|
||||
emoji_ext = os.path.splitext(f"{emoji_base_path}/{emoji_file_path}")
|
||||
print("emoji ext:", emoji_ext)
|
||||
|
||||
if not emoji_file_path.exists() or not emoji_file_path.is_file():
|
||||
return jsonify({'error': 'Emoji not found'}), 404
|
||||
|
@ -729,7 +704,6 @@ def viewAnswer():
|
|||
cursor.close()
|
||||
conn.close()
|
||||
return jsonify(answer)
|
||||
"""
|
||||
|
||||
@api_bp.route('/update_config/', methods=['POST'])
|
||||
@loginRequired
|
||||
|
|
Loading…
Add table
Reference in a new issue