| Package | flare.animate |
| Class | public class Transitioner |
| Inheritance | Transitioner Parallel Transition flash.events.EventDispatcher |
| Implements | IValueProxy |
For example, the following code creates a 1 second animation for two items. The first item is translated to the point (50,50) and the second item is scaled along the x dimension to twice the normal size.
var item1:Sprite, item2:Sprite; // assume these are two drawn sprites var t:Transitioner = new Transitioner(1); // create 1-second transition t.$(item1).x = 50; t.$(item1).y = 50; t.$(item2).scaleX = 2; t.play();
In the code above, the $
method takes an item (this
can be any ActionScript object, but is often a DisplayObject
instance) and returns an Object
which stores the names of
the properties to animate and their target values. Behind the scenes,
the Transitioner
automatically creates Tween
objects as needed.
The object returned by the $
method is a proxy object
that passes the values to underlying tweens as needed. This same proxy
object is reused across calls to the $
method so do
not attempt to use multiple return values from the
$
method simultaneously. The following example shows
what you should not do!
var o1:Object = t.$(item1); var o2:Object = t.$(item2); // o2==o1, now configured for item2 o1.x = 5; // actually sets the value 5 to item2, NOT item1
A transitioner can also be set to "immediate" mode, either by setting
the immediate
property to true, or by passing in
NaN
as the duration value to the constructor. When in
immediate mode, a transitioner will NOT generate
Tween
instances to animate the properties. Instead, the
transitioner will set the values of the target objects immediately.
For example, when in immediate mode, the $
operator is
equivalent to directly setting the property:
t.$(item1).x = 50
has exactly the same result at
t.x = 50
. The static property
Transitioner.DEFAULT
provides a default instance of an
immediate-mode transitioner.
With these features, transitioners provide a highly flexible way to update values in your application. You can write layout and other methods once, using a transitioner to update all the property values. When animation is desired, a standard transitioner can be passed in to your routines. When immediate updates are desired, you can reuse the same code, but just pass in a transitioner in immediate mode instead. Whether or not value updates are animated or immediate then becomes easy to control.
Transitioners also provide optimizations to improve animation
performance. However, they are not enabled by default, as the
optimizations make some assumptions about how the transitioner will
be used. See the optimize
property and
dispose
method for more information.
| Property | Defined by | ||
|---|---|---|---|
| autoDuration : Boolean
If true, the duration of this sequence is automatically determined
by the longest sub-transition.
| Parallel | ||
| DEFAULT_EASING : Function [static] Default easing function: a cubic slow-in slow-out.
| Transition | ||
| delay : Number The delay between a call to play and the actual start
of the transition, in seconds.
| Transition | ||
| duration : Number The duration (length) of this Transition, in seconds.
| Parallel | ||
| easing : Function Easing function used to pace this Transition.
| Transition | ||
| enabled : Boolean = true Flag indicating if step events should be processed.
| Transition | ||
| id : String A unique name identifying this schedulable object.
| Transition | ||
| immediate : Boolean Immediate mode flag, used to bypass tween generation and perform
immediate updates of target object values.
| Transitioner | ||
| optimize : Boolean
Flag indicating if aggressive optimization should be applied.
| Transitioner | ||
| progress : Number Fraction between 0 and 1 indicating the current progress
of this transition.
| Transition | ||
| reverse : Boolean Indicates if this Transition is running in reverse.
| Transition | ||
| running : Boolean Indicates if this Transition is currently running.
| Transition | ||
| totalDuration : Number The total duration, including both delay and active duration.
| Transition |
| Method | Defined by | ||
|---|---|---|---|
|
Transitioner(duration:Number = 1, easing:Function = null, optimize:Boolean = false, id:String = null)
Creates a new Transitioner with specified duration.
| Transitioner | ||
|
Returns the Tween for the given object, creating a new tween if no
tween is yet associated with the object.
| Transitioner | ||
|
$(o:Object):Object
Returns the values object of the Tween for the given object.
| Transitioner | ||
|
add(t:Transition):void
Adds a new sub-transition to this parallel transition.
| Parallel | ||
|
cancelled():void
Informs this transition that it was cancelled by the scheduler.
| Transition | ||
|
dispose():void
Disposes of the internal state of this transitioner.
| Transitioner | ||
|
endBounds(d:DisplayObject, coords:DisplayObject):Rectangle
Computes the approximate bounds of the given object after this
transitioner has been run.
| Transitioner | ||
|
endSize(d:DisplayObject, r:Rectangle = null):Rectangle
Computes the approximate size of the given object after this
transitioner has been run.
| Transitioner | ||
|
evaluate(time:Number):Boolean
Evaluates the Transition, stepping the transition forward.
| Transition | ||
|
getDelay(o:Object):Number
Gets the delay of the tween for the given object.
| Transitioner | ||
|
getValue(o:Object, name:String):*
Retrieves property values for a target object.
| Transitioner | ||
|
hasTweenFor(o:Object):Boolean
Indicates if the Transitioner contains a Tween for the given object.
| Transitioner | ||
|
instance(t:*):Transitioner
[static]
Gets a transitioner instance depending upon the input value.
| Transitioner | ||
|
pause():void
Pauses the transition at its current position.
| Transition | ||
|
play(reverse:Boolean = false):void
Starts running the transition.
| Parallel | ||
|
remove(t:Transition):Boolean
Removes a sub-transition from this parallel transition.
| Parallel | ||
|
removeChild(dobj:DisplayObject, b:Boolean = true):void
Sets the removal status of a display object with this transition.
| Transitioner | ||
|
reset():void
Resets the transition, so that any cached starting values are
cleared and reset the next time this transition is played.
| Transition | ||
|
setDelay(o:Object, delay:Number):void
Sets the delay of the tween for the given object.
| Transitioner | ||
|
setValue(o:Object, name:String, value:*):void
Sets property values for a target object.
| Transitioner | ||
|
Staggers the start of each sub-transition by a given interval.
| Parallel | ||
|
step(ef:Number):void
Steps each sub-transition.
| Parallel | ||
|
stop():void
Stops the transition and completes it.
| Transition | ||
|
willRemove(d:DisplayObject):Boolean
Indicates if a display object is scheduled to be removed from the
display list when this transition completes.
| Transitioner |
| Method | Defined by | ||
|---|---|---|---|
|
computeDuration():void
Computes the duration of this parallel transition.
| Parallel | ||
|
end():void
Ends each sub-transition.
| Transitioner | ||
|
setup():void
Sets up each sub-transition.
| Parallel | ||
|
start():void
Starts each sub-transition.
| Parallel |
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT : Transitioner
[static] The default, immediate-mode transitioner instance.
| Transitioner |
| immediate | property |
immediate:Boolean
[read-write]Immediate mode flag, used to bypass tween generation and perform immediate updates of target object values.
Implementation public function get immediate():Boolean
public function set immediate(value:Boolean):void
| optimize | property |
optimize:Boolean
[read-write]Flag indicating if aggressive optimization should be applied. This can significantly decrease processing time when large numbers of elements are involved. However, the optimization process makes a few assumptions about how the transitioner will be used. If these assumptions are not met, the animations may exhibit unexpected behaviors.
The assumptions made for optimized transitioners are:
Sequence
.Tween
and Interpolator
instances, reducing initialization time across transitioners by
reusing objects. public function get optimize():Boolean
public function set optimize(value:Boolean):void
| Transitioner | () | constructor |
public function Transitioner(duration:Number = 1, easing:Function = null, optimize:Boolean = false, id:String = null)
Creates a new Transitioner with specified duration.
Parametersduration:Number (default = 1 ) — the length of the transition. If this value is NaN,
the transitioner will be in immediate mode, in which all changes
are immediately applied and no tweens are generated.
|
|
easing:Function (default = null ) — the easing function to use for this transition. If
null, the function Easing.none will be used.
|
|
optimize:Boolean (default = false ) — boolean flag indicating if the transitioner should
attempt to optimize tween construction. See the documentation
for the optimize property for mode details.
|
|
id:String (default = null ) — an optional id. If non-null, any other running transition
with the same id will be canceled when this transitioner is played.
|
| _ | () | method |
public function _(o:Object):Tween
Returns the Tween for the given object, creating a new tween if no tween is yet associated with the object. This method returns null if the transitioner is in immediate mode.
Parameterso:Object — the target object
|
Tween —
a tween for the input target object, or null if this
transitioner is in immediate mode.
|
| $ | () | method |
public function $(o:Object):Object
Returns the values object of the Tween for the given object. If no tween is associated with the object, a new one is created. If the transitioner is in immediate mode, then no Tween will be created. Instead, the input object will be returned. This allows value updates to be set immediately, rather than animated by a tween.
Parameterso:Object — the target object
|
Object — the values object for the target object's
tween, or the target object itself if this transitioner is in
immediate mode.
|
| dispose | () | method |
public override function dispose():void
Disposes of the internal state of this transitioner.
Contained tweens and their interpolators will be collected and
recycled for future reuse, improving initialization times for
subsequent transitioners. This method is automatically called at the
end of the transition if the optimize
flag is true.
Otherwise, this method can be invoked manually when a transitioner
is no longer needed.
| end | () | method |
protected override function end():void
Ends each sub-transition.
| endBounds | () | method |
public function endBounds(d:DisplayObject, coords:DisplayObject):Rectangle
Computes the approximate bounds of the given object after this
transitioner has been run. This calculation is performed by
applying the final scaleX
, scaleY
,
size
, x
, and y
values of
the object.
d:DisplayObject — the display object to compute the size for
|
|
coords:DisplayObject — the target coordinate space for the bounds
|
Rectangle — a rectangle whose width and height
properties contain the end size values.
|
| endSize | () | method |
public function endSize(d:DisplayObject, r:Rectangle = null):Rectangle
Computes the approximate size of the given object after this
transitioner has been run. This calculation is performed by
applying the final scaleX
, scaleY
, and
size
values of the object.
d:DisplayObject — the display object to compute the size for
|
|
r:Rectangle (default = null ) — a rectangle for storing the results
|
Rectangle — a rectangle whose width and height
properties contain the end size values.
|
| getDelay | () | method |
public function getDelay(o:Object):Number
Gets the delay of the tween for the given object. If the transitioner is in immediate mode or no tween has been created for the input object, this method returns zero.
Parameterso:Object — the object to get the delay for
|
Number — the delay of the tween, or zero if there is no tween
|
| getValue | () | method |
public function getValue(o:Object, name:String):*
Retrieves property values for a target object. This method has the
same effect as accessing a property using the object returned by the
$
method.
If the transitioner is in immediate mode, the property name will
be parsed and the value retrieved diretly from the target object. If
the transitioner is not in immediate mode, this method will first
try to lookup the value in the tween values
for the
target object. If this does not succeed, the property value will be
retrieved directly from the target object itself as in the immediate
mode case.
o:Object — the target object
|
|
name:String — the property name string
|
* — the property value for the target object, either from the
target object's tween values, or, failing that, the object itself.
|
| hasTweenFor | () | method |
public function hasTweenFor(o:Object):Boolean
Indicates if the Transitioner contains a Tween for the given object.
Parameterso:Object — the object to test for
|
Boolean — true if there is a Tween for the object, false otherwise
|
| instance | () | method |
public static function instance(t:*):Transitioner
Gets a transitioner instance depending upon the input value.
Parameterst:* — input determining the transitioner instance to return. If
the input is a transitioner, it is simply returned. If the input is
a number, a new Transitioner with duration set to the input value
is returned, unless the number is less than zero, in which case the
default immediate-mode transitioner is returned. If the input is
null, Transitioner.DEFAULT is returned.
|
Transitioner —
a Transitioner instance determined by the input
|
| removeChild | () | method |
public function removeChild(dobj:DisplayObject, b:Boolean = true):void
Sets the removal status of a display object with this transition. If true, the display object will be removed from its parent in the display list when the transition completes. If this transitioner is in immediate mode, any removals are performed immediately.
Parametersdobj:DisplayObject — a display object
|
|
b:Boolean (default = true ) — true to remove the display object from the display list
at the end of the transition (the default). If false, the removal
status will be updated so that the display object will not be
removed (not applicable in immediate mode).
|
| setDelay | () | method |
public function setDelay(o:Object, delay:Number):void
Sets the delay of the tween for the given object. If the transitioner is in immediate mode, this method has no effect.
Parameterso:Object — the object to set the delay for
|
|
delay:Number — the delay, in seconds
|
| setValue | () | method |
public function setValue(o:Object, name:String, value:*):void
Sets property values for a target object. This method has the same
effect as setting a property on the object returned by the
$
method.
If the transitioner is in immediate mode, the property name will be parsed and the value set at the end of the property chain. If the transitioner is not in immediate mode, the property name and values will simply be added to a Tween. If no Tween is associated with the input object, a new one will be created.
Parameterso:Object — the target object
|
|
name:String — the property name string
|
|
value:* — the property value to set
|
| willRemove | () | method |
public function willRemove(d:DisplayObject):Boolean
Indicates if a display object is scheduled to be removed from the display list when this transition completes. This method always returns false if this transitioner is in immediate mode.
Parametersd:DisplayObject — a display object
|
Boolean — true if the display object will be removed from the display
list at the end of this transition, false otherwise. This method
always returns false if the transitioner is in immediate mode.
|
| DEFAULT | constant |
public static const DEFAULT:Transitioner
The default, immediate-mode transitioner instance.


Blank
Huawei Ionic Health
Sign In with Huawei ID
DataController
initDataController
read
insert
update
deleteData
readTodaySummation
readDailySummation
clearAll
ActivityRecordController
addActivityRecord
beginActivityRecord
endActivityRecord
getActivityRecord
AutoRecorderController
startRecord
stopRecord
ConsentsController
getPermissions
revokeAll
revoke
SettingsController
addDataType
disableHiHealth
readDataType
checkHealthAppAuthorization
getHealthAppAuthorization


{% extends 'imagersite/base.html' %} {% block somecontent %}
Hello, your activation key {{ activation_key }} has expired. Please contact the site administrator to get your account activated.


DiagramAction Abstract Class
Definition
Line
26
of
spring/Action.cm
Inheritance
Constructors & Destructor
public
nothrow
DiagramAction
(
Diagram
& diagram_)
Member Functions
public
override
void
Execute
()
protected
abstract
void
Execute
(
Diagram
& diagram)
Member Variables
private
Diagram
&
diagram
Constructor& Destructor Details
DiagramAction Constructor
public
nothrow
DiagramAction(
Diagram
& diagram_)
Definition
Line
28
of
spring/Action.cm
Member Function Details
Execute Member Function
public
override
void
Execute()
Definition
Line
31
of
spring/Action.cm
Execute Member Function
protected
abstract
void
Execute(
Diagram
& diagram)
Definition
Line
36
of
spring/Action.cm


Current Position
2018.09-present
Assistant Professor
Beijing Institute of Technology (BIT), Beijing, China
Experience
2017.04-2018.8
Postdoctoral Fellow
The Hong Kong Polytechnic University (PolyU), Hong Kong
Advisor: Dr. Man Ho Au
Education
2011.09-2017.06
Ph.D. in Information Security
Beijing University of Posts and Telecommunications (BUPT), Beijing, China
Advisor: Prof. Qiaoyan Wen2014.09-2015.08
Visiting Ph.D.
University of Wollongong (UOW), Wollongong, Australia
Advisor: Prof. Yi Mu and Dr. Fuchun Guo2006.09-2010.06
B.S. in Applied Mathematics
Southeast University (SEU), Nanjing, China
Publications
- Peng Jiang, Jianting Ning, Kaitai Liang, Changyu Dong, Jiageng Chen, Zhenfu Cao.
Encryption Switching Service: Securely Switch Your Encrypted Data to Another Format.
IEEE Transactions on Services Computing, to appear, 2018. Acceptance Date: 10 October 2018. - Peng Jiang, Fuchun Guo, Willy Susilo, Man Ho Au, Jianchang Lai, Wenmin Li.
PPFilter: Provider Privacy-aware Encrypted Filtering System.
IEEE Transactions on Services Computing, to appear, 2018. Acceptance Date: 27 September 2018. - Peng Jiang, Fuchun Guo, Yi Mu.
Efficient Identity-based Broadcast Encryption with Keyword Search against Insider Attacks for Database Systems.
Theoretical Computer Science, to appear, 2018. Acceptance Date: 27 September 2018. - Peng Jiang, Jianchang Lai, Fuchun Guo, Willy Susilo, Man Ho Au, Guomin Yang, Yi Mu, Rongmao Chen.
Identity-Based Revocation System: Enhanced Security Model and Scalable Bounded IBRS Construction with Short Parameters.
Information Sciences, to appear, 2018. Acceptance Date: 10 September 2018. - Jianchang Lai, Yi Mu, Fuchun Guo, Peng Jiang, Sha Ma.
Identity-Based Broadcast Encryption for Inner Products.
The Computer Journal, vol. 61(8), pp. 1240-1251, 2018. - Jianchang Lai, Yi Mu, Fuchun Guo, Peng Jiang, Willy Susilo.
Privacy-enhanced attribute-based private information retrieval.
Information Sciences, vol. 454-455, pp. 275--291, 2018. - Peng Jiang, Fuchun Guo, Willy Susilo, Man Ho Au, Xinyi Huang, Joseph Liu.
Efficient and Adaptive Procurement Protocol with Purchasing Privacy.
IEEE Transactions on Services Computing, to appear, 2018. Acceptance Date: 21 March 2018. - Peng Jiang, Fuchun Guo, Willy Susilo, Jinguang Han.
Keyword Attacks and Privacy Preserving in Public-Key-Based Searchable Encryption.
Encyclopedia of Big Data Technologies, 2018. doi:10.1007/978-3-319-63962-8_232-1. - Peng Jiang, Fuchun Guo, Kaitai Liang, Jianchang Lai, Qiaoyan Wen.
Searchain: Blockchain-based Private Keyword Search in Decentralized Storage.
Future Generation Computer Systems, to appear, 2017. Acceptance Date: 18 August 2017. - Xiaoqi Li, Peng Jiang, Ting Chen, Xiapu Luo, Qiaoyan Wen
A Survey on the security of blockchain systems.
Future Generation Computer Systems, to appear, 2017. Acceptance Date: 14 August 2017. - Willy Susilo, Peng Jiang, Fuchun Guo, Guomin Yang, Yong Yu, Yi Mu.
EACSIP: Extendable Access Control System with Integrity Protection for Enhancing Collaboration in the Cloud.
IEEE Transactions on Information Forensics & Security, to appear, 2017. Acceptance Date: 24 July 2017. - Peng Jiang, Yi Mu, Fuchun Guo, Qiaoyan Wen.
Private Keyword Search for Database Systems against Insider Attacks.
Journal of Computer Science and Technology (JCST), vol. 32(3), pp. 599–617, 2017. - Jingwei Li, Adam Bowers, Dan Lin, Peng Jiang, Wei Jiang.
PAS: Policy-based Assistance in Sensor Network.
Computing, to appear, 2016. - Peng Jiang, Yi Mu, Fuchun Guo, Qiaoyan Wen.
Secure-Channel Free Keyword Search with Authorization in Manager-centric Databases.
Computers & Security, Online, 2016. DOI: 10.1016/j.cose.2016.11.015. - Peng Jiang, Yi Mu, Fuchun Guo, Qiaoyan Wen.
Public Key Encryption with Authorized Keyword Search.
In: 21th Australasian Conference on Information Security and Privacy (ACISP 2016) (Regular Paper).
LNCS 9723, pp. 170–186, 2016. [Acceptance Ratio: 54/176] - Peng Jiang, Xiaofen Wang, Jianchang Lai, Fuchun Guo, Rongmao Chen.
Oblivious Keyword Search with Authorization.
In: 10th International Conference on Provable Security (ProvSec 2016) (Regular Paper).
LNCS 10005, pp. 173–190, 2016. [Acceptance Ratio: 17/88] - Peng Jiang, Yi Mu, Fuchun Guo, Xiaofen Wang, Jianchang Lai.
Centralized Keyword Search on Encrypted Data for Cloud Applications.
Security and Communication Networks (SCN), vol. 9(18), pp. 5064–5084, 2016. - Peng Jiang, Yi Mu, Fuchun Guo, Xiaofen Wang, Qiaoyan Wen.
Online/Offline Ciphertext Retrieval on Resource Constrained Devices.
The Computer Journal, vol. 59(7), pp. 955-969, 2016. - Peng Jiang, Qiaoyan Wen, Wenmin Li, Zhengping Jin, Hua Zhang.
An Anonymous and Efficient Remote Biometric User Authentication Scheme in a Multi-server Environment.
Frontier Computer Science (FCS), vol. 9(1), pp. 142-156, 2015. - Peng Jiang, Qiaoyan Wen, Wenmin Li, Zhengping Jin, Hua Zhang.
An Anonymous User Authentication with Key Agreement Scheme Without Pairings for Multi-server Architecture using SCPKs.
Scientific World Journal, vol. 2013.
Patents
- 李文敏, 蒋芃, 张华, 王心怡.
基于无证书的M2M 隐私保护和密钥管理的方法.
中华人民共和国国家知识产权局, 发明专利, CN103297963A, 2013. - 张华, 王心怡, 李文敏, 蒋芃.
基于生物特征的批量认证的方法及服务器.
中华人民共和国国家知识产权局, 发明专利, CN103297235A, 2013.
Awards
- Scholarship supported by China Scholarship Council, 2014-2015.
- National Award for Postgraduate, 2012.
- BUPT Outstanding Postgraduate Scholarship (first class), 2011-Present.
- BUPT Outstanding Postgraduate Award, 2011, 2012.


It's an Ionic Open Source UI component for firebase authentication powered by @firebase, @angular and @angular/fire


Hello {{ user }}
Please find the attached file to view your photos from {{ photographer }} taken at {{ location }}.
The photos attached are original files - they are in awesome qualities but file sizes might be too big to be posted on your social media. You can download mobile-optimized photos from the PRIZM website (https://prizm.cloud/) Login and go to 'My Photos' to view and download the photos.
Thank you very much for being with us, and hope you use PRIZM again for your next travel destination in the future. If you have any questions or suggestions, please send us an email to<EMAIL_ADDRESS>Thanks again and have a great day!
Claude


Modeling
The base class for data models is ModelBase
. This will provide you with the following capabilities:
If revertible change tracking is desired, use ChangeTrackingModelBase
as your base class. This includes the following interfaces
IChangeTracking
: Indicates whether an object has unsaved changes.IRevertibleChangeTracking
: Allows the unsaved changes to be reverted.IPropertyChangeTracking
: Provides a list of changed properties. Used for logging changes and by the Chain ORM for generating more efficient SQL.IDetailedPropertyChangeTracking
: Adds the ability to retrieve the previous value, which is useful when logging changes.
The EditableObjectModelBase
further extends this capability by added a second level of undo support via the IEditableObject
interface. This is used in WinForms/WPF data grids and should be considered for any modal dialog.
For collections, create a subclass of ModelCollection
, ChangeTrackingModelCollection
, or EditableObjectModelCollection
as appropriate.
Property Change Notification
Simple property change notification is handled via a pair of helper methods.
public string FirstName { get { return Get<string>(); } set { Set(value); } }
Using this model, the actual values are stored in a dictionary that is used for validation, change tracking, and undo support.
If you need to specify a non-standard default, use this syntax to avoid accidentally setting the IsChanged flag.
public int HitPoints { get { return GetDefault<int>(50); } set { Set(value); } }
If your default is an object, you’ll need to use GetNew<T>
instead. This can call the default constructor or invoke a Func<T>
to avoid unnecessarily allocating memory. This is most often used for collection properties.
//C# 6 public SimplePersonCollection Childern => GetNew<SimplePersonCollection>(); //C# 5 public SimplePersonCollection Childern { get { return GetNew<SimplePersonCollection>(); } }
For advanced scenarios, see Property Change Notification.


3 references to Until
System.Management.Automation (3)
engine\runtime\Operations\MiscOps.cs (3)
2616
if (selectionMode == WhereOperatorSelectionMode.First || selectionMode == WhereOperatorSelectionMode.
Until
)
2677
if (selectionMode == WhereOperatorSelectionMode.
Until
)
2730
else if (selectionMode == WhereOperatorSelectionMode.
Until
)


Hello!
I installed on Raspberry2 the 8.5 version.
When I want to upload data to a feed, I get:
Fatal error: Call to a member function setTimezone() on a non-object in /var/www/emoncms/Modules/input/process_model.php on line 668
Timezone and database are updated and correct.
Anybody an idea?
Thank you!
Re: Timezone Problem (Extended branch)
Check the date.timezone variable in /etc/php5/apache2/php.ini
It should be uncommented and set to your timezone.
See http://php.net/manual/en/timezones.php for a list of supported timezones.
Re: Timezone Problem (Extended branch)
Hi Bill,
Yes, this variable I have set before correct:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Vienna"
The error happen in:
// Get the start of the day
private function getstartday($time_now)
{
$now = DateTime::createFromFormat("U", $time_now);
$now->setTimezone(new DateTimeZone($this->timezone));
$now->setTime(0,0); // Today at 00:00
return $now->format("U");
}
I also checked the database and user ... same TimeZone!
maybe $now or &this is null?
Re: Timezone Problem (Extended branch)
Can you confirm that you've selected your timezone within emoncms (it's in the Account menu).
Paul
Re: Timezone Problem (Extended branch)
Hi Paul!
Yes, I can confirm. I also checked it in the database ... Linux, Apache and emoncms has "Europe/Vienna".
I set Linux locale to "de/at" and not "de/de" ... could this be a problem?
Re: Timezone Problem (Extended branch)
Here all infos:
uname -a:
Linux raspberrypi 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux
locale:
LANG=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8
php.ini:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Vienna"
In the database from "users" and on the website I see that the user is used same timezone.
Re: Timezone Problem (Extended branch)
Its fixed on next commit.
But try making this change in bold:
$now = DateTime::createFromFormat("U", (int)$time_now);
Re: Timezone Problem (Extended branch)
I'm having this problem too and would appreciate any advice.
I've just done a fresh install of emonhub to migrate after using oemgateway for a long time. I also want to send my data to an additional new remote server.
Emonhub is sending data, but this error appeared as I started to configure the feeds, so it's something in that process:
2015-06-09 12:30:25,246 WARNING emonCMS send failure: wanted 'ok' but got '
Fatal error: Call to a member function setTimezone() on a non-object in /****PATH_HERE****/Modules/input/process_model.php on line 669
I have tried the temp fix you suggest above @chaveiro in process_model.php:
$now = DateTime::createFromFormat("U", (int)$time_now);
...but no change.
I've set the right timezone on my remote emoncms installation: Europe/London and set the same timezone on emonhub.
It seems like the time being passed from other functions is Not a Number.....but I'm guessing at that.
The result is no inputs update on the remote site after the first update and the feeds show Updated as NaNs ago for all of the feeds I've set up so far.
Any ideas welcome.
Michael
Re: Timezone Problem (Extended branch)
I suggest you to try XT version, thats the only version i maintain.
Re: Timezone Problem (Extended branch)
I've been trying to fix this but no joy, so going to leave it for a while. I'm still seeing "NaNs ago" as the updated count on feeds page:
http://www.innovys.co.uk/emoncms/feed/list
I'm on a hosted environment, so got some questions into the hosting provider re. redis and some other stuff. But I'm at the point where I forget what I've looked at and what I haven't! So time to forget it for a while....Will check back again later
Re: Timezone Problem (Extended branch)
(you're not on xt version)
Re: Timezone Problem (Extended branch)
I'm not a PHP expert
Is that the xt version of PHP?
How do you know? Could you check from my link?
Thanks:D
Re: Timezone Problem (Extended branch)
No, it's the extended git branch of emoncms, which chaviero kindly maintains.
Paul
Re: Timezone Problem (Extended branch)
Thanks Paul and Chaveiro:D
I'll download and do a fresh install in the next few days
Re: Timezone Problem (Extended branch)
I've done a fresh install with XT, configured it and all seems to be working fine. My updates are showing time properly again :
I'll leave it running and see how it develops now.
Thanks @chaveiro , Paul and others :D
Re: Timezone Problem (Extended branch)
Good to hear. The extended version does seem to be the most bug free version at this time.
Paul
Re: Timezone Problem (Extended branch)
v8.5.1 XT seems to have had a successful first night without any problems.
However I'm just looking to set up the rest of my interface and I can't see the dashboard menu....Had a quick search for known bugs and can't see it.
Any suggestions?
Michael
Re: Timezone Problem (Extended branch)
This is what I see...
...but I already had some dashboards created when I installed the extended branch. I wonder if we need a 'New Dashboard' submenu item, to create a dashboard, especially when no dashboards currently exist?
Paul
Re: Timezone Problem (Extended branch)
I created a fresh install, included fresh mysql DB as I wanted to try and fix my errors and was willing to rebuild my views later.
I'm also planning to try and merge my historical data from a private server running 8.1.1 http://kingnetwork.axiscam.net/emoncms/dashboard/view
...but that's a question for later!
Here's what I see on feeds:
and same for inputs:
Re: Timezone Problem (Extended branch)
Your screenprints are too small to see the detail, can you add them as 'File attachments' (underneath the editor), copy the url, then add an 'Image' with the same url from the comment editor.
This is how we add images to posts in the forum.
Paul
Re: Timezone Problem (Extended branch)
ahhh.
Images attached now.....!
Thx:P
Re: Timezone Problem (Extended branch)
That is strange, i could not reproduce even after deleting my dashboards.
Any error on chrome console (press F12) ?
Go to http://yourhost//dashboard/list directly and create a new dashboard.
Re: Timezone Problem (Extended branch)
No console error messages before I did anything Paul. I tabbed around input, feeds and other views and nothing I could see
Manually getting into the view with ..../dashboard/list worked. I saw the sheet saying no dashboard and could create a new one.
However, I've created one now but still don't see the menu....See attached for dashboard view, with console and no dashboard menu....
Mike
Re: Timezone Problem (Extended branch)
Just cleared all the browsing cache too and no joy. Hitting ctrl R to refresh the Java too. Same: no dashboard menu
Re: Timezone Problem (Extended branch)
I've tracked down the bug, but would appreciate advice on the solution. It's in dashboard_menu.php. It's a short file and so I've pasted it below, with my debug comments.
The $sess variable is being set to "" in the $menu_left array. If I set the $sess variable to "all" then my Dashboard menu appears, including the 2 dropdowns.
The $sess variable is set above, but I'm not confident enough in my php skills to be sure of how to change this correctly.
If anyone can guide me I'd appreciate it. I could just manually set it to "all" I guess, but that doesn't seem right :P
Michael
<?php
global $mysqli,$route;
require_once "Modules/dashboard/dashboard_model.php";
$dashboard = new Dashboard($mysqli);
$location = 'view';
$sess = (isset($session['write']) && $session['write'] ? 'write':(isset($session['read']) && $session['read'] ? 'read':''));
if (isset($session['profile']) && $session['profile']==1) {
$dashpath = $session['username'];
$sess= 'all';
} else {
if ($route->action == "edit" && $session['write']) $location = 'edit';
$dashpath = 'dashboard/'.$location;
}
// Contains a list for the drop down with dashboards available for user session type
$listmenu = $dashboard->build_menu_array($location);
$domain = "messages";
bindtextdomain($domain, "Modules/dashboard/locale");
bind_textdomain_codeset($domain, 'UTF-8');
//MJK $sess= 'all';
$menu_left[] = array('name'=> dgettext($domain, "Dashboards"), 'path'=>$dashpath , 'session'=>$sess, 'order' => 4, 'dropdown'=>$listmenu);
//var_dump("mjk:");
//var_dump($menu_left);
//die();
Re: Timezone Problem (Extended branch)
Try by changing :
global $mysqli,$route;
to:
global $mysqli,$route,$session;
Re: Timezone Problem (Extended branch)
Chaviero, if no dashboards have been created, ie a clean install, then how do users create their first dashboard with the new menu drop down, other than entering the URL path in their browser?
Would a new sub menu item 'new dashboard' make it easier.
Paul
Re: Timezone Problem (Extended branch)
In that case there is no dropdown and the menu item is a link to the list.
Re: Timezone Problem (Extended branch)
@chaveiro I've made that change and it's solved it. Thanks very much :D
I have a dashboard menu item!
Thx again
Re: Timezone Problem (Extended branch)
Cool!
That has something to do with php versions. I fixed on github.


{% load static %}
Nowadays people are afraid to take risks. Entreprenuership is one of those. Its elemental definition is "owing a business with some risks in order to make profit". We at E-Cell of IIIT Delhi have those hormones in our andrenals to take those risks and also have intent to cultivate those in others with some groundbreaking ideas that could possibly change the perception of the society towards Entreprenuership. Our vision is to enrich the Indian youth with proper Entp skills through many enlighting workshops, etalks, startup showcases and self-assertive or ambitious yet productive and healthy competitions.
Summer Camp 2016
Summer Camp 2017
12 hours to prepare a pitch and get investment from us. The top 5 tems get to present infront of judges. Top team gets a chance to incubate
How will you sell a pen without ink in it or probably a condom with a hole in it. Can you master your pitch to sell the most unsellable thing?
You get a chance to host a bid for it. Or maybe a stall to sell your items off.
| Day | 9AM - 9.30AM | Session 1 (9.30AM - 11.30AM) Session Theme |
11.30AM -12PM | Session 2 (12PM - 1PM) Session Theme |
|---|---|---|---|---|
| Monday | Morning Sessions | Problem solving and Maths | Lunch | Theatre |
| Tuesday | Hands on Science | Lunch | Sports | |
| Wednesday | Personality Development and Communication Skills | Lunch | Art and Craft | |
| Thursday | Computer Science | Lunch | Music/Dance | |
| Friday | General Knowledge | Lunch | Career Counselling |
Summer Camp 2019 is run and organized by a team of students from IIIT-Delhi. The team comprises of 4 coordinators and 30+ volunteers from B.Tech batches. The coordinators and volunteers are further guided by IIIT-D Faculty and Staff. The coordinators are actively involved in building curriculum, training the volunteers, managing summer camp activities and motivating volunteers to teach and manage the kids effectively. A set of volunteers are made responsible for daily sessions and take care of the students around the campus.
We at RPVV lajpat Nagar had a really eventful year. Our students performed very well at the home exams and we are hoping for great results at the Boards too. You mentored our students and shared your precious time, resources and ideas with them. Your organization helped us realize the vision we had for our school and students. We are really thankful for your support and look forward to greater opportunities of collaboration with you!
- Principal, RPVV Lajpat Nagar


An implementation of data analysis tools for samples of symmetric or Hermitian positive definite matrices, such as collections of covariance matrices or spectral density matrices. The tools in this package can be used to perform: (i) intrinsic wavelet transforms for curves (1D) or surfaces (2D) of Hermitian positive definite matrices with applications to dimension reduction, denoising and clustering in the space of Hermitian positive definite matrices; and (ii) exploratory data analysis and inference for samples of positive definite matrices by means of intrinsic data depth functions and rank-based hypothesis tests in the space of Hermitian positive definite matrices.
| Version: | 1.2.3 |
| Depends: | R (≥ 3.4.0) |
| Imports: | multitaper, Rcpp, ddalpha, Rdpack |
| LinkingTo: | Rcpp, RcppArmadillo (≥ 0.7.500.0.0) |
| Suggests: | knitr, rmarkdown, testthat, grid, ggplot2, reshape2, viridis, ggthemes |
| Published: | 2018-10-06 |
| Author: | Joris Chau [aut, cre] |
| Maintainer: | Joris Chau <joris.chau at openanalytics.eu> |
| License: | GPL-2 |
| URL: | https://github.com/JorisChau/pdSpecEst, https://jchau.shinyapps.io/pdSpecEst/ |
| NeedsCompilation: | yes |
| SystemRequirements: | GNU make, C++11 |
| Materials: | README NEWS |
| CRAN checks: | pdSpecEst results |
| Reference manual: | pdSpecEst.pdf |
| Vignettes: |
"Data depth and rank-based tests for HPD matrices" "Wavelet-based multivariate Fourier spectral estimation" |
| Package source: | pdSpecEst_1.2.3.tar.gz |
| Windows binaries: | r-devel: pdSpecEst_1.2.3.zip, r-release: pdSpecEst_1.2.3.zip, r-oldrel: pdSpecEst_1.2.3.zip |
| OS X binaries: | r-release: pdSpecEst_1.2.3.tgz, r-oldrel: pdSpecEst_1.2.3.tgz |
| Old sources: | pdSpecEst archive |
Please use the canonical form https://CRAN.R-project.org/package=pdSpecEst to link to this page.


{% extends "base.html" %} {% block content %}
Get quick-cooking recipes for baked, grilled, broiled, or steamed salmon.
Move over, banana bread: it's zucchini season. Browse more than 135 ways to make it.
Chicken breast pieces make piccata, marsala, and schnitzel easy to cook.
Recipe Name: Roasted beetroot & goat's cheese salad
Recipe Origin: Australia
Category: Vegeterian


{{ $ctrl.selectedAddress.oneLiner }}
Filter: Unset Bounds Watch Ally Condo Ally HOA Ally Current Site All Include Address Markers
({{ address.polyType }}) {{ address.oneLiner }}


| Version: | 3.4 |
|---|---|
| Date: | 2017-11-08 |
| Summary: | high-level FTP client library for Python |
| Keywords: | FTP, ftplib substitute, virtual filesystem, pure Python |
| Author: | Stefan Schwarzer<EMAIL_ADDRESS>|
Contents
The ftputil module is a high-level interface to the ftplib module. The FTPHost objects generated from it allow many operations similar to those of os, os.path and shutil.
Example:
import ftputil # Download some files from the login directory. with ftputil.FTPHost("ftp.domain.com", "user", "password") as ftp_host: names = ftp_host.listdir(ftp_host.curdir) for name in names: if ftp_host.path.isfile(name): ftp_host.download(name, name) # remote, local # Make a new directory and copy a remote file into it. ftp_host.mkdir("newdir") with ftp_host.open("index.html", "rb") as source: with ftp_host.open("newdir/index.html", "wb") as target: ftp_host.copyfileobj(source, target) # similar to shutil.copyfileobj
Also, there are FTPHost.lstat and FTPHost.stat to request size and modification time of a file. The latter can also follow links, similar to os.stat. FTPHost.walk and FTPHost.path.walk work, too.
The exceptions are in the namespace of the ftputil.error module, e. g. ftputil.error.TemporaryError.
The exception classes are organized as follows:
FTPError FTPOSError(FTPError, OSError) PermanentError(FTPOSError) CommandNotImplementedError(PermanentError) TemporaryError(FTPOSError) FTPIOError(FTPError) InternalError(FTPError) InaccessibleLoginDirError(InternalError) ParserError(InternalError) RootDirError(InternalError) TimeShiftError(InternalError)
and are described here:
FTPError
is the root of the exception hierarchy of the module.
FTPOSError
is derived from OSError. This is for similarity between the os module and FTPHost objects. Compare
try: os.chdir("nonexisting_directory") except OSError: ...
with
host = ftputil.FTPHost("host", "user", "password") try: host.chdir("nonexisting_directory") except OSError: ...
Imagine a function
def func(path, file): ...
which works on the local file system and catches OSErrors. If you change the parameter list to
def func(path, file, os=os): ...
where os denotes the os module, you can call the function also as
host = ftputil.FTPHost("host", "user", "password") func(path, file, os=host)
to use the same code for both a local and remote file system. Another similarity between OSError and FTPOSError is that the latter holds the FTP server return code in the errno attribute of the exception object and the error text in strerror.
PermanentError
is raised for 5xx return codes from the FTP server. This corresponds to ftplib.error_perm (though PermanentError and ftplib.error_perm are not identical).
CommandNotImplementedError
indicates that an underlying command the code tries to use is not implemented. For an example, see the description of the FTPHost.chmod method.
TemporaryError
is raised for FTP return codes from the 4xx category. This corresponds to ftplib.error_temp (though TemporaryError and ftplib.error_temp are not identical).
FTPIOError
denotes an I/O error on the remote host. This appears mainly with file-like objects that are retrieved by calling FTPHost.open. Compare
>>> try: ... f = open("not_there") ... except IOError as obj: ... print obj.errno ... print obj.strerror ... 2 No such file or directory
with
>>> ftp_host = ftputil.FTPHost("host", "user", "password") >>> try: ... f = ftp_host.open("not_there") ... except IOError as obj: ... print obj.errno ... print obj.strerror ... 550 550 not_there: No such file or directory.
As you can see, both code snippets are similar. However, the error codes aren't the same.
InternalError
subsumes exception classes for signaling errors due to limitations of the FTP protocol or the concrete implementation of ftputil.
InaccessibleLoginDirError
This exception is raised if the directory in which "you" are placed upon login is not accessible, i. e. a chdir call with the directory as argument would fail.
ParserError
is used for errors during the parsing of directory listings from the server. This exception is used by the FTPHost methods stat, lstat, and listdir.
RootDirError
Because of the implementation of the lstat method it is not possible to do a stat call on the root directory /. If you know any way to do it, please let me know. :-)
This problem does not affect stat calls on items in the root directory.
TimeShiftError
is used to denote errors which relate to setting the time shift.
Note
Keep in mind that this section only applies to directory and file names, not file contents. Encoding and decoding for file contents is handled by the encoding argument for FTPHost.open.
First off: If your directory and file names (both as arguments and on the server) contain only ISO 8859-1 (latin-1) characters, you can use such names in the form of byte strings or unicode strings. However, you can't mix different string types (bytes and unicode) in one call (for example in FTPHost.path.join).
If you have directory or file names with characters that aren't in latin-1, it's recommended to use byte strings. In that case, returned paths will be byte strings, too.
Read on for details.
Note
The approach described below may look awkward and in a way it is. The intention of ftputil is to behave like the local file system APIs of Python 3 as far as it makes sense. Moreover, the taken approach makes sure that directory and file names that were used with Python 3's native ftplib module will be compatible with ftputil and vice versa. Otherwise you may be able to use a file name with ftputil, but get an exception when trying to read the same file with Python 3's ftplib module.
Methods that take names of directories and/or files can take either byte or unicode strings. If a method got a string argument and returns one or more strings, these strings will have the same string type as the argument(s). Mixing different string arguments in one call (for example in FTPHost.path.join) isn't allowed and will cause a TypeError. These rules are the same as for local file system operations in Python 3. Since ftputil uses the same API for Python 2, ftputil will do the same when run on Python 2.
Byte strings for directory and file names will be sent to the server as-is. On the other hand, unicode strings will be encoded to byte strings, assuming latin-1 encoding. This implies that such unicode strings must only contain code points 0-255 for the latin-1 character set. Using any other characters will result in a UnicodeEncodeError exception.
If you have directory or file names as unicode strings with non-latin-1 characters, encode the unicode strings to byte strings yourself, using the encoding you know the server uses. Decode received paths with the same encoding. Encapsulate these conversions as far as you can. Otherwise, you'd have to adapt potentially a lot of code if the server encoding changes.
If you don't know the encoding on the server side, it's probably the best to only use byte strings for directory and file names. That said, as soon as you show the names to a user, you -- or the library you use for displaying the names -- has to guess an encoding.
FTPHost instances can be created with the following call:
ftp_host = ftputil.FTPHost(server, user, password, account, session_factory=ftplib.FTP)
The first four parameters are strings with the same meaning as for the FTP class in the ftplib module. Usually the account and session_factory arguments aren't needed though.
FTPHost objects can also be used in a with statement:
import ftputil with ftputil.FTPHost(server, user, password) as ftp_host: print ftp_host.listdir(ftp_host.curdir)
After the with block, the FTPHost instance and the associated FTP sessions will be closed automatically.
If something goes wrong during the FTPHost construction or in the body of the with statement, the instance is closed as well. Exceptions will be propagated (as with try ... finally).
The keyword argument session_factory may be used to generate FTP connections with other factories than the default ftplib.FTP. For example, the standard library of Python 2.7 contains a class ftplib.FTP_TLS which extends ftplib.FTP to use an encrypted connection.
In fact, all positional and keyword arguments other than session_factory are passed to the factory to generate a new background session. This also happens for every remote file that is opened; see below.
This functionality of the constructor also allows to wrap ftplib.FTP objects to do something that wouldn't be possible with the ftplib.FTP constructor alone.
As an example, assume you want to connect to another than the default port, but ftplib.FTP only offers this by means of its connect method, not via its constructor. One solution is to use a custom class as a session factory:
import ftplib import ftputil EXAMPLE_PORT = 50001 class MySession(ftplib.FTP): def __init__(self, host, userid, password, port): """Act like ftplib.FTP's constructor but connect to another port.""" ftplib.FTP.__init__(self) self.connect(host, port) self.login(userid, password) # Try _not_ to use an _instance_ `MySession()` as factory, - # use the class itself. with ftputil.FTPHost(host, userid, password, port=EXAMPLE_PORT, session_factory=MySession) as ftp_host: # Use `ftp_host` as usual. ...
On login, the format of the directory listings (needed for stat'ing files and directories) should be determined automatically. If not, please file a bug report.
For the most common uses you don't need to create your own session factory class though. The ftputil.session module has a function session_factory that can create session factories for a variety of parameters:
session_factory(base_class=ftplib.FTP, port=21, use_passive_mode=None, encrypt_data_channel=True, debug_level=None)
with
All of these parameters can be combined. For example, you could use
import ftplib import ftputil import ftputil.session my_session_factory = ftputil.session.session_factory( base_class=ftpslib.FTP_TLS, port=31, encrypt_data_channel=True, debug_level=2) with ftputil.FTPHost(server, user, password, session_factory=my_session_factory) as ftp_host: ...
to create and use a session factory derived from ftplib.FTP_TLS that connects on command channel 31, will encrypt the data channel and print output for debug level 2.
Note: Generally, you can achieve everything you can do with ftputil.session.session_factory with an explicit session factory as described at the start of this section. However, the class M2Crypto.ftpslib.FTP_TLS has a limitation so that you can't use it with ftputil out of the box. The function session_factory contains a workaround for this limitation. For details refer to this bug report.
curdir, pardir, sep
are strings which denote the current and the parent directory on the remote server. sep holds the path separator. Though RFC 959 (File Transfer Protocol) notes that these values may depend on the FTP server implementation, the Unix variants seem to work well in practice, even for non-Unix servers.
Nevertheless, it's recommended that you don't hardcode these values for remote paths, but use FTPHost.path as you would use os.path to write platform-independent Python code for local filesystems. Keep in mind that most, but not all, arguments of FTPHost methods refer to remote directories or files. For example, in FTPHost.upload, the first argument is a local path and the second a remote path. Both of these should use their respective path separators.
upload(source, target, callback=None)
copies a local source file (given by a filename, i. e. a string) to the remote host under the name target. Both source and target may be absolute paths or relative to their corresponding current directory (on the local or the remote host, respectively).
The file content is always transferred in binary mode.
The callback, if given, will be invoked for each transferred chunk of data:
callback(chunk)
where chunk is a bytestring. An example usage of a callback method is to display a progress indicator.
download(source, target, callback=None)
performs a download from the remote source file to a local target file. Both source and target are strings. See the description of upload for more details.
upload_if_newer(source, target, callback=None)
is similar to the upload method. The only difference is that the upload is only invoked if the time of the last modification for the source file is more recent than that of the target file or the target doesn't exist at all. The check for the last modification time considers the precision of the timestamps and transfers a file "if in doubt". Consequently the code
ftp_host.upload_if_newer("source_file", "target_file") time.sleep(10) ftp_host.upload_if_newer("source_file", "target_file")
might upload the file again if the timestamp of the target file is precise up to a minute, which is typically the case because the remote datetime is determined by parsing a directory listing from the server. To avoid unnecessary transfers, wait at least a minute between calls of upload_if_newer for the same file. If it still seems that a file is uploaded unnecessarily (or not when it should), read the subsection on time shift settings.
If an upload actually happened, the return value of upload_if_newer is a True, else False.
Note that the method only checks the existence and/or the modification time of the source and target file; it doesn't compare any other file properties, say, the file size.
This also means that if a transfer is interrupted, the remote file will have a newer modification time than the local file, and thus the transfer won't be repeated if upload_if_newer is used a second time. There are at least two possibilities after a failed upload:
download_if_newer(source, target, callback=None)
corresponds to upload_if_newer but performs a download from the server to the local host. Read the descriptions of download and upload_if_newer for more information. If a download actually happened, the return value is True, else False.
If the client where ftputil runs and the server have a different understanding of their local times, this has to be taken into account for upload_if_newer and download_if_newer to work correctly.
Note that even if the client and the server are in the same time zone (or even on the same computer), the time shift value (see below) may be different from zero. For example, my computer is set to use local time whereas the server running on the very same host insists on using UTC time.
set_time_shift(time_shift)
sets the so-called time shift value, measured in seconds. The time shift is the difference between the local time of the server and the local time of the client at a given moment, i. e. by definition
time_shift = server_time - client_time
Setting this value is important for upload_if_newer and download_if_newer to work correctly even if the time zone of the FTP server differs from that of the client. Note that the time shift value can be negative.
If the time shift value is invalid, for example its absolute value is larger than 24 hours, a TimeShiftError is raised.
See also synchronize_times for a way to set the time shift with a simple method call.
time_shift()
returns the currently-set time shift value. See set_time_shift above for its definition.
synchronize_times()
synchronizes the local times of the server and the client, so that upload_if_newer and download_if_newer work as expected, even if the client and the server use different time zones. For this to work, all of the following conditions must be true:
If you can't fulfill these conditions, you can nevertheless set the time shift value explicitly with set_time_shift. Trying to call synchronize_times if the above conditions aren't met results in a TimeShiftError exception.
mkdir(path, [mode])
makes the given directory on the remote host. This does not construct "intermediate" directories that don't already exist. The mode parameter is ignored; this is for compatibility with os.mkdir if an FTPHost object is passed into a function instead of the os module. See the explanation in the subsection Exception hierarchy.
makedirs(path, [mode])
works similar to mkdir (see above), but also makes intermediate directories like os.makedirs. The mode parameter is only there for compatibility with os.makedirs and is ignored.
rmdir(path)
removes the given remote directory. If it's not empty, raise a PermanentError.
rmtree(path, ignore_errors=False, onerror=None)
removes the given remote, possibly non-empty, directory tree. The interface of this method is rather complex, in favor of compatibility with shutil.rmtree.
If ignore_errors is set to a true value, errors are ignored. If ignore_errors is a false value and onerror isn't set, all exceptions occurring during the tree iteration and processing are raised. These exceptions are all of type PermanentError.
To distinguish between different kinds of errors, pass in a callable for onerror. This callable must accept three arguments: func, path and exc_info. func is a bound method object, for example your_host_object.listdir. path is the path that was the recent argument of the respective method (listdir, remove, rmdir). exc_info is the exception info as it is gotten from sys.exc_info.
The code of rmtree is taken from Python's shutil module and adapted for ftputil.
remove(path)
removes a file or link on the remote host, similar to os.remove.
unlink(path)
is an alias for remove.
listdir(path)
returns a list containing the names of the files and directories in the given path, similar to os.listdir. The special names . and .. are not in the list.
The methods lstat and stat (and some others) rely on the directory listing format used by the FTP server. When connecting to a host, FTPHost's constructor tries to guess the right format, which succeeds in most cases. However, if you get strange results or ParserError exceptions by a mere lstat call, please file a bug report.
If lstat or stat give wrong modification dates or times, look at the methods that deal with time zone differences (time zone correction).
lstat(path)
returns an object similar to that from os.lstat. This is a "tuple" with additional attributes; see the documentation of the os module for details.
The result is derived by parsing the output of a LIST command on the server. Therefore, the result from FTPHost.lstat can not contain more information than the received text. In particular:
User and group ids can only be determined as strings, not as numbers, and that only if the server supplies them. This is usually the case with Unix servers but maybe not for other FTP server programs.
Values for the time of the last modification may be rough, depending on the information from the server. For timestamps older than a year, this usually means that the precision of the modification timestamp value is not better than days. For newer files, the information may be accurate to a minute.
If the time of the last modification is before the epoch (usually 1970-01-01 UTC), set the time of the last modification to 0.0.
Links can only be recognized on servers that provide this information in the LIST output.
None. For example, a line of a directory listing may not contain the date/time of a directory's last modification.
There's a special problem with stat'ing the root directory. (Stat'ing things in the root directory is fine though.) In this case, a RootDirError is raised. This has to do with the algorithm used by (l)stat, and I know of no approach which mends this problem.
Currently, ftputil recognizes the common Unix-style and Microsoft/DOS-style directory formats. If you need to parse output from another server type, please write to the ftputil mailing list. You may consider writing your own parser.
stat(path)
returns stat information also for files which are pointed to by a link. This method follows multiple links until a regular file or directory is found. If an infinite link chain is encountered or the target of the last link in the chain doesn't exist, a PermanentError is raised.
The limitations of the lstat method also apply to stat.
FTPHost objects contain an attribute named path, similar to os.path. The following methods can be applied to the remote host with the same semantics as for os.path:
abspath(path) basename(path) commonprefix(path_list) dirname(path) exists(path) getmtime(path) getsize(path) isabs(path) isdir(path) isfile(path) islink(path) join(path1, path2, ...) normcase(path) normpath(path) split(path) splitdrive(path) splitext(path) walk(path, func, arg)
Like Python's counterparts under os.path, ftputil's is... methods return False if they can't find the path given by their argument.
Many of the above methods need access to the remote file system to obtain data on directories and files. To get the most recent data, each call to lstat, stat, exists, getmtime etc. would require to fetch a directory listing from the server, which can make the program very slow. This effect is more pronounced for operations which mostly scan the file system rather than transferring file data.
For this reason, ftputil by default saves the results from directory listings locally and reuses those results. This reduces network accesses and so speeds up the software a lot. However, since data is more rarely fetched from the server, the risk of obsolete data also increases. This will be discussed below.
Caching can be controlled -- if necessary at all -- via the stat_cache object in an FTPHost's namespace. For example, after calling
ftp_host = ftputil.FTPHost(host, user, password)
the cache can be accessed as ftp_host.stat_cache.
While ftputil usually manages the cache quite well, there are two possible reasons for modifying cache parameters.
The first is when the number of possible entries is too low. You may notice that when you are processing very large directories and the program becomes much slower than before. It's common for code to read a directory with listdir and then process the found directories and files. This can also happen implicitly by a call to FTPHost.walk. Since version 2.6 ftputil automatically increases the cache size if directories with more entries than the current maximum cache size are to be scanned. Most of the time, this works fine.
However, if you need access to stat data for several directories at the same time, you may need to increase the cache explicitly. This is done by the resize method:
ftp_host.stat_cache.resize(20000)
where the argument is the maximum number of lstat results to store (the default is 5000, in versions before 2.6 it was 1000). Note that each path on the server, e. g. "/home/schwa/some_dir", corresponds to a single cache entry. Methods like exists or getmtime all derive their results from a previously fetched lstat result.
The value 5000 above means that the cache will hold at most 5000 entries (unless increased automatically by an explicit or implicit listdir call, see above). If more are about to be stored, the entries which haven't been used for the longest time will be deleted to make place for newer entries.
The second possible reason to change the cache parameters is to avoid stale cache data. Caching is so effective because it reduces network accesses. This can also be a disadvantage if the file system data on the remote server changes after a stat result has been retrieved; the client, when looking at the cached stat data, will use obsolete information.
There are two potential ways to get such out-of-date stat data. The first happens when an FTPHost instance modifies a file path for which it has a cache entry, e. g. by calling remove or rmdir. Such changes are handled transparently; the path will be deleted from the cache. A different matter are changes unknown to the FTPHost object which inspects its cache. Obviously, for example, these are changes by programs running on the remote host. On the other hand, cache inconsistencies can also occur if two FTPHost objects change a file system simultaneously:
with ( ftputil.FTPHost(server, user1, password1) as ftp_host1, ftputil.FTPHost(server, user1, password1) as ftp_host2 ): stat_result1 = ftp_host1.stat("some_file") stat_result2 = ftp_host2.stat("some_file") ftp_host2.remove("some_file") # `ftp_host1` will still see the obsolete cache entry! print ftp_host1.stat("some_file") # Will raise an exception since an `FTPHost` object # knows of its own changes. print ftp_host2.stat("some_file")
At first sight, it may appear to be a good idea to have a shared cache among several FTPHost objects. After some thinking, this turns out to be very error-prone. For example, it won't help with different processes using ftputil. So, if you have to deal with concurrent write/read accesses to a server, you have to handle them explicitly.
The most useful tool for this is the invalidate method. In the example above, it could be used like this:
with ( ftputil.FTPHost(server, user1, password1) as ftp_host1, ftputil.FTPHost(server, user1, password1) as ftp_host2 ): stat_result1 = ftp_host1.stat("some_file") stat_result2 = ftp_host2.stat("some_file") ftp_host2.remove("some_file") # Invalidate using an absolute path. absolute_path = ftp_host1.path.abspath( ftp_host1.path.join(ftp_host1.getcwd(), "some_file")) ftp_host1.stat_cache.invalidate(absolute_path) # Will now raise an exception as it should. print ftp_host1.stat("some_file") # Would raise an exception since an `FTPHost` object # knows of its own changes, even without `invalidate`. print ftp_host2.stat("some_file")
The method invalidate can be used on any absolute path, be it a directory, a file or a link.
By default, the cache entries (if not replaced by newer ones) are stored for an infinite time. That is, if you start your Python process using ftputil and let it run for three days a stat call may still access cache data that old. To avoid this, you can set the max_age attribute:
with ftputil.FTPHost(server, user, password) as ftp_host: ftp_host.stat_cache.max_age = 60 * 60 # = 3600 seconds
This sets the maximum age of entries in the cache to an hour. This means any entry older won't be retrieved from the cache but its data instead fetched again from the remote host and then again stored for up to an hour. To reset max_age to the default of unlimited age, i. e. cache entries never expire, use None as value.
If you are certain that the cache will be in the way, you can disable and later re-enable it completely with disable and enable:
with ftputil.FTPHost(server, user, password) as ftp_host: ftp_host.stat_cache.disable() ... ftp_host.stat_cache.enable()
During that time, the cache won't be used; all data will be fetched from the network. After enabling the cache again, its entries will be the same as when the cache was disabled, that is, entries won't get updated with newer data during this period. Note that even when the cache is disabled, the file system data in the code can become inconsistent:
with ftputil.FTPHost(server, user, password) as ftp_host: ftp_host.stat_cache.disable() if ftp_host.path.exists("some_file"): mtime = ftp_host.path.getmtime("some_file")
In that case, the file some_file may have been removed by another process between the calls to exists and getmtime!
walk(top, topdown=True, onerror=None, followlinks=False)
iterates over a directory tree, similar to os.walk. Actually, FTPHost.walk uses the code from Python with just the necessary modifications, so see the linked documentation.
path.walk(path, func, arg)
Similar to os.path.walk, the walk method in FTPHost.path can be used, though FTPHost.walk is probably easier to use.
close()
closes the connection to the remote host. After this, no more interaction with the FTP server is possible with this FTPHost object. Usually you don't need to close an FTPHost instance with close if you set up the instance in a with statement.
rename(source, target)
renames the source file (or directory) on the FTP server.
chmod(path, mode)
sets the access mode (permission flags) for the given path. The mode is an integer as returned for the mode by the stat and lstat methods. Be careful: Usually, mode values are written as octal numbers, for example 0755 to make a directory readable and writable for the owner, but not writable for the group and others. If you want to use such octal values, rely on Python's support for them:
ftp_host.chmod("some_directory", 0o755)
Not all FTP servers support the chmod command. In case of an exception, how do you know if the path doesn't exist or if the command itself is invalid? If the FTP server complies with RFC 959, it should return a status code 502 if the SITE CHMOD command isn't allowed. ftputil maps this special error response to a CommandNotImplementedError which is derived from PermanentError.
So you need to code like this:
with ftputil.FTPHost(server, user, password) as ftp_host: try: ftp_host.chmod("some_file", 0o644) except ftputil.error.CommandNotImplementedError: # `chmod` not supported ... except ftputil.error.PermanentError: # Possibly a non-existent file ...
Because the CommandNotImplementedError is more specific, you have to test for it first.
copyfileobj(source, target, length=64*1024)
copies the contents from the file-like object source to the file-like object target. The only difference to shutil.copyfileobj is the default buffer size. Note that arbitrary file-like objects can be used as arguments (e. g. local files, remote FTP files).
However, the interfaces of source and target have to match; the string type read from source must be an accepted string type when written to target. For example, if you open source in Python 3 as a local text file and target as a remote file object in binary mode, the transfer will fail since source.read gives unicode strings whereas target.write only accepts byte strings.
See File-like objects for the construction and use of remote file-like objects.
set_parser(parser)
sets a custom parser for FTP directories. Note that you have to pass in a parser instance, not the class.
An extra section shows how to write own parsers if the default parsers in ftputil don't work for you.
keep_alive()
attempts to keep the connection to the remote server active in order to prevent timeouts from happening. This method is primarily intended to keep the underlying FTP connection of an FTPHost object alive while a file is uploaded or downloaded. This will require either an extra thread while the upload or download is in progress or calling keep_alive from a callback function.
The keep_alive method won't help if the connection has already timed out. In this case, a ftputil.error.TemporaryError is raised.
If you want to use this method, keep in mind that FTP servers define a timeout for a reason. A timeout prevents running out of server connections because of clients that never disconnect on their own.
Note that the keep_alive method does not affect the "hidden" FTP child connections established by FTPHost.open (see section FTPHost instances vs. FTP connections for details). You can't use keep_alive to avoid a timeout in a stalling transfer like this:
with ftputil.FTPHost(server, userid, password) as ftp_host: with ftp_host.open("some_remote_file", "rb") as fobj: data = fobj.read(100) # _Futile_ attempt to avoid file connection timeout. for i in xrange(15): time.sleep(60) ftp_host.keep_alive() # Will raise an `ftputil.error.TemporaryError`. data += fobj.read()
FTPFile objects are returned by a call to FTPHost.open; never use the FTPFile constructor directly.
The API of remote file-like objects are is modeled after the API of the io module in Python 3, which has also been backported to Python 2.6 and 2.7.
FTPHost.open(path, mode="r", buffering=None, encoding=None, errors=None, newline=None, rest=None)
returns a file-like object that refers to the path on the remote host. This path may be absolute or relative to the current directory on the remote host (this directory can be determined with the getcwd method). As with local file objects, the default mode is "r", i. e. reading text files. Valid modes are "r", "rb", "w", and "wb".
If a file is opened in binary mode, you must not specify an encoding. On the other hand, if you open a file in text mode, an encoding is used. By default, this is the return value of locale.getpreferredencoding, but you can (and probably should) specify a distinct encoding.
If you open a file in binary mode, the read and write operations use byte strings (str in Python 2, bytes in Python 3). That is, read operations return byte strings and write operations only accept byte strings.
Similarly, text files always work with unicode strings (unicode in Python 2, str in Python 3). Here, read operations return unicode strings and write operations only accept unicode strings.
Warning
Note that the semantics of "text mode" has changed fundamentally from ftputil 2.8 and earlier. Previously, "text mode" implied converting newline characters to \r\n when writing remote files and converting newlines to \n when reading remote files. This is in line with the "text mode" notion of FTP command line clients. Now, "text mode" follows the semantics in Python's io module.
The arguments errors and newline have the same semantics as in io.open. The argument buffering currently is ignored. It's only there for compatibility with the io.open interface.
If the file is opened in binary mode, you may pass 0 or a positive integer for the rest argument. The argument is passed to the underlying FTP session instance (for example an instance of ftplib.FTP) to start reading or writing at the given byte offset. For example, if a remote file contains the letters "abcdef" in ASCII encoding, rest=3 will start reading at "d".
Warning
If you pass rest values which point after the file, the behavior is undefined and may even differ from one FTP server to another. Therefore, use the rest argument only for error recovery in case of interrupted transfers. You need to keep track of the transferred data so that you can provide a valid rest argument for a resumed transfer.
FTPHost.open can also be used in a with statement:
import ftputil with ftputil.FTPHost(...) as ftp_host: ... with ftp_host.open("new_file", "w", encoding="utf8") as fobj: fobj.write("This is some text.")
At the end of the with block, the remote file will be closed automatically.
If something goes wrong during the construction of the file or in the body of the with statement, the file will be closed as well. Exceptions will be propagated as with try ... finally.
The methods
close() read([count]) readline([count]) readlines() write(data) writelines(string_sequence)
and the attribute closed have the same semantics as for file objects of a local disk file system. The iterator protocol is supported as well, i. e. you can use a loop to read a file line by line:
with ftputil.FTPHost(server, user, password) as ftp_host: with ftp_host.open("some_file") as input_file: for line in input_file: # Do something with the line, e. g. print line.strip().replace("ftplib", "ftputil")
For more on file objects, see the section File objects in the Python Library Reference.
This section explains why keeping an FTPHost instance "alive" without timing out sometimes isn't trivial. If you always finish your FTP operations in time, you don't need to read this section.
The file transfer protocol is a stateful protocol. That means an FTP connection always is in a certain state. Each of these states can only change to certain other states under certain conditions triggered by the client or the server.
One of the consequences is that a single FTP connection can't be used at the same time, say, to transfer data on the FTP data channel and to create a directory on the remote host.
For example, consider this:
>>> import ftplib >>> ftp = ftplib.FTP(server, user, password) >>> ftp.pwd() '/' >>> # Start transfer. `CONTENTS` is a text file on the server. >>> socket = ftp.transfercmd("RETR CONTENTS") >>> socket <socket._socketobject object at 0x7f801a6386e0> >>> ftp.pwd() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/ftplib.py", line 578, in pwd return parse257(resp) File "/usr/lib64/python2.7/ftplib.py", line 842, in parse257 raise error_reply, resp ftplib.error_reply: 226-File successfully transferred 226 0.000 seconds (measured here), 5.60 Mbytes per second >>>
Note that ftp is a single FTP connection, represented by an ftplib.FTP instance, not an ftputil.FTPHost instance.
On the other hand, consider this:
>>> import ftputil >>> ftp_host = ftputil.FTPHost(server, user, password) >>> ftp_host.getcwd() >>> fobj = ftp_host.open("CONTENTS") >>> fobj <ftputil.file.FTPFile object at 0x7f8019d3aa50> >>> ftp_host.getcwd() u'/' >>> fobj.readline() u'Contents of FTP test directory\n' >>> fobj.close() >>>
To be able to start a file transfer (i. e. open a remote file for reading or writing) and still be able to use other FTP commands, ftputil uses a trick. For every remote file, ftputil creates a new FTP connection, called a child connection in the ftputil source code. (Actually, FTP connections belonging to closed remote files are re-used if they haven't timed out yet.)
In most cases this approach isn't noticeable by code using ftputil. However, the nice abstraction of dealing with a single FTP connection falls apart if one of the child connections times out. For example, if you open a remote file and work only with the initial "main" connection to navigate the file system, the FTP connection for the remote file may eventually time out.
While it's often relatively easy to prevent the "main" connection from timing out it's unfortunately practically impossible to do this for a remote file connection (apart from transferring some data, of course). For this reason, FTPHost.keep_alive affects only the main connection. Child connections may still time out if they're idle for too long.
Some more details:
Bottom line: If you can, you should organize your FTP actions so that you finish everything before a timeout happens.
ftputil recognizes the two most widely-used FTP directory formats, Unix and MS style, and adjusts itself automatically. Almost every FTP server uses one of these formats.
However, if your server uses a format which is different from the two provided by ftputil, you can plug in a custom parser with a single method call and have ftputil use this parser.
For this, you need to write a parser class by inheriting from the class Parser in the ftputil.stat module. Here's an example:
import ftputil.error import ftputil.stat class XyzParser(ftputil.stat.Parser): """ Parse the default format of the FTP server of the XYZ corporation. """ def parse_line(self, line, time_shift=0.0): """ Parse a `line` from the directory listing and return a corresponding `StatResult` object. If the line can't be parsed, raise `ftputil.error.ParserError`. The `time_shift` argument can be used to fine-tune the parsing of dates and times. See the class `ftputil.stat.UnixParser` for an example. """ # Split the `line` argument and examine it further; if # something goes wrong, raise an `ftputil.error.ParserError`. ... # Make a `StatResult` object from the parts above. stat_result = ftputil.stat.StatResult(...) # `_st_name`, `_st_target` and `_st_mtime_precision` are optional. stat_result._st_name = ... stat_result._st_target = ... stat_result._st_mtime_precision = ... return stat_result # Define `ignores_line` only if the default in the base class # doesn't do enough! def ignores_line(self, line): """ Return a true value if the line should be ignored. For example, the implementation in the base class handles lines like "total 17". On the other hand, if the line should be used for stat'ing, return a false value. """ is_total_line = super(XyzParser, self).ignores_line(line) my_test = ... return is_total_line or my_test
A StatResult object is similar to the value returned by os.stat and is usually built with statements like
stat_result = StatResult( (st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime)) stat_result._st_name = ... stat_result._st_target = ... stat_result._st_mtime_precision = ...
with the arguments of the StatResult constructor described in the following table.
| Index | Attribute | os.stat type | StatResult type | Notes |
|---|---|---|---|---|
| 0 | st_mode | int | int | |
| 1 | st_ino | long | long | |
| 2 | st_dev | long | long | |
| 3 | st_nlink | int | int | |
| 4 | st_uid | int | str | usually only available as string |
| 5 | st_gid | int | str | usually only available as string |
| 6 | st_size | long | long | |
| 7 | st_atime | int/float | float | |
| 8 | st_mtime | int/float | float | |
| 9 | st_ctime | int/float | float | |
| - | _st_name | - | str | file name without directory part |
| - | _st_target | - | str | link target (may be absolute or relative) |
| - | _st_mtime_precision | - | int | st_mtime precision in seconds |
If you can't extract all the desirable data from a line (for example, the MS format doesn't contain any information about the owner of a file), set the corresponding values in the StatResult instance to None.
Parser classes can use several helper methods which are defined in the class Parser:
Additionally, there's an attribute _month_numbers which maps lowercase three-letter month abbreviations to integers.
For more details, see the two "standard" parsers UnixParser and MSParser in the module ftputil/stat.py.
To actually use the parser, call the method set_parser of the FTPHost instance.
If you can't write a parser or don't want to, please ask on the ftputil mailing list. Possibly someone has already written a parser for your server or can help with it.
See the download page. Announcements will be sent to the mailing list. Announcements on major updates will also be posted to the newsgroup comp.lang.python.announce .
Yes, please visit http://ftputil.sschwarzer.net/mailinglist to subscribe or read the archives.
Though you can technically post without subscribing first I can't recommend it: The mails from non-subscribers have to be approved by me and because the arriving mails contain lots of spam, I rarely go through these mails.
Before reporting a bug, make sure that you already read this manual and tried the latest version of ftputil. There the bug might have already been fixed.
Please see http://ftputil.sschwarzer.net/issuetrackernotes for guidelines on entering a bug in ftputil's ticket system. If you are unsure if the behaviour you found is a bug or not, you should write to the ftputil mailing list. In either case you must not include confidential information (user id, password, file names, etc.) in the problem report! Be careful!
ftputil has no built-in SSL/TLS support.
On the other hand, there are two ways to get TLS support with ftputil:
In Python 2.7 and Python 3.2 and up, the ftplib library has a class FTP_TLS that you can use for the session_factory keyword argument in the FTPHost constructor. You can't use the class directly though if you need additional setup code in comparison to ftplib.FTP, for example calling prot_p, to secure the data connection. On the other hand, ftputil.session.session_factory can be used to create a custom session factory.
If you have other requirements that session_factory can't fulfill, you may create your own session factory by inheriting from ftplib.FTP_TLS:
import ftplib import ftputil class FTPTLSSession(ftplib.FTP_TLS): def __init__(self, host, user, password): ftplib.FTP_TLS.__init__(self) self.connect(host, port) self.login(user, password) # Set up encrypted data connection. self.prot_p() ... # Note the `session_factory` parameter. Pass the class, not # an instance. with ftputil.FTPHost(server, user, password, session_factory=FTPTLSSession) as ftp_host: # Use `ftp_host` as usual. ...
If you need to work with Python 2.6, you can use the ftpslib.FTP_TLS class from the M2Crypto project. Again, you can't use the class directly but need to use ftputil.session.session_factory or a recipe similar to that above.
Unfortunately, M2Crypto.ftpslib.FTP_TLS (at least in version 0.22.3) doesn't work correctly if you pass unicode strings to its methods. Since ftputil does exactly that at some point (even if you used byte strings in ftputil calls) you need a workaround in the session factory class:
import M2Crypto import ftputil import ftputil.tool class M2CryptoSession(M2Crypto.ftpslib.FTP_TLS): def __init__(self, host, user, password): M2Crypto.ftpslib.FTP_TLS.__init__(self) # Change the port number if needed. self.connect(host, 21) self.auth_tls() self.login(user, password) self.prot_p() self._fix_socket() ... def _fix_socket(self): """ Change the socket object so that arguments to `sendall` are converted to byte strings before being used. """ original_sendall = self.sock.sendall # Bound method, therefore no `self` argument. def sendall(data): data = ftputil.tool.as_bytes(data) return original_sendall(data) self.sock.sendall = sendall # Note the `session_factory` parameter. Pass the class, not # an instance. with ftputil.FTPHost(server, user, password, session_factory=M2CryptoSession) as ftp_host: # Use `ftp_host` as usual. ...
That said, session_factory has this workaround built in, so normally you don't need to define the session factory yourself!
By default, an instantiated FTPHost object connects on the usual FTP port. If you have to use a different port, refer to the section Session factories.
Please see the section Session factories.
You can do this with a session factory. See Session factories.
If you want to change the debug level only temporarily after the connection is established, you can reach the session object as the _session attribute of the FTPHost instance and call _session.set_debuglevel. Note that the _session attribute should only be accessed for debugging. Calling arbitrary ftplib.FTP methods on the session object may cause bugs!
You may find that ftputil uploads or downloads files unnecessarily, or not when it should. This can happen when the FTP server is in a different time zone than the client on which ftputil runs. Please see the section on time zone correction. It may even be sufficient to call synchronize_times.
The FTP server you connect to may use a directory format that ftputil doesn't understand. You can either write and plug in an own parser or ask on the mailing list for help.
Like Python's counterparts under os.path, ftputil's methods return False if they can't find the given path.
Probably you used listdir on a directory and called is...() on the returned names. But if the argument for listdir wasn't the current directory, the paths won't be found and so all is...() variants will return False.
Please send an email with your problem report or question to the ftputil mailing list, and we'll see what we can do for you. :-)
If not overwritten via installation options, the ftputil files reside in the ftputil package. There's also documentation in reStructuredText and in HTML format. The locations of these files after installation is system-dependent.
The files test_*.py and mock_ftplib.py are for unit-testing. If you only use ftputil, i. e. don't modify it, you can delete these files.
ftputil is written by Stefan Schwarzer<EMAIL_ADDRESS>and contributors (see doc/contributors.txt).
The original lrucache module was written by Evan Prodromou<EMAIL_ADDRESS>Feedback is appreciated. :-)


Panel Revives Lawsuit Over Permits for Guest-Worker Spouses
by JACK RODGERSWASHINGTON (CN) — The D.C. Circuit on Friday reinstated tech workers’ challenge to a Homeland Security rule allowing the spouses of guest workers to apply for jobs, finding they face increased competition due to the rule.
The rule permits spouses of those with H-1B visas – which allow American employers to hire foreign workers in specialty occupations for a limited time – to obtain a job through separate documentation, an H-4 visa. Previously, partners of nonimmigrant H-1B visa holders could still apply for an H-4 visa to remain in the country with their spouse but were not authorized to work.
Save Jobs USA, an organization representing Southern California Edison computer workers, sued over the Department of Homeland Security rule, saying it increased the competition for jobs for U.S.-born workers in the tech field who already struggle to gain employment in the face of foreign workers.
A federal judge dismissed the case, finding that the group lacks standing because it did not prove the rule would hurt its members.
However, the D.C. Circuit reversed on Friday, ruling that Save Jobs USA has demonstrated increased competition exists because the rule gives visa holders an incentive to stay in the U.S.
Two members of the group were 15-year veterans in information technology until they were fired and replaced by H-1B visa holders. Another employee, a system analyst, was let go in favor of an H-1B visa worker, after 20 years of service, according to the opinion written by U.S. Circuit Judge David Tatel.
“The Department insists that any injury to Save Jobs is caused by the H-1B visa program, not by the rule. We disagree,” the Bill Clinton appointee wrote. “Save Jobs has shown that the rule will cause more H-1B visa holders to remain in the United States than otherwise would—an effect that is distinct from that of the H-1B visa holders’ initial admission to the country.”
During oral argument, the Department of Homeland Security claimed that no person with an H-1B visa would compete with the tech employees because would first have to be offered a job that no American worker could fill. But the three-judge panel rejected that argument as well.
“The rule, as well as the Department’s own briefing here and before the district court, explains that for H-1B visa holders’ spouses to qualify for employment authorization, the H-1B visa holders need only be the beneficiaries of pending labor certification applications,” Tatel wrote. “While the application remains pending H-1B visa holders compete in the labor market against Save Jobs’ members. Even more, after the labor certification is issued, in certain circumstances H–1B visa holders may change jobs without obtaining new certifications.”
The panel found that the tech workers have standing to bring the case and send it back to the lower court to rule on the merits.
Tatel was joined on the panel by U.S. Circuit Judges Thomas Griffith, a George W. Bush appointee, and Laurence Silberman, appointed by Ronald Reagan.
John Miano, an attorney representing Save Jobs USA, said in an interview Friday that he doesn’t think the organization’s arguments will change as the case heads back to district court. He said the group will continue to ask for a decision on merits of the rule.
“It’s what we expected would occur, the court had said that we weren’t going to be able to argue the merits so we knew [the ruling] wouldn’t decide the merits,” Miano said. “The standing precedent here was well established. All the members of the panel had written opinions supporting us previously.”
Miano said he’s worked at a few companies that have been affected by H-1B visa workers vying for the same positions as American workers but left the company for law school before being adversely affected.
“I was a computer programmer before, so I saw all this garbage that plaintiffs went through,” he said.
A Department of Justice attorney did not respond Friday to an email request for comment.
Copyright © 2019 courthousenews.com


AniTrans
Your tour overview
Today
This week
Upcoming tours
Past tours
From
To
,
,
Start:
Contact Person:
Species:
Amount:
Estimated Time:
h
Time Frame:
Truck Type:
Tour State:
Comment:
Finish
Mark as unsuccessful


A Passionate, Creative, and Devoted
Personal Blog Design and development with Bootstrap, jQuery and Django Framework.
A data engineering project for data extract, preprocessing, data analysis and visualization.
Develop Financial Big Data Application from indices analysis to financial report .
Online Curriculum Vitae to practise my web Front-End skills.
Major in Software Engineering
Research topic related about Robot intelligence and Data Science
Major in Microelectronic
July 2011 - May 2013
Related technology: Process management, Data Analysis skills
July 2017 - Sep 2017
Related technology: Bootstrap, jQuery, Three.js
Nov 2017 - Feb 2018
Related technology: Data Science, Email automation
July 2019 - Apr 2021
Related technology: Java, Spring, Database, data engineering
May 2021 - now
Related technology: RPA
In ChongQing, From May 2021
RPA, python, java, inner components development, and etc.


Man wins $50K on Powerball ticket he thought was worth $4
by Wade SheridanNov. 13 (UPI) -- James Rogers of Wisconsin became the $50,000 Powerball winner after he re-checked his lottery ticket over a week later.
Rogers did not realize he had the winning ticket when the numbers were announced on Oct. 30. He originally thought that his ticket was only worth $4.
Rogers looked at his numbers again after he was told that the winning ticket was sold in Green Bay.
"Don't throw your tickets away," Rogers said as he offered advice to other lottery players.
The odds of winning the $50,000 Powerball prize is 1 in 913,130.
Rogers is not the first lottery winner to almost miss out on getting a cash prize as a Maryland woman recently left behind her winning ticket of $12,327 at the store due to her excitement.
(0) Leave a comment
upi.com/6957801
Latest Headlines
Odd News // 16 hours ago
Firefighters save man's house, apologize for drinking his milk
Nov. 13 (UPI) -- Firefighters in Australia have gained attention for leaving a note apologizing for drinking a man's milk after they saved his house from a wildfire.
Odd News // 17 hours ago
Man to attempt human flight suit record on Guinness World Record Day
Nov. 13 (UPI) -- Richard Browning will be attempting to break his record for the fastest speed in a body controlled jet engine powered suit on Guinness World Records Day.
Odd News // 19 hours ago
Escaped emu returned to owner in British town
Nov. 13 (UPI) -- An escaped emu who was on the run in Camrose, Pembrokeshire, has been returned to its owner Mark Boulcott of Herbrandston & Narberth Dental Health Practices.
Odd News // 1 day ago
New York family helps trapped deer escape from covered pool
Nov. 12 (UPI) -- A New York family came to the rescue of a deer that fell into a large backyard pool and got stuck under the cover.
Odd News // 1 day ago
Fireball lights night sky over Missouri, Midwest
Nov. 12 (UPI) -- A fireball that lit up the night sky over St. Louis, Mo., was likely debris from the South Taurids meteor shower, experts said.
Odd News // 1 day ago
Coyote with plastic tub stuck on head rescued in Ontario
Nov. 12 (UPI) -- A coyote that had been wandering for several days with its head stuck inside a plastic tub was rescued by authorities in Ontario.
Odd News // 1 day ago
Maryland man collects second big lottery prize in two years
Nov. 12 (UPI) -- A Maryland Lottery player followed up a big win two years ago with a $50,000 jackpot from a scratch-off ticket.
Odd News // 1 day ago
Job posting offers $1,000 to shop local for the holidays
Nov. 12 (UPI) -- A small business services website posting a job opening for someone seeking to make $1,000 by doing all of their holiday shopping locally.
Odd News // 1 day ago
335-foot-long carnitas taco breaks Guinness record in Mexico
Nov. 12 (UPI) -- A Mexican state captured a Guinness World Record by cooking up a carnitas taco measuring 335 feet long.
Odd News // 1 day ago
Owner warns of emu on the loose in British town
Nov. 12 (UPI) -- A British business owner is asking neighbors to keep an eye out for an emu that escaped from a field where five more of the Australian birds live.


.
LingSync OnlineFor entering data |
LingSync
|
We are encouraging all new users to use the LingSync Online app, which has a much more streamlined layout for data entry.
IF you are used to using the Prototype app you can close this window and use the LingSync Prototype behind. As always, both apps are updated every two weeks. See http://lingsync.org for tutorials and more information, feel free to contact us at<EMAIL_ADDRESS>for support questions, and<EMAIL_ADDRESS>for general questions.
Welcome to the new "desktop" look and feel!


HARD 8 A film review by Ben Hoffman Copyright 1997 Ben Hoffman
HARD 8 is so perfect in every respect, it is hard to know where to begin. Let us start with the writing by Paul Thomas Anderson.. There is not a word in the entire film's dialog that should be changed. Every word has meaning; every word carries with it questions that are raised as the story progresses. I cannot recall when last I saw a movie with dialog as well written. . . and delivered.
Then there is the acting. The film has a superb cast starting with "Sydney," (Philip Baker Hall who one would hope will be remembered when Best Actors are being nominated for 1997 films.) What about the direction, also by Anderson? And the editing by Barbara Tulliver of this very taut story that feels as if at any moment something will snap and you hope it will not.
 That is John (John C Reilly). Sydney asks John if he would like a cup of coffee. John asks for a cigarette and follows Sydney into the cafe. Sydney asks John if he has any money. The answer is that he does not; he lost it playing blackjack. Sydney asks John if he knows how to count cards while playing blackjack. No, he does not. Sydney tells him only a fool would play blackjack if he did not know how to count the cards. Sydney then offers to take him to Reno and teach him how to win. And so they are off and, in fact, John does very well.
The film moves two years forward. We meet Clementine (Gwyneth Paltrow), cocktail waitress and part-time prostitute. We also meet Jimmy (Samuel L Jackson) who is a scummy security guard at a casino who tries his hand at blackmailing Sydney on whom he has some unsavory dirt.
Throw all that together and HARD 8 is an absolute gem, a perfect illustration of how to do nail-biting film noir. Do not miss this one.
Written and directed by Paul Thomas Anderson.
4 BYTES
4 Bytes = Superb 3 Bytes = Too good to miss 2 Bytes = Average 1 Byte = Save your money
Ben Hoffman
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Bijou.js is made to be easy to use for both JS beginners and experts alike!
_$.copy("Hello world!");
Bijou.js is constantly expanding and is chock-full of useful stuff!
window.location.hash = _$.uuid();
Bijou.js is easy to use both in the browser and in NodeJS!
const _$ = require("bijou.js")
Bijou.js is updated almost every day! We welcome new feature suggestions and any bugs you find!


I am passionate about developing and playing games, as they have both been a focus of mine for many years in order to develop a career in the industry. During this time I have developed many projects which can be seen below, displaying the use of the unity engine, with projects written in C# and C++.
Proficient in:
Knowledge of:
Experience in using tools such as Git and Subversion for version control, Trello for project management/task allocation and Microsoft Visual Studio/Visual Studio Code as an IDE.