Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
code style improvement
Browse files Browse the repository at this point in the history
change JalaliDate __str__
  • Loading branch information
mhajiloo committed Jul 8, 2016
1 parent c969c63 commit 52aa8c2
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 70 deletions.
12 changes: 6 additions & 6 deletions README.rst
Expand Up @@ -28,19 +28,19 @@ Date:
>>> import datetime
>>> JalaliDate.today()
JalaliDate(1395, 04, 18, Jomeh)
JalaliDate(1395, 4, 18, Jomeh)
>>> JalaliDate.today().to_gregorian()
datetime.date(2016, 7, 8)
>>> JalaliDate(1369, 7, 1)
JalaliDate(1369, 07, 01, Yekshanbeh)
JalaliDate(1369, 7, 1, Yekshanbeh)
>>> JalaliDate(datetime.date(1990, 9, 23))
JalaliDate(1369, 07, 01, Yekshanbeh)
JalaliDate(1369, 7, 1, Yekshanbeh)
>>> JalaliDate.to_jalali(2013, 9, 16)
JalaliDate(1392, 06, 25, Doshanbeh)
JalaliDate(1392, 6, 25, Doshanbeh)
Datetime:
^^^^^^^^^
Expand Down Expand Up @@ -103,7 +103,7 @@ Operators
False
>>> JalaliDate(1395, 2, 14) + datetime.timedelta(days=38)
JalaliDate(1395, 03, 21, Jomeh)
JalaliDate(1395, 3, 21, Jomeh)
>>> JalaliDateTime(1395, 12, 30) - JalaliDateTime(1395, 1, 1)
datetime.timedelta(365)
Expand All @@ -126,7 +126,7 @@ Serializing and de-serializing
>>> jalali = pickle.load(file)
>>> file.close()
>>> jalali
JalaliDate(1369, 07, 01, Yekshanbeh)
JalaliDate(1369, 7, 1, Yekshanbeh)
.. |pypi-ver| image:: https://img.shields.io/pypi/v/persiantools.svg
:target: https://pypi.python.org/pypi/persiantools
Expand Down
16 changes: 8 additions & 8 deletions persiantools/digits.py
Expand Up @@ -6,8 +6,8 @@ def en_to_fa(string):
"""Convert EN digits to Persian
Usage::
from persiantools import digits
converted = digits.en_to_fa("0123456789")
>>> from persiantools import digits
>>> converted = digits.en_to_fa("0123456789")
:param string: A string, will be converted
:rtype: str
Expand All @@ -32,8 +32,8 @@ def ar_to_fa(string):
"""Convert Arabic digits to Persian
Usage::
from persiantools import digits
converted = digits.ar_to_fa("٠١٢٣٤٥٦٧٨٩")
>>> from persiantools import digits
>>> converted = digits.ar_to_fa("٠١٢٣٤٥٦٧٨٩")
:param string: A string, will be converted
:rtype: str
Expand All @@ -58,8 +58,8 @@ def fa_to_en(string):
"""Convert Persian digits to EN
Usage::
from persiantools import digits
converted = digits.fa_to_en("۰۱۲۳۴۵۶۷۸۹")
>>> from persiantools import digits
>>> converted = digits.fa_to_en("۰۱۲۳۴۵۶۷۸۹")
:param string: A string, will be converted
:rtype: str
Expand All @@ -84,8 +84,8 @@ def fa_to_ar(string):
"""Convert Persian digits to Arabic
Usage::
from persiantools import digits
converted = digits.fa_to_ar("۰۱۲۳۴۵۶۷۸۹")
>>> from persiantools import digits
>>> converted = digits.fa_to_ar("۰۱۲۳۴۵۶۷۸۹")
:param string: A string, will be converted
:rtype: str
Expand Down

0 comments on commit 52aa8c2

Please sign in to comment.