Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-hitung
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0fe01e9e
authored
Nov 06, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tambah STAN Generator
1 parent
7437dc53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
CHANGES.txt
opensipkd/string/stan.py
opensipkd/string/transaction_id.py
CHANGES.txt
View file @
0fe01e9
0.1.8 2020-10-17
----------------
- Baru, STAN (System Trace Audit Number) generator
0.1.7 2020-06-29
----------------
- Baru, class Row untuk list satu baris yang memiliki nama kolom
...
...
opensipkd/string/stan.py
0 → 100644
View file @
0fe01e9
# System Trace Audit Number
from
datetime
import
datetime
class
StanGenerator
:
def
__init__
(
self
):
self
.
reset
()
def
reset
(
self
):
self
.
seq
=
int
(
datetime
.
now
()
.
strftime
(
'
%
H
%
M
%
S'
))
def
create
(
self
):
if
self
.
seq
==
999999
:
self
.
reset
()
self
.
seq
+=
1
return
str
(
self
.
seq
)
.
zfill
(
6
)
stan_gen
=
StanGenerator
()
opensipkd/string/transaction_id.py
View file @
0fe01e9
...
...
@@ -14,7 +14,7 @@ class TransactionID:
acak
=
randrange
(
0
,
99999999
)
tid
=
prefix
+
str
(
acak
)
.
zfill
(
8
)
if
not
self
.
is_found
(
tid
):
return
tid
return
tid
if
time
()
-
awal
>
3
:
raise
Exception
(
'Timeout saat membuat Transaction ID'
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment