Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kl_task7_MQTTsender
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
arun.uday
kl_task7_MQTTsender
Commits
02f1882c
Commit
02f1882c
authored
Feb 06, 2023
by
arun.uday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit6
parent
4f6b3a9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
scripts/core/handlers/extracting_sending.py
+5
-0
scripts/core/handlers/uploaded_file_.py
+1
-0
No files found.
scripts/core/handlers/extracting_sending.py
View file @
02f1882c
...
...
@@ -13,9 +13,14 @@ def extract_send_data():
dict_data
=
extract_data
(
application_config
.
full_path_csv
)
list_removed
=
remove_list
(
dict_data
)
# dumps the list to json
json_data
=
json
.
dumps
(
list_removed
)
# create the paho client
client
=
Client
()
client
.
connect
(
application_config
.
mqtt_host
,
int
(
application_config
.
mqtt_port
))
# publish the topic
client
.
publish
(
application_config
.
topic_name
,
json_data
)
client
.
disconnect
()
except
Exception
as
e
:
...
...
scripts/core/handlers/uploaded_file_.py
View file @
02f1882c
...
...
@@ -5,6 +5,7 @@ from scripts.logging.loggers import logger
def
extract_uploaded_data
(
full_path_csv
,
file_data
):
try
:
# reading the csv
with
open
(
full_path_csv
,
file_mode
)
as
file_object
:
file_object
.
write
(
file_data
.
file
.
read
())
except
Exception
as
e
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment