Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SOFT Core
SOFT 161 and 162
rest
Commits
fa7c4c06
Commit
fa7c4c06
authored
6 years ago
by
Christopher Bohn
Committed by
SE User
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updated lab 5.7 for 2019
parent
b97abd6e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
buildozer.spec
+16
-7
16 additions, 7 deletions
buildozer.spec
main.py
+2
-1
2 additions, 1 deletion
main.py
openmrs.py
+3
-4
3 additions, 4 deletions
openmrs.py
with
21 additions
and
12 deletions
buildozer.spec
+
16
−
7
View file @
fa7c4c06
...
...
@@ -36,7 +36,7 @@ version = 1.0
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = kivy
requirements =
python3,
kivy
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
...
...
@@ -88,16 +88,16 @@ fullscreen = 0
android.permissions = INTERNET
# (int) Android API to use
#
android.api = 1
9
android.api =
2
1
# (int) Minimum API required
#
android.minapi =
9
android.minapi =
21
# (int) Android SDK version to use
#android.sdk = 20
# (str) Android NDK version to use
#
android.ndk =
9
c
android.ndk =
17
c
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
...
...
@@ -146,8 +146,11 @@ android.permissions = INTERNET
# bootstrap)
#android.gradle_dependencies =
# (list) Java classes to add as activities to the manifest.
#android.add_activites = com.example.ExampleActivity
# (str) python-for-android branch to use, defaults to stable
#
p4a.branch =
stable
p4a.branch =
master
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
...
...
@@ -159,6 +162,9 @@ android.permissions = INTERNET
# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =
# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard
# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
...
...
@@ -189,7 +195,7 @@ android.arch = armeabi-v7a
# Python for android (p4a) specific
#
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from
G
it
H
ub)
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from
g
it
h
ub)
#p4a.source_dir =
# (str) The directory in which python-for-android should look for your own build recipes (if any)
...
...
@@ -201,6 +207,9 @@ android.arch = armeabi-v7a
# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2
# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =
#
# iOS specific
...
...
@@ -220,7 +229,7 @@ android.arch = armeabi-v7a
[buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level =
2
log_level =
1
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
...
...
This diff is collapsed.
Click to expand it.
main.py
+
2
−
1
View file @
fa7c4c06
...
...
@@ -23,7 +23,8 @@ class RestApp(App):
def
on_locations_not_loaded
(
self
,
_
,
error
):
self
.
root
.
ids
.
results
.
add_widget
(
Label
(
text
=
'
[Failed to load locations]
'
))
Logger
.
error
(
'
RestApp: {error}
'
.
format
(
error
=
error
))
Logger
.
error
(
f
'
RestApp:
{
error
}
'
)
if
__name__
==
'
__main__
'
:
app
=
RestApp
()
...
...
This diff is collapsed.
Click to expand it.
openmrs.py
+
3
−
4
View file @
fa7c4c06
...
...
@@ -11,16 +11,15 @@ except ImportError:
class
RESTConnection
(
object
):
@staticmethod
def
_construct_url
(
authority
,
port
,
resource
):
return
'
http://{authority}:{port}/openmrs/ws/rest/v1/{resource}
'
\
.
format
(
authority
=
authority
,
port
=
port
,
resource
=
resource
)
return
f
'
http://
{
authority
}
:
{
port
}
/openmrs/ws/rest/v1/
{
resource
}
'
def
__init__
(
self
,
authority
,
port
,
username
,
password
):
self
.
authority
=
authority
self
.
port
=
port
credentials
=
'
{username}:{password}
'
.
format
(
username
=
username
,
password
=
password
)
credentials
=
f
'
{
username
}
:
{
password
}
'
credentials
=
base64
.
standard_b64encode
(
credentials
.
encode
(
'
UTF8
'
)).
decode
(
'
UTF8
'
)
self
.
headers
=
{
'
Authorization
'
:
'
Basic {credentials}
'
.
format
(
credentials
=
credentials
)
,
'
Authorization
'
:
f
'
Basic
{
credentials
}
'
,
'
Content-type
'
:
'
application/json
'
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment