Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
py3: Make sure modules import under Python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
renpytom committed Nov 26, 2019
1 parent 4b25f26 commit 8d4a5d9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
5 changes: 4 additions & 1 deletion buildlib/rapt/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import subprocess
import hashlib

from . import plat
from . import iconmaker

import rapt.plat as plat
import rapt.iconmaker as iconmaker

Expand Down Expand Up @@ -182,7 +185,7 @@ def add(fn, relfn):

sd = os.path.abspath(sd)

for dir, dirs, files in os.walk(sd): # @ReservedAssignment
for dir, dirs, files in os.walk(sd): # @ReservedAssignment

for _fn in dirs:
fn = os.path.join(dir, _fn)
Expand Down
5 changes: 2 additions & 3 deletions buildlib/rapt/configure.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import json
import os
import re
import plat
from . import plat

__ = plat.__


# Taken from https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
JAVA_KEYWORDS = """
abstract continue for new switch
Expand Down Expand Up @@ -177,7 +176,7 @@ def configure(interface, directory, default_name=None, default_version=None):
internet = "INTERNET" in config.permissions
internet = interface.yesno_choice(__("Do you want to allow the app to access the Internet?"), internet)
else:
internet = False # included in template.
internet = False # included in template.

permissions = [ i for i in config.permissions if i not in [ "INTERNET" ] ]

Expand Down
2 changes: 1 addition & 1 deletion buildlib/rapt/iconmaker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pygame_sdl2
import os
import plat
from . import plat
import shutil


Expand Down
6 changes: 3 additions & 3 deletions buildlib/rapt/install_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import shutil
import subprocess

import rapt.plat as plat
from . import plat

__ = plat.__

Expand Down Expand Up @@ -127,8 +127,8 @@ def get_packages(interface):
packages = [ ]

wanted_packages = [
( "platform-tools", "platform-tools"),
( "platforms;android-28", "platforms/android-28"),
("platform-tools", "platform-tools"),
("platforms;android-28", "platforms/android-28"),
]

for i, j in wanted_packages:
Expand Down
9 changes: 3 additions & 6 deletions buildlib/rapt/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import subprocess
import urllib

import plat
from . import plat

import colorama
from colorama import Fore, Back, Style

colorama.init()


class Interface(object):

def write(self, s, style=""):
Expand Down Expand Up @@ -54,7 +55,6 @@ def final_success(self, prompt):
self.write(prompt, Fore.GREEN + Style.BRIGHT)
print


def yesno(self, prompt):
"""
Prompts the user for a response to a yes or no question.
Expand Down Expand Up @@ -94,8 +94,6 @@ def yesno_choice(self, prompt, default=None):

print



def terms(self, url, prompt):
"""
Displays `url` to the user, and then prompts the user to accept the
Expand All @@ -112,8 +110,7 @@ def terms(self, url, prompt):
if not self.yesno(prompt):
self.fail("You must accept the terms and conditions to proceed.")


def input(self, prompt, empty=None): #@ReservedAssignment
def input(self, prompt, empty=None): # @ReservedAssignment
"""
Prompts the user for input. The input is expected to be a string, which
is stripped of leading and trailing whitespace. If `empty` is true,
Expand Down

0 comments on commit 8d4a5d9

Please sign in to comment.