Comments (1)
The bad files were corrected via:
1 import sqlite3, subprocess
2
3 dbpath = 'db/laamaj.db'
4 imgdir = 'db/img/'
5
6 con = sqlite3.connect(dbpath)
7 cur = con.cursor()
8
9 op = cur.execute("select ws_id, ws_url, ws_localfile from websites where ws_localfile like '%.' order by ws_id desc")
10 op = [x for x in op]
11 #op = cur.execute("select ws_id, ws_url, ws_localfile from websites where ws_id = '9455'")
12
13 for key, url, lfile in op:
14 print key, url, lfile
15 extension = url.split(u'.')[-1]
16 newfile = u'%s%s' % (lfile, extension)
17 cmd = u'mv %s%s %s%s' % (imgdir, lfile, imgdir, newfile)
18 retcode = subprocess.call(cmd, shell=True)
19 if retcode == 0:
20 script = "update websites set ws_localfile = '%s' where ws_id = '%s'" % (newfile, key)
21 print script
22 cur.execute(script)
23 con.commit()
24 else:
25 print 'failed to move'
from laamaj.
Related Issues (14)
- add config
- Multiprocessing
- IT IS IMPERATIVE THAT LAMAAJ IS ABLE TO PROVIDE THE DATE IN DISCORDIAN FORMAT HOT 4
- Doesn't run on TributeOS HOT 2
- PROVIDING THE DATE MUST BE DISCONTINUED IMMEDIATELY HOT 1
- When will Rift / Vive support be implemented?
- mongodb support
- merge boab features HOT 1
- Remove dictionary references
- web portal HOT 1
- update argument parsing to argparse
- unicode
- rest api
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laamaj.