~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Aaron Bentley
  • Date: 2008-07-14 16:16:48 UTC
  • mfrom: (3537 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3538.
  • Revision ID: aaron@aaronbentley.com-20080714161648-hh0bz2f22cjdftwe
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
641
641
    offset = datetime.fromtimestamp(t) - datetime.utcfromtimestamp(t)
642
642
    return offset.days * 86400 + offset.seconds
643
643
 
 
644
weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
644
645
    
645
646
def format_date(t, offset=0, timezone='original', date_fmt=None,
646
647
                show_offset=True):
672
673
        offset_str = ' %+03d%02d' % (offset / 3600, (offset / 60) % 60)
673
674
    else:
674
675
        offset_str = ''
 
676
    # day of week depends on locale, so we do this ourself
 
677
    date_fmt = date_fmt.replace('%a', weekdays[tt[6]])
675
678
    return (time.strftime(date_fmt, tt) +  offset_str)
676
679
 
677
680
 
848
851
        return False
849
852
 
850
853
 
 
854
def host_os_dereferences_symlinks():
 
855
    return (has_symlinks()
 
856
            and sys.platform not in ('cygwin', 'win32'))
 
857
 
 
858
 
851
859
def contains_whitespace(s):
852
860
    """True if there are any whitespace characters in s."""
853
861
    # string.whitespace can include '\xa0' in certain locales, because it is