This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: denim2x <denim2x@cyberdude.com>
- Loading branch information
Showing
17 changed files
with
808 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from rom import * | ||
import rom as _rom | ||
from rom.columns import String as _String | ||
from rom.util import set_connection_settings as init, get_connection | ||
|
||
|
||
class String(_String): | ||
def _to_redis(self, value): | ||
if isinstance(value, bytes): | ||
return super()._to_redis(value) | ||
return value | ||
|
||
class _Model: | ||
def __getitem__(self, key): | ||
value = getattr(self, key) | ||
return value.decode() if isinstance(value, bytes) else bytes | ||
|
||
Model = (_Model, _rom.Model) | ||
|
||
def bgsave(): | ||
db = get_connection() | ||
try: | ||
db.bgsave() | ||
return True | ||
except: | ||
return 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
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
Oops, something went wrong.