Version 65 file rename improvement
This commit is contained in:
parent
81de5a75dd
commit
b292c15b44
|
@ -8,7 +8,7 @@
|
|||
<div class="content">
|
||||
<h3>changelog</h3>
|
||||
<ul>
|
||||
<li><h3>version 64</h3></li>
|
||||
<li><h3>version 65</h3></li>
|
||||
<ul>
|
||||
<li>added subscriptions dialog</li>
|
||||
<li>added prototype subscription daemon, but not yet activated it</li>
|
||||
|
|
|
@ -5089,15 +5089,22 @@ class DB( ServiceDB ):
|
|||
|
||||
for filename in filenames:
|
||||
|
||||
old_path = HC.CLIENT_FILES_DIR + os.path.sep + filename
|
||||
|
||||
mime = HC.GetMimeFromPath( old_path )
|
||||
|
||||
new_path = old_path + HC.mime_ext_lookup[ mime ]
|
||||
|
||||
shutil.move( old_path, new_path )
|
||||
|
||||
os.chmod( new_path, stat.S_IREAD )
|
||||
if '.' not in filename:
|
||||
|
||||
try:
|
||||
|
||||
old_path = HC.CLIENT_FILES_DIR + os.path.sep + filename
|
||||
|
||||
mime = HC.GetMimeFromPath( old_path )
|
||||
|
||||
new_path = old_path + HC.mime_ext_lookup[ mime ]
|
||||
|
||||
shutil.move( old_path, new_path )
|
||||
|
||||
os.chmod( new_path, stat.S_IREAD )
|
||||
|
||||
except: pass
|
||||
|
||||
|
||||
i += 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue