kivy's python-for-android can import stat
This commit is contained in:
@@ -32,11 +32,12 @@ import time
|
|||||||
import json
|
import json
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
|
import stat
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from unicodedata import normalize
|
from unicodedata import normalize
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from i18n import _
|
|
||||||
|
|
||||||
|
from i18n import _
|
||||||
from util import NotEnoughFunds, PrintError, profiler
|
from util import NotEnoughFunds, PrintError, profiler
|
||||||
|
|
||||||
from bitcoin import *
|
from bitcoin import *
|
||||||
@@ -140,18 +141,14 @@ class WalletStorage(PrintError):
|
|||||||
f.flush()
|
f.flush()
|
||||||
os.fsync(f.fileno())
|
os.fsync(f.fileno())
|
||||||
|
|
||||||
if 'ANDROID_DATA' not in os.environ:
|
mode = os.stat(self.path).st_mode if os.path.exists(self.path) else stat.S_IREAD | stat.S_IWRITE
|
||||||
import stat
|
|
||||||
mode = os.stat(self.path).st_mode if os.path.exists(self.path) else stat.S_IREAD | stat.S_IWRITE
|
|
||||||
# perform atomic write on POSIX systems
|
# perform atomic write on POSIX systems
|
||||||
try:
|
try:
|
||||||
os.rename(temp_path, self.path)
|
os.rename(temp_path, self.path)
|
||||||
except:
|
except:
|
||||||
os.remove(self.path)
|
os.remove(self.path)
|
||||||
os.rename(temp_path, self.path)
|
os.rename(temp_path, self.path)
|
||||||
if 'ANDROID_DATA' not in os.environ:
|
os.chmod(self.path, mode)
|
||||||
import stat
|
|
||||||
os.chmod(self.path, mode)
|
|
||||||
self.print_error("saved", self.path)
|
self.print_error("saved", self.path)
|
||||||
self.modified = False
|
self.modified = False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user