Ruby problems with formotion module - iphone

There is an app written in ruby that I need to get running. It worked before IOS11 but is now throwing errors. I have formotion installed and all the appropriate gems and the SDK. I am having trouble getting the compiler to recognize that there is a formotion gem with things inside it.
I am getting an uncaught exception "Name Error" and it says that the variable im trying to instantiate within the formotion class is an uninitialized constant.
Any help with this error would be appreciated.
Here are some bit of the code, the error points to row.text_field.resignFirstResponder
module RowType
class PickerWithDoneRow < PickerRow
include RowType::ItemsMapper
def after_build(cell)
super
keyboardDoneButtonView = UIToolbar.new
keyboardDoneButtonView.barStyle = UIBarStyleBlack
keyboardDoneButtonView.tintColor = "#000".uicolor
keyboardDoneButtonView.translucent = false
keyboardDoneButtonView.sizeToFit
# keyboardDoneButtonView.barTintColor = "#BFC3C8".uicolor
keyboardDoneButtonView.barTintColor = "#EFEFF4".uicolor
doneButton = UIBarButtonItem.alloc.initWithTitle("Done", style:UIBarButtonItemStylePlain, target:self, action: 'picker_done_clicked')
spacer1 = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:self, action: nil)
spacer = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:self, action: nil)
keyboardDoneButtonView.setItems([spacer, spacer1, doneButton])
row.text_field.inputAccessoryView = keyboardDoneButtonView
end
def picker_done_clicked
row.text_field.resignFirstResponder
end
end
end

There were a few gems required for the program that were not included in the code as gems that needed to be installed. The gems needed were:
bigdecimal (1.2.0)
bubble-wrap (1.3.0)
bundler (1.16.0)
formotion (1.5.1)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
motion-csv (0.0.2)
motion-require (0.0.7)
motion-testflight (1.5)
psych (2.0.0)
rake (10.1.0, 0.9.6)
rdoc (4.0.0)
sugarcube (1.1.0)
test-unit (2.0.0.0)

Related

Can I use attr: in description field of metadata in setup.cfg?

I try to use attr: in description but PyPi dispays attr: round_utils.__doc__ instead of value of that expression.
Docs says I cannot use attr: in description. Look at the Metadata table (link below):
https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata
But I had done like here: https://github.com/zifter/numeral-system-py, because I saw the package description works in PyPi https://pypi.org/project/numeral-system-py/.
Attaching my files and links:
setup.cfg
[metadata]
name = round-utils
version = 1.0.4
author = Marchenko Ilya
author_email = mrmar333#yandex.ru
home-page = https://github.com/IliyaZinoviev/round-utils.git
description = attr: round_utils.__doc__
license = MIT
license-file = LICENSE
platform = any
keywords = round, utils, number
classifiers =
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.8
Operating System :: OS Independent
[options]
zip_safe = false
include_package_data = true
python_requires = >= 3.8
package_dir =
round_utils=source/round_utils
tests=source/tests
packages =
round_utils
test_suite = tests
setup_requires =
setuptools >=30.3.0 # minimal version for `setup.cfg`
[bdist_wheel]
universal = true
[check]
metadata = true
strict = true
[sdist]
formats = gztar
round_utils.__init__py
"""Package for rounding functions"""
from .round import round_up, round_down
__all__ = [
'round_up',
'round_down'
]
PyPi link: https://test.pypi.org/project/round-utils/
Github repo: https://github.com/IliyaZinoviev/round-utils
No, you can't use attr: for the description configuration value of setuptools' setup.cfg. As of setuptools 51.1.0 (today's newest version), it is not supported. The project you linked to as a reference has not seen a release since they changed to (incorrectly) using attr: for their description, and as can be seen here it does not seem to work (as expected).

VSCode problem retrieving Bazel build targets

I'm having trouble getting VSCode to load build targets for a Java project. The error message that I get is the following:
Command failed: bazel --output_base=/var/folders/cj/1fv063dx1772zbpnfpzvj_c00000gn/T/5b71fd39758e7fd8e710c281fbbdda92 query ...:* --output=package Loading: 0 packages loaded ERROR: error loading package 'bazel-test/external/rules_jvm_external': cannot load '//:private/versions.bzl': no such file Loading: 12 packages loaded currently loading: bazel-test/external/local_config_cc ... (6 packages) Loading: 12 packages loaded currently loading: bazel-test/external/local_config_cc ... (6 packages)
My WORKSPACE file is as follows:
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_docker",
sha256 = "4521794f0fba2e20f3bf15846ab5e01d5332e587e9ce81629c7f96c793bb7036",
strip_prefix = "rules_docker-0.14.4",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.4/rules_docker-v0.14.4.tar.gz"],
)
load(
"#io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("#io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
load("#io_bazel_rules_docker//repositories:pip_repositories.bzl", "pip_deps")
pip_deps()
load(
"#io_bazel_rules_docker//java:image.bzl",
_java_image_repos = "repositories",
)
_java_image_repos()
load(
"#io_bazel_rules_docker//container:container.bzl",
"container_pull",
)
container_pull(
name = "openjdk11_slim",
registry = "index.docker.io",
repository = "library/openjdk",
tag = "11-slim"
)
RULES_JVM_EXTERNAL_TAG = "3.3"
RULES_JVM_EXTERNAL_SHA = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab"
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("#rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
# Accessed as dependency: #maven://io_vertx_vertx_core
"io.vertx:vertx-core:3.9.2",
# Accessed as dependency: #maven://io_vertx_vertx_web
"io.vertx:vertx-web:3.9.2",
# Accessed as dependency: #maven://io_vertx_vertx_rx_java2
"io.vertx:vertx-rx-java2:3.9.2",
],
repositories = [
"https://repo1.maven.org/maven2",
]
)
I don't see anything obviously wrong with my WORKSPACE file, so I'm tempted to assume the problem is with VSCode or in the BUILD files in one of my external dependencies. Other than that the project contains a single Hello.java and its accompanying java_binary rule. If I run myself the same query for all packages I get the following:
% bazel query ...:\* --output=package
src/main/java
Loading: 0 packages loaded
In other words, there's no error. Any ideas how I could try to debug or fix this? I just installed everything on the laptop, so the software versions are:
Bazel version: 3.5.0
VSCode versio: 1.48.2
Following the comment ignoring the convenience symlink solved it for me:
echo bazel-`basename ${PWD}` >> .bazelignore
I got around this issue by changing the Query Expression in Bazel extension Settings from
...:*
to
//< directory name >/...:*

PyDev 5.7.0.20170411357 No Longer Supports IronPython

I recently upgraded my PyDev plugin to version 5.7.0.20170411357.
It seems IronPython is no longer supported.
I'm using Eclipse Oxygen
Does anyone have a workaround?
When starting the debugger the following message is displayed:
RuntimeError: Unable to proceed (sys._current_frames not available in this Python implementation).
Yes, I am adding the Vm argument -x:Frames.
The error is thrown from pydevd_additional_thread_info_regular.py
There is an accommodation for Jython.
if not hasattr(sys, '_current_frames'):
# Some versions of Jython don't have it (but we can provide a replacement)
if IS_JYTHON:
from java.lang import NoSuchFieldException
from org.python.core import ThreadStateMapping
try:
cachedThreadState = ThreadStateMapping.getDeclaredField('globalThreadStates') # Dev version
except NoSuchFieldException:
cachedThreadState = ThreadStateMapping.getDeclaredField('cachedThreadState') # Release Jython 2.7.0
cachedThreadState.accessible = True
thread_states = cachedThreadState.get(ThreadStateMapping)
def _current_frames():
as_array = thread_states.entrySet().toArray()
ret = {}
for thread_to_state in as_array:
thread = thread_to_state.getKey()
if thread is None:
continue
thread_state = thread_to_state.getValue()
if thread_state is None:
continue
frame = thread_state.frame
if frame is None:
continue
ret[thread.getId()] = frame
return ret
else:
raise RuntimeError('Unable to proceed (sys._current_frames not available in this Python implementation).')
else:
_current_frames = sys._current_frames

compiles .py to .exe inluding it Classes

I have 4 .py files. Below is a list of files what is required to run the programme. Any of them missing will fail the programme to run.
How my code works:
) GUIss.py imports demonstrator.py
) Demonstrator.py imports filereader.py and process.py
) To run the programm I just need to click GUIss.py.
My cx-freeze code below:
from cx_Freeze import setup,Executable
import os
includefiles = ['filereader.py','demonstrator.py','logo.gif','thebrighterchoice.gif']
#bin_includes= ['process.py','demonstrator.py','filereader.py'] ..... 'bin_includes':bin_includesincludes = ['process']
includes = ['process','tkinter']
excludes = ['tkinter']
packages = ['os','xlrd']
setup(
name = "Process",
version = "0.1",
description = "description",
author = "Raitis Kupce",
options = {'build_exe' :{'excludes': excludes,'includes':includes,'packages':packages,'include_files':includefiles}},
executables = [Executable("GUIss.py")]
)
When I run compiled file I get an error message:
I then tried to write in setup.py (cx-freeze file)
excludes = ['tkinter']
Then includes = ['tkinter']
Afterwards packages = ['tkinter']
Despite numerous attempt, no luck, same message all the time.
P.S
My python source code can be downloaded from https://github.com/Dragnets/Administration
I did studied hours from here and here and modifying endless times but no luck.

RubyMotion: Objective-C stub for message `logInWithPermissions:block:' type `v#:##?' not precompiled

I tried to implement a Facebook login via Parse.com iOS SDK.
When I try to use the PFFacebookUtils.loginWithPermissions:block: method, I got the error.
Objective-C stub for message `logInWithPermissions:block:' type `v#:##?' not precompiled. Make sure you properly link with the framework or library that defines this message.
Anyone experienced this?
I use
rubymotion 2.31
Parse-iOS-SDK 1.2.19 (using cocoapods)
This is my Rakefile:
$:.unshift('/Library/RubyMotion/lib')
require 'motion/project/template/ios'
require 'bundler'
Bundler.require
Motion::Project::App.setup do |app|
app.name = 'myapp'
app.identifier = 'com.your_domain_here.myapp'
app.short_version = '0.1.0'
app.version = app.short_version
app.sdk_version = '7.1'
app.deployment_target = '7.0'
app.icons = ["icon#2x.png", "icon-29#2x.png", "icon-40#2x.png", "icon-60#2x.png", "icon-76#2x.png", "icon-512#2x.png"]
app.device_family = [:iphone]
app.interface_orientations = [:portrait]
app.files += Dir.glob(File.join(app.project_dir, 'lib/**/*.rb'))
app.frameworks += [
'Accounts',
'AudioToolbox',
'CFNetwork',
'CoreGraphics',
'CoreLocation',
'MobileCoreServices',
'QuartzCore',
'Security',
'Social',
'StoreKit',
'SystemConfiguration']
app.libs += [
'/usr/lib/libz.dylib',
'/usr/lib/libsqlite3.dylib']
app.pods do
pod 'SVProgressHUD'
pod 'Parse-iOS-SDK'
end
FB_APP_ID = '<my facebookAppId>'
app.info_plist['FacebookAppID'] = FB_APP_ID
app.info_plist['CFBundleURLTypes'] = [{ CFBundleURLSchemes: ["fb#{FB_APP_ID}"] }]
end
Related code:
def login_with_facebook
PFFacebookUtils.logInWithPermissions(['email'],
block: lambda do |user, error|
if !user
puts 'failed!'
elsif user.isNew
puts 'User signed up and logged in through Facebook!'
else
puts 'User logged in through Facebook!'
end
end
)
end
This is a known bug in the way the Parse SDK bridge files are generated:
http://hipbyte.myjetbrains.com/youtrack/issue/RM-119
Workaround here (for me, I had to do the replacement in the vendor/Pods/build-iPhoneSimulator/Pods.bridgesupport file)
https://groups.google.com/forum/#!msg/rubymotion/36WCWPPkPdc/kBCDS-DOSjsJ