diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..ff4e110 --- /dev/null +++ b/Pipfile @@ -0,0 +1,28 @@ +[[source]] + +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + + +[dev-packages] + + + +[packages] + +asyncio = "==3.4.3" +autobahn = "==0.13.0" +hypothesis = "==3.4.2" +oauthlib = "==1.1.2" +py = "==1.4.31" +pytest = "==2.9.1" +requests = "==2.10.0" +requests-oauthlib = "==0.6.1" +tweepy = "==3.5.0" +txaio = "==2.2.2" + + +[requires] + +python_version = "3.6" \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..a6aca03 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,118 @@ +{ + "_meta": { + "hash": { + "sha256": "2b5231b47860806fa2ca0869e5c3f768836e71d9138cb7796e36fdb6bf352605" + }, + "host-environment-markers": { + "implementation_name": "cpython", + "implementation_version": "3.6.4", + "os_name": "posix", + "platform_machine": "x86_64", + "platform_python_implementation": "CPython", + "platform_release": "17.4.0", + "platform_system": "Darwin", + "platform_version": "Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64", + "python_full_version": "3.6.4", + "python_version": "3.6", + "sys_platform": "darwin" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.6" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "asyncio": { + "hashes": [ + "sha256:b62c9157d36187eca799c378e572c969f0da87cd5fc42ca372d92cdb06e7e1de", + "sha256:c46a87b48213d7464f22d9a497b9eef8c1928b68320a2fa94240f969f6fec08c", + "sha256:c4d18b22701821de07bd6aea8b53d21449ec0ec5680645e5317062ea21817d2d", + "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41" + ], + "version": "==3.4.3" + }, + "autobahn": { + "hashes": [ + "sha256:ff549da68bf4065397a1a68d70b4c70067a1df2d695273ae27a5e66039df2fba" + ], + "version": "==0.13.0" + }, + "enum34": { + "hashes": [ + "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", + "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", + "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1", + "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850" + ], + "version": "==1.1.6" + }, + "hypothesis": { + "hashes": [ + "sha256:87a6b96670d52d9c30fff1342adec178822cd472775588d998bd860c05409688" + ], + "version": "==3.4.2" + }, + "oauthlib": { + "hashes": [ + "sha256:0e83e91d9e77a396dc178eddba0c4abf75e465761804bfcdb20b977284bcb0bb" + ], + "version": "==1.1.2" + }, + "py": { + "hashes": [ + "sha256:4a3e4f3000c123835ac39cab5ccc510642153bc47bc1f13e2bbb53039540ae69", + "sha256:a6501963c725fc2554dabfece8ae9a8fb5e149c0ac0a42fd2b02c5c1c57fc114" + ], + "version": "==1.4.31" + }, + "pytest": { + "hashes": [ + "sha256:3e635706fce07a734f7884a0ba32c46e5720225d861b3ed18ca76c6062de86cd", + "sha256:0d48d27a127644fbe7c8158157e08b35f8255045d4476df694b91eb3a8147e65" + ], + "version": "==2.9.1" + }, + "requests": { + "hashes": [ + "sha256:09bc1b5f3a56cd8c48d433213a8cba51a67d12936568f73b5f1793fcb0c0979e", + "sha256:63f1815788157130cee16a933b2ee184038e975f0017306d723ac326b5525b54" + ], + "version": "==2.10.0" + }, + "requests-oauthlib": { + "hashes": [ + "sha256:7c708e8e2a4aa6a905cf91f28420d75db37270e0ec8fc951915c098dd8bde53e", + "sha256:905306080ec0cc6b3c65c8101f471fccfdb9994c16dd116524fd3fc0790d46d7" + ], + "version": "==0.6.1" + }, + "six": { + "hashes": [ + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + ], + "version": "==1.11.0" + }, + "tweepy": { + "hashes": [ + "sha256:12449b5ca16b0be6a3ea68fb41992627227b48bbad8cd7d5912039340d36badc", + "sha256:f00ccf5f48c30d559ce0b750dfe3b2df6668dc799d8ce276fd90bfaa68845a58" + ], + "version": "==3.5.0" + }, + "txaio": { + "hashes": [ + "sha256:8e7811289f39e9399c8a740f19a29df4b4f15b1bd33182129159c1ec73a73f2a" + ], + "version": "==2.2.2" + } + }, + "develop": {} +} diff --git a/sofi/ui/__init__.py b/sofi/ui/__init__.py index c2ecea9..f12144f 100644 --- a/sofi/ui/__init__.py +++ b/sofi/ui/__init__.py @@ -61,3 +61,4 @@ from .pageheader import PageHeader from .listgroup import ListGroup from .formgroup import FormGroup +from .progressbar import ProgressBar diff --git a/sofi/ui/progressbar.py b/sofi/ui/progressbar.py new file mode 100644 index 0000000..6bed11e --- /dev/null +++ b/sofi/ui/progressbar.py @@ -0,0 +1,30 @@ +from .element import Element +from .div import Div + + +class ProgressBar(Element): + def __init__(self, cl=None, ident=None, style=None, attrs=None, valuenow=0, valuemin=0, valuemax=100): + super().__init__(cl=cl, ident=ident, style=style, attrs=attrs) + + self.valuenow = valuenow + self.valuemin = valuemin + self.valuemax = valuemax + + def __repr__(self): + return "" + + def __str__(self): + attrs = { + "role": "progressbar", + "aria-valuenow": str(self.valuenow), + "aria-valuemin": str(self.valuemin), + "aria-valuemax": str(self.valuemax), + } + + d = Div(cl="progress") + + cd = Div(ident=self.ident, cl="progress-bar p-50", style=f"width: {self.valuenow}%", attrs=attrs) + + d.addelement(cd) + + return str(d)