def _update_metadata(self): self._update_ezdxf_metadata() if ezdxf.options.write_fixed_meta_data_for_testing: fixed_date = juliandate(datetime(2000, 1, 1, 0, 0)) self.header["$TDCREATE"] = fixed_date self.header["$TDUCREATE"] = fixed_date self.header["$TDUPDATE"] = fixed_date self.header["$TDUUPDATE"] = fixed_date self.header["$VERSIONGUID"] = CONST_GUID self.header["$FINGERPRINTGUID"] = CONST_GUID else: now = datetime.now() self.header["$TDUPDATE"] = juliandate(now) self.reset_version_guid() self.header["$HANDSEED"] = str(self.entitydb.handles) # next handle self.header["$DWGCODEPAGE"] = tocodepage(self.encoding)
def _update_metadata(self): if options.write_fixed_meta_data_for_testing: fixed_date = juliandate(datetime(2000, 1, 1, 0, 0)) self.header['$TDCREATE'] = fixed_date self.header['$TDUCREATE'] = fixed_date self.header['$TDUPDATE'] = fixed_date self.header['$TDUUPDATE'] = fixed_date self.header['$VERSIONGUID'] = '00000000-0000-0000-0000-000000000000' self.header['$FINGERPRINTGUID'] = '00000000-0000-0000-0000-000000000000' else: now = datetime.now() self.header['$TDUPDATE'] = juliandate(now) self.reset_version_guid() self.header['$HANDSEED'] = str(self.entitydb.handles) # next handle self.header['$DWGCODEPAGE'] = tocodepage(self.encoding)
def _setup_metadata(self): self.header['$ACADVER'] = self.dxfversion self.header['$TDCREATE'] = juliandate(datetime.now()) self.reset_fingerprint_guid() self.reset_version_guid()
def _update_metadata(self): now = datetime.now() self.header['$TDUPDATE'] = juliandate(now) self.header['$HANDSEED'] = str(self.entitydb.next_handle()) self.header['$DWGCODEPAGE'] = tocodepage(self.encoding) self.reset_version_guid()
def test_1999_12_31(self): assert 2451544.91568287 == pytest.approx(juliandate(datetime(1999, 12, 31, 21, 58, 35)))
def test_2011_03_21(self): assert 2455642.75 == pytest.approx(juliandate(datetime(2011, 3, 21, 18, 0, 0)))
def test_2000_01_01(self): assert 2451545. == pytest.approx(juliandate(datetime(2000, 1, 1)))
def test_1990_01_01(self): assert 2447893. == pytest.approx(juliandate(datetime(1990, 1, 1)))
def test_1582_10_15(self): assert 2299161. == pytest.approx(juliandate(datetime(1582, 10, 15)))
def _setup_metadata(self): self.header['$TDCREATE'] = juliandate(datetime.now())
def test_1999_12_31(self): self.assertAlmostEqual(2451544.91568287, juliandate(datetime(1999, 12, 31, 21, 58, 35)))
def test_2011_03_21(self): self.assertAlmostEqual(2455642.75, juliandate(datetime(2011, 3, 21, 18, 0, 0)))
def test_2000_01_01(self): self.assertAlmostEqual(2451545., juliandate(datetime(2000, 1, 1)))
def test_1990_01_01(self): self.assertAlmostEqual(2447893., juliandate(datetime(1990, 1, 1)))
def test_1582_10_15(self): self.assertAlmostEqual(2299161., juliandate(datetime(1582, 10, 15)))