-
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.
Added very simple code to create a wp db.
- Loading branch information
Showing
2 changed files
with
20 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
import sqlobject | ||
|
||
class Wallpaper( sqlobject.SQLObject ): | ||
fname = sqlobject.UnicodeCol() | ||
height = sqlobject.IntCol() | ||
width = sqlobject.IntCol() | ||
import sqlite3 | ||
|
||
def create_db( config ): | ||
conn = sqlite3.connect( config.get( 'wp', 'db_uri' ) ) | ||
|
||
c = conn.cursor() | ||
c.execute( '''create table wallpapers ( fname text, tags text, height integer, width integer )''' ) | ||
conn.commit() | ||
|
||
c.close() | ||
|
||
def insert_wp( config, wp_fname, tags, height, width ): | ||
pass | ||
|
||
def get_random_wp( config ): | ||
pass |
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