Files
@ a1b80a0a3e15
Branch filter:
Location: kallithea/rhodecode/lib/vcs/utils/paths.py - annotation
a1b80a0a3e15
834 B
text/x-python
rhodecode.js: update array.indexOf for backward compatibility
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill
under MIT license / public domain
https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill
under MIT license / public domain
https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses
324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 26fac32c215d 324ac367a4da 324ac367a4da 324ac367a4da 324ac367a4da 26fac32c215d | import os
abspath = lambda * p: os.path.abspath(os.path.join(*p))
def get_dirs_for_path(*paths):
"""
Returns list of directories, including intermediate.
"""
for path in paths:
head = path
while head:
head, tail = os.path.split(head)
if head:
yield head
else:
# We don't need to yield empty path
break
def get_dir_size(path):
root_path = path
size = 0
for path, dirs, files in os.walk(root_path):
for f in files:
try:
size += os.path.getsize(os.path.join(path, f))
except OSError:
pass
return size
def get_user_home():
"""
Returns home path of the user.
"""
return os.getenv('HOME', os.getenv('USERPROFILE')) or ''
|