Changeset 83283c
- Timestamp:
- 05/27/2011 10:45:54 PM (14 years ago)
- Children:
- da6793
- Parents:
- 14c3655
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (05/26/2011 12:11:09 AM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (05/27/2011 10:45:54 PM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/common.py
r14c3655 r83283c 166 166 return os.path.expanduser("~") 167 167 else: 168 from xdg.BaseDirectory import xdg_config_home 169 userdir_file = os.path.join(xdg_config_home, 'user-dirs.dirs') 170 try: 171 for line in open(userdir_file, 'r'): 172 if not line.startswith('#') and 'XDG_DOWNLOAD_DIR' in line: 173 download_dir = os.path.expandvars(\ 174 line.partition("=")[2].rstrip().strip('"')) 175 if os.path.isdir(download_dir): 176 return download_dir 177 except IOError: 178 pass 179 168 180 return os.environ.get("HOME") 169 181 … … 528 540 return path 529 541 530 XML_ESCAPES = ( 542 XML_ESCAPES = ( 531 543 ('&', '&'), 532 544 ('<', '<'), … … 537 549 538 550 def xml_decode(string): 539 """ 551 """ 540 552 Unescape a string that was previously encoded for use within xml. 541 553 542 554 :param string: The string to escape 543 555 :type string: string … … 550 562 551 563 def xml_encode(string): 552 """ 564 """ 553 565 Escape a string for use within an xml element or attribute. 554 566 555 567 :param string: The string to escape 556 568 :type string: string
Note:
See TracChangeset
for help on using the changeset viewer.