feat(phase1): add image storage utilities
- Create backend/services/image_storage.py with 4 core functions:
- sanitize_filename(): remove unsafe chars, limit to 255 chars, convert to lowercase
- get_unique_filename(): handle collisions with UUID suffix (format: {name}_{uuid8}_{variant}.jpg)
- ensure_image_directories(): create /images/ root and category subdirs on startup
- save_image(): save bytes to /images/{category}/{filename}, returns relative path
- Create comprehensive test suite (22 tests) covering all functionality
- Integrate ensure_image_directories() into FastAPI startup event
- Directory structure: /images/{category}/{filename}
- Collision handling: auto-suffix with UUID if filename exists
- All tests passing, pathlib.Path for safe operations
This commit is contained in:
54
venv/lib/python3.12/site-packages/pygments/styles/rrt.py
Normal file
54
venv/lib/python3.12/site-packages/pygments/styles/rrt.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""
|
||||
pygments.styles.rrt
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
pygments "rrt" theme, based on Zap and Emacs defaults.
|
||||
|
||||
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from pygments.style import Style
|
||||
from pygments.token import (
|
||||
Comment,
|
||||
Generic,
|
||||
Keyword,
|
||||
Name,
|
||||
Number,
|
||||
Operator,
|
||||
String,
|
||||
Token,
|
||||
)
|
||||
|
||||
__all__ = ['RrtStyle']
|
||||
|
||||
|
||||
class RrtStyle(Style):
|
||||
"""
|
||||
Minimalistic "rrt" theme, based on Zap and Emacs defaults.
|
||||
"""
|
||||
|
||||
name = 'rrt'
|
||||
|
||||
background_color = '#000000'
|
||||
highlight_color = '#0000ff'
|
||||
|
||||
styles = {
|
||||
Token: '#dddddd',
|
||||
Comment: '#00ff00',
|
||||
Generic.Emph: '#ffffff',
|
||||
Generic.Heading: '#ffff00',
|
||||
Generic.Subheading: '#ffff00',
|
||||
Generic.Strong: '#ffffff',
|
||||
Name.Entity: '#eedd82',
|
||||
Name.Function: '#ffff00',
|
||||
Name.Variable: '#eedd82',
|
||||
Name.Tag: '#7fffd4',
|
||||
Name.Constant: '#7fffd4',
|
||||
Keyword: '#ff0000',
|
||||
Operator.Word: '#ff0000',
|
||||
Comment.Preproc: '#e5e5e5',
|
||||
String: '#87ceeb',
|
||||
Keyword.Type: '#ee82ee',
|
||||
Number: '#ff00ff',
|
||||
}
|
||||
Reference in New Issue
Block a user