Merge branch 'master' of toki-labs.com:/Volumes/Data2/git/dart_framework
This commit is contained in:
commit
811ffa9f6a
8 changed files with 14 additions and 17 deletions
|
|
@ -1,6 +1,4 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:dart_framework/log/log.dart';
|
||||
import 'package:dart_framework/subtitle/parser_smi.dart';
|
||||
import 'package:dart_framework/subtitle/parser_srt.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class AppDataManager {
|
|||
var shell = StringBuffer();
|
||||
shell.writeln('git rev-parse HEAD');
|
||||
var process =
|
||||
await ProcessExecutor.start(shell, workspace: this._workspace);
|
||||
await ProcessExecutor.start(shell, workspace: _workspace);
|
||||
await process.process.exitCode;
|
||||
var hash = process.stdoutArr.last;
|
||||
print('#### Git Hash: $hash');
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class ProcessData {
|
|||
}
|
||||
|
||||
void checkExit() async {
|
||||
exitCode = await this.process.exitCode;
|
||||
exitCode = await process.exitCode;
|
||||
print('#### Exit Code: $exitCode');
|
||||
deleteFile();
|
||||
isRunning = false;
|
||||
|
|
@ -248,7 +248,7 @@ class NetStatData {
|
|||
break;
|
||||
case 4:
|
||||
var value = int.tryParse(category);
|
||||
if (value == null) value = -1;
|
||||
value ??= -1;
|
||||
pid = value;
|
||||
break;
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ Future<List<NetStatData>> findNetStat(String searchWord) async {
|
|||
item = item.replaceAll(returnPattern, '');
|
||||
if (item.isNotEmpty) {
|
||||
var categories = item.split(' ');
|
||||
if (categories.length > 0) {
|
||||
if (categories.isNotEmpty) {
|
||||
netList.add(NetStatData(categories));
|
||||
}
|
||||
}
|
||||
|
|
@ -406,7 +406,7 @@ class ProcessInfoListener {
|
|||
late ProcessInfo? _process;
|
||||
bool isRunning = false;
|
||||
late Timer? _timer;
|
||||
late int _checkInterval;
|
||||
late final int _checkInterval;
|
||||
late Function(ProcessInfoListener, bool)? _connectionListener;
|
||||
set _isRunning(bool value) {
|
||||
if (isRunning != value) {
|
||||
|
|
@ -416,7 +416,7 @@ class ProcessInfoListener {
|
|||
}
|
||||
|
||||
ProcessInfoListener(this._process, this._checkInterval) {
|
||||
this.checkLive();
|
||||
checkLive();
|
||||
}
|
||||
|
||||
void checkLive() async {
|
||||
|
|
@ -429,7 +429,7 @@ class ProcessInfoListener {
|
|||
if (list.isNotEmpty) {
|
||||
print('process live');
|
||||
enable = true;
|
||||
this._isRunning = true;
|
||||
_isRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ class ProcessInfoListener {
|
|||
|
||||
void terminate() {
|
||||
if (isRunning && _process != null) {
|
||||
Process.killPid(this._process?.pid as int);
|
||||
Process.killPid(_process?.pid as int);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class Subtitles {
|
|||
Subtitles({
|
||||
required this.subtitles,
|
||||
});
|
||||
late String languageCode;
|
||||
final List<Subtitle> subtitles;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class Path {
|
|||
file.delete(recursive: true);
|
||||
}
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
} on Exception {
|
||||
result = false;
|
||||
}
|
||||
c.complete(result);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import 'dart:convert';
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:dart_framework/utils/system_util.dart';
|
||||
import 'package:http/http.dart';
|
||||
// ignore: depend_on_referenced_packages, implementation_imports
|
||||
import 'package:http_parser/src/media_type.dart';
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ class SlackSender {
|
|||
|
||||
if (response.statusCode < 300 && response.statusCode >= 200) {
|
||||
print(response.body);
|
||||
if (completeListener != null) completeListener!(response.body);
|
||||
if (completeListener != null) completeListener(response.body);
|
||||
} else {
|
||||
if (errorListener != null) errorListener!(response);
|
||||
if (errorListener != null) errorListener(response);
|
||||
}
|
||||
|
||||
c.complete();
|
||||
|
|
@ -107,9 +107,9 @@ class SlackSender {
|
|||
|
||||
var result = await response.stream.bytesToString();
|
||||
if (response.statusCode < 300 && response.statusCode >= 200) {
|
||||
if (completeListener != null) completeListener!(result);
|
||||
if (completeListener != null) completeListener(result);
|
||||
} else {
|
||||
if (errorListener != null) errorListener!(result);
|
||||
if (errorListener != null) errorListener(result);
|
||||
}
|
||||
|
||||
c.complete();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import 'dart:convert';
|
|||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:path/path.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue